Jquery 1.5 $.load not working

825 views Asked by At

The following is working in jquery 1.4.4 but not in 1.5. Please try it on your end and confirm.

$('body').load('test.html');
3

There are 3 answers

1
Hussein On BEST ANSWER

This issue has been fixed and the fix is currently available in the WIP version which can be found at http://code.jquery.com/jquery-git.js. As of today Feb 3, Google and microsoft cdn do not have the very latest WIP version. I don't know how often they update the file. But until they do, the load function will not work.

0
me2 On

I've got the same problem. The declaration of fn.load differs between 1.4.4 and 1.5.0, and this new line seems to be the problem:

if ( jXHR.isResolved() ) {

(line 6146 in the dev version of jquery js)

The requests that worked in 1.4.4 just do not get through it (although the loading is fine, and the content is loaded into the responseText variable).

0
CatsAndCode On

alex,

Thank you so much for posting your answer to this! I have just started teaching myself jQuery, so everything about this framework is new and frustrating to me. I have been using jQuery 1.5 for over a day and a half now trying to create a very simple app that loads a static html dropdown from another page.

After reading this, I changed the following code in my xhtml

<script type="text/javascript" src="http://code.jquery.com/jquery-1.5.js"></script>

TO

<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>

and everything is working fine now.