JQuery .load () Reminder
source link: https://www.codesd.com/item/jquery-load-reminder.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
JQuery .load () Reminder
I'm trying to load some content with an AJAX call and AFTER the content is loaded, perform another action. In my example, that latter action is simply an alert but in my real-world example I'm attempting to focus on an input field.
$("#box").load("/favicon.png", function(response) {
alert('do after the load');
});
https://jsfiddle.net/u0cmmn5h/
As you can see in the fiddle, the alert fires BEFORE the favicon is actually loaded. Isn't the function supposed to fire AFTER the content has been loaded?
The callback on .load()
executes upon an http response, not when the image is rendered client side.
Related Articles
How to disable autocompleted jquery loading
Will jQuery .load () Work on PhoneGap?
Do not use $ _GET in the jQuery.load file
How to embed a file in html using jquery.load () in chrome
Does jQuery .load append instead of replace?
JQuery .load () with relative path - XMLHttpRequest can not load - Workaround?
JQuery Load, stop yourself from not happening twice?
Using jQuery Load to get part of the page
Replace & lt; A href = & ldquo; & Rdquo; & Gt; When you use jquery .load to get content
Loop to jquery load and wait until
List multiple copies of jQuery loaded into a page
Scripts stop working for loaded form - jquery load ajax
Show the jQuery loading progress before the fully loaded page
HTML jQuery .load () does not work
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK