views:

126

answers:

2

Say I just found a bug involving javascript workflow in a web app. Most of the time I will fix the bug and reload the page. Unfortunately this is a time consuming process reloading the page all the time. Does anybody else save time by reloading updated Javascript / CSS without reloading the page. Are there any tools to help make this easy.

I understand that not all bugs can be fixed by just reloading the script, such as when the bug was in the window.onload event handler, but certainly alot of run time errors could be fixed.

I also understand that global functions are easier to hotfix then javascript written in modules (function(){})().

Just wanted to see what the stackoverflow community thought on the subject.

Thanks

How about reloading css files?

A: 

Mozilla Venkman for Firefox apparently has the ability to reload the JavaScript on a page.

jmah
+1  A: 

I'd say it's better you look into the underlying issue as to why it's taking your page so long to load in your development environment.

You could trivially write some code to reload javascript using ajax, or some similar solution, but it would be quite strange and non-standard, so I would really not recommend it. Further, it wouldn't emulate the end-user environment, so it's not that good for testing purposes.

My recommendation: Fix the slow loading of your site in dev, and reload with reckless abandon.

Noon Silk