#6424 closed bug (invalid)
.load callback function bug
Reported by: | misssprite | Owned by: | |
---|---|---|---|
Priority: | Milestone: | 1.4.3 | |
Component: | ajax | Version: | 1.3.2 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
I wrote : $('#adiv').load('url.html',function(){
alert($('#aspan').text()); aspan is a span elem in the url.html
}); finally i found i can't select any element in the url.html in the callback function so i had to use $.ajax, and the $('#adiv').html(...) function. it seems a bug with jquery the document tree hasn't been constructed when the callback func is called
Change History (3)
comment:1 Changed 13 years ago by
Resolution: | → invalid |
---|---|
Status: | new → closed |
comment:2 follow-up: 3 Changed 13 years ago by
sorry, i made a mistake in the example above. I indeed loaded a html fragment so it is: $('#adiv').load('url.html #anotherdiv',function(){ ...
Strangely, I tried a bare test, leaving only the neccessary elements and it worked! But it doesN'T worked in my real html :( , while the $.ajax and $('#adiv').html(...) way works well
I'm really confused. Probably it's not a bug...
comment:3 Changed 13 years ago by
the WORKING example did NOT working after i copy it to my tomcat space and access through tomcat Jesus! Replying to misssprite:
sorry, i made a mistake in the example above. I indeed loaded a html fragment so it is: $('#adiv').load('url.html #anotherdiv',function(){ ...
Strangely, I tried a bare test, leaving only the neccessary elements and it worked! But it doesN'T worked in my real html :( , while the $.ajax and $('#adiv').html(...) way works well
I'm really confused. Probably it's not a bug...
I am guessing that you may be trying to load an entire html document from url.html, rather than just an html fragment. If that isn't the case, please reopen with a test case. The forum is also a good place to ask questions about suspected bugs before filing a ticket, http://forum.jquery.com .