Reputation: 663
I need a little guidance. I am trying to delay the execution of these two functions until after the page is fully loaded or timebomb them to happen after 5000 ms.
I am using the latest jquery 1.6
Thank you in advance for your help and code snippits :)
$("a.siteNavLink").each(function() {
var _href = $(this).attr("href");
$(this).attr("href", _href + '?p=client');
});
$("a.footernav").each(function() {
var _href = $(this).attr("href");
$(this).attr("href", _href + '?p=client');
});
Upvotes: 1
Views: 457
Reputation: 25776
You can use
$(window).load(function(){ your code here }) // page has loaded including images
or
$(document).ready(function(){ your code here }) // dom has loaded
Upvotes: 3
Reputation: 36956
$(document).ready(function() {
// Your code here
});
That will make your code run only when the document is fully loaded
Upvotes: 2