0

jQuery Ajax call not working in Chrome Browser.

my code :-

function memories(pageName)
{
   $.ajax({
   type: "POST",
   url: pageName,   
    success: function(html){
        $("#page").load(pageName); 

   }
 });    
}
0

2 Answers 2

3

You're calling load, but not passing in a URL. load is for loading content from a URL and then applying it to an element. You either want to use it without ajax, or you want html.

E.g., either:

function memories(pageName)
{
    $("#page").load(pageName);
}

or (more likely, as you've used POST, although as you haven't supplied any params it's not clear):

function memories(pageName)
{
   $.ajax({
   type: "POST",
   url: pageName,   
    success: function(html){
        $("#page").html(html); 

   }
 });    
}
Sign up to request clarification or add additional context in comments.

Comments

1

You are using load() where you should be using html() to set the contents of an element:

function memories(pageName)
{
   $.ajax({
       type: "POST",
       url: pageName,   
       success: function(html){
           $("#page").html(html); 
       }
   });    
}

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.