When using Chrome console, I am editing the value of a variable that is set in the document ready event, but obviously this event has already fired and me editing the variable will have no effect.
Is there a way to re-run this event somehow?
When using Chrome console, I am editing the value of a variable that is set in the document ready event, but obviously this event has already fired and me editing the variable will have no effect.
Is there a way to re-run this event somehow?
Either edit your js files and refresh the page, or enter whatever you want to change into the console part of the Chrome Development Tools to see it without having to refresh the page
For e.g. $('p').hide();
Although you will obviously still need to edit your files to keep this change permanently.
I'm not saying this is a good idea, as it's an event which is supposed to fire once when the DOM is ready, but have you tried this?
$().trigger('ready')
scratch that - it won't work as jQuery gets rid of the event handler once it has run the first time.
See this question:
How to trigger $().ready() in jQuery?
So you'd probably have to rewrite all of your JS to fit into a separate function and then run that function again.
Having said that, the scope of the variable you are changing would need to be outside of that new function if it is going to retain the value you have changed it to.