Previous page javascript getting loaded on new page
Hi,
I am really facing a strange issue. While navigating from one menu to another. The previous page js is getting loaded on a new page and because of that my custom module having form is breaking giving below error.
Uncaught ReferenceError: hbspt is not defined at <anonymous>:64:9 at x (PreviouspageJavasrcipt.js:7691) at h (PreviouspageJavasrcipt.js:7685) at XMLHttpRequest.S.te.onload
If I reload the page, then everything is great. There is no error in the console and page look as per design.
When I try to visit the line no. 7685, 7691 from js. Found the above code before the lines giving error.
/*! * jQuery JavaScript Library v1.11.3 * http://jquery.com/ * * Includes Sizzle.js * http://sizzlejs.com/ * * Copyright 2005, 2014 jQuery Foundation, Inc. and other contributors * Released under the MIT license * http://jquery.org/license * * Date: 2015-04-28T16:19Z */
So it is pretty state forward that the code is from jquery. Where should I modify so that my pages with form look correct when navigated from the previous page.
If your team can really help what part my js is breaking the new page it will be great.
Previous page javascript getting loaded on new page
Hey Mike,
Yes, I am writing all script calls inside after document ready only.
$( document ).ready(function() { // My all js calls });
I am not getting, why navigating from page1 to page2, browser loading javascript attached on page1. If I refresh page2 or visit page2 from any other link. Everything is beautiful.