简体   繁体   中英

Fix Web App bugs by reloading page, or reloading script / external resource

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?

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM