Reputation: 1953
jQuery Ajax call not working in Chrome Browser.
my code :-
function memories(pageName)
{
$.ajax({
type: "POST",
url: pageName,
success: function(html){
$("#page").load(pageName);
}
});
}
Upvotes: 0
Views: 768
Reputation: 1073988
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);
}
});
}
Upvotes: 3
Reputation: 237817
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);
}
});
}
Upvotes: 1