I was developing a webpage and I included some scripts on it. When I try running it locally (using Chrome) code added (a script) at the end before the </body>.
<script src="//s3.amazonaws.com/jscache/fc48c8b8268e72e740.js"></script>
It is sound like a cache on my website.. because when I make some changes on my style-sheet the code won't work, and I need to hard refresh it.. sometimes empty cache and hard reload. In the past weeks I did not encounter this.
I don't included such script on my website or any related to it. Why was that? Did chrome browser automatically adding it? If yes, why? Is it vital?
Related
I'm having a very weird JS issue here: JS doesn't seem to run at all while the user selects a file for upload. To cause it simply don't close the file selection dialog. After a while the session times out. I've tried all sorts of settings, but I can't get around it.
I'm not sure, but it looks like it's only IE. Chrome and FF seem to run JS in the background.
Is there something I can include into the web page to tell the browser not to halt JS while picking files ?
The solution as proposed by #blex works perfectly.
I try to debug my JavaScript but the issue is more about VS2012. When I run the website debugger it creates some dynamic pieces of code which you can study while debugging but all the JavaScript code doesn't update once I run the debugger. In short it runs the same JavaScript code as the first time I saved the respective document containing the current code. It seems to me like a pretty huge bug, and therefore it also encouraged me to investigate it through the internet but I seem to be the only one to experience it.
I think that's because you're trying to change the dynamic scripts. It doesn't work...
Instead of that, you should edit your source files and save them. If you do so, you don't need to stop the debugging process and start it again.
Just do edits in the source files and save them, then refresh your running page in browser and it works...
So I'm debugging some code at work that I didn't write, and I'm having trouble understanding why in Firefox I have additional .js files loaded than I do in Chrome.
After scouring the code I can't seem to locate where these .js files are being included. I'm wondering if this is something Firebug can tell me or if another add-on or another method entirely can come to the rescue.
Thanks for your time.
Firefox can trigger a breakpoint on DOM manipulation (right-click on the node you're interested in) - if the scripts are being inserted while the page is running, you could break at the very start of the page loading and then set a DOM breakpoint on the parent tag of where the script is being inserted. Then, when the script tag is added, you'll get a break and a call stack.
I'm doing some debugging on my site that has multiple scripts running. When I debug in firefox using firebug, the specific script I'm working on, (basically a series of jQuery listeners), shows up, breakpoints work - awesome. When I debug in chrome though, the script shows up under resources, but not under scripts. I can't put in breakpoints! I'm not a big fan of firebug, and I would really prefer to use chrome's debugger.
I'm not 100% where the problem is. It could be chrome (that's where I'm leaning), but I am debugging the script, so it's nowhere near stable enough to rule out. (The functions in the listeners aren't breaking in firebug)
Q: How does chrome decide to put something in the scripts tab and thereby allow debugging? and does it ever get this wrong and exclude scripts that run?
DevTools may omit scripts that are fully collected at some moment of time. For example if you script does not have any function, it will be fully collected once it ran.
Could it be your case?
From what I understand, imported scripts are put in a separate script pane whereas scripts embedded in the webpage are displayed in the webpage pane (yourpage.html). You can still access the webpage pane for debugging most of the time. I haven't ever had anything like the problem you're describing though, so I may not understand your issue.
I need to debug jasvascript loaded by page. Loaded page are not locally placed.
Loaded js is packed. I want to substitute it with unpacked version.
Is there any tricks or browser options to make it?
It looks like Fiddler's AutoResponder tab will do this for you.
You say you want to replace the JS with the "unpacked" version--if you just want to insert line breaks so you can step through in a debugger, the Venkman debugger has a "Pretty Print" button which does that.
It sounds like you are asking for after the application is already deployed somewhere so this might not be as helpful.
If your application already goes through a regular build script or process for debug or at least for release then you could do it there. You could leave the Javascript files as the un-minified/optimized scripts and when building for debug it just copies them over, but for release it runs them through your minifier/optimizer first before copying them over.
I know that jQuery uses a Google Compiler to package the framework up, but there are other tools that just minify the code. Also it gives you a chance to run any kind of quality checking tools (such as JSLint) on your Javascript when you already have it as part of your build process.
Other then that the AutoResponder idea from above sounds promising.
You could use Charles Web Debugging Proxy to map the requested JS file to a local unpacked JS file (or any other location). It costs money, but you can use the trial for 30 minute periods.
Firebug is a really good Firefox extension that lets you manipulate the DOM and you can see the changes as they happen. This will let you insert <script> tags to the page.
Just Edit the <head> piece of html through Firebug and insert the <script src="http://site.com/unpacked.js"></script> somewhere in the page.