-1

I had a javascript code in my HTML document, then I decided to load that code from .js file rather than writhing it directly in HTML document, but after that I decided not to use it at all and deleted my tag. After that I opened my HTML file and JavaScript was still running. I deleted the .js file and it still executes. Also tried to copy my document to new HTML file but it still does the same. What can be the problem? Using TextWrangler on Mac OS X 10.10.5 Yosemite

vucko95
  • 103
  • 1
  • 7

4 Answers4

0

From what you have described, this is not possible. Use your browser debugging tools to trace which JavaScript sources it is loading, and any network events (if necessary). You may just be modifying the incorrect file!

If it is using an older version of the code, clear your browsers cache as mentioned in the comments (CTRL + F5, or if using Chrome, open up Debugging Tools and then long press on the Refresh button and click "Empty Cache and Hard Reload"), or temporarily modify your HTTP server to send a Cache-Control: no-cache HTTP header.

Mayazcherquoi
  • 474
  • 1
  • 4
  • 12
  • Deleted whole browser History with cache, in Debugging Tools did "Empty Cache and Hard Reload", in source there is no .js file loading. There is no trace on that .js file in my computer but it is somehow loading. Installed new browser and opened the same index.html file and still there is that .js file executing – vucko95 Mar 19 '17 at 10:20
  • How are you sure it's actually the JS file executing? Do you have any browser extensions running (GreaseMonkey / TamperMonkey) that could potentially interfere with the website? – Mayazcherquoi Mar 20 '17 at 04:36
0

position: fixed; in my #navwrap in css, no .js. I Apologize

vucko95
  • 103
  • 1
  • 7
0

I had a similar problem and found the issue. I wracked my brain as to how the browser could be running scripts from a deleted file.

I'm running XAMPP to test a site that utilizes PHP-JS-MySQL communication and all of my javascript codes for a given page are kept in one particular javascript file. Even when I changed the javascript file name, the code was still running an older version in my browser..! Well, it turns out I inadvertently changed my server ('localhost') folder so HTML could not find the javascript file... there must be a memory leak in javascript or Chrome because it still remembered the older version of the .js file. I fixed it by correcting the javascript reference embedded in the page's HTML:

OLD:

<script type="text/javascript" src="http://localhost/ServerSideCode/phplogin/consignEdit.js"></script>

NEW:

<script type="text/javascript" src="http://localhost/consignEdit.js"></script>
Ali
  • 2,702
  • 3
  • 32
  • 54
Ed Ray
  • 21
  • 2
-1

I know the thread is old but this just happened to me and... you might have two copies of the same file running... and you might be updating the wrong one.