views:

1081

answers:

3

Hi

I am using JQuery Address plugin for address.change event the problem is that this event occurs before document is fully loaded ( in FireFox & safari )

how can I wait for it to load?

thanks.

+4  A: 

$(document).ready(function() {
    // put your address.change event and function here
});
mgroves
+1  A: 

Here's a shorter way:

$(function() {
    // code here
});
Matt
A: 

the problem is i need the code to happen in $address.change and not in $(document).ready

Fine, so put your $address.change inside of the $(document).ready function.
mgroves
It does'nt solve the problem...
Are you saying that when you put address.change inside of the document.ready function that the event still occurs before the document is loaded?
mgroves
no, but now it sometimes occurs and sometimes not at all..
Well it sounds like your initial problem is fixed, and now you have a new problem.
mgroves
I sovled my new problem by puting my code both in $(document).ready and $address.change ( with a little check if the code occured alreay )thanks for your help!
Hmm, I think that's what I recommended that you do, but I apologize if I wasn't clear--I will update my answer.
mgroves