Question

I'm using the .load() function in jquery to insert the results of a php file to an element. My code looks likethis:

$('#edit .postcontent').load('admin-ajax.php', {'action':'qe-getpost'});

Everything works great - the returned value is loaded into .postcontent perfectly. However, a 0 is appended to the end. Every time. Even if I return nothing, a lonely 0 shows up inside .postcontent. Can anyone explain what is going on?

Thanks!

Was it helpful?

Solution

What content-type is admin-ajax.php returning? When you use Fiddler or some other debugging proxy to examine the actual content of the HTTP response, do you see the 0 there (or any other spurious characters)?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top