Link to home
Start Free TrialLog in
Avatar of error77
error77

asked on

reload the page without refreshing???

Hi all,

I've got some javascript on the $(document).ready(function(){  ... so what page ls loaded.

I have a variable which is changed at runtime ... now depending on the value of this variable some div's are loaded or not.

How can I make the call the $(document).ready(function(){ at runtime please ... or if it cannot be done... how can I do this please?

thanks


Avatar of Gurvinder Pal Singh
Gurvinder Pal Singh
Flag of India image

if you are loading the div with an ajax response, you can then use the callback handler of that ajax call
<<How can I make the call the $(document).ready(function(){ at runtime please ... or if it cannot be done... how can I do this please?>>
document.ready is called by itself. Its basically a event handler which is invoked when the page is loaded.

But why do you want to call this document.ready at run-time at first place?
Avatar of error77
error77

ASKER

Ref: But why do you want to call this document.ready at run-time at first place? ... I have some code that runs on $(document).ready(function(){ and I basically want to run it again because I'm changing things at runtime

For example, I have:

IF (thisvariable==0) {
  $('#myDiv1').hide();
} else {
    $('#myDiv1').show();
}

Now... when I change "thisvariable" value at runtime, I need to re-run the code so changes are made acordingly...know what I mean?

Thanks

ASKER CERTIFIED SOLUTION
Avatar of Gurvinder Pal Singh
Gurvinder Pal Singh
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial