Jump to content

window.onload from two functions breaks my code


mboehler3

Recommended Posts

Hi, I have my page here. There is a tab system on the page that uses javascript. View the source the see the javascript file (tabber9.compressed.js).Now, on my end, I am adding some tracking code. The code looks like this:

<script TYPE='text/javascript' LANGUAGE='JavaScript'><!--	//	window.onload = initPage;	function initPage() {		if (this.GetCustomerGUID)			document.forms["Test"].elements["CustomerGUID"].value = GetCustomerGUID();	}//--></SCRIPT>

The problem is, when I add this code to my footer, it breaks the tab system. The tabs don't work any more.I am not a JavaScript expert by any means (or else I would have known what the issue is! lol) but, I guess it has something to do with the window.onload function? I say that because I see the window.onload code in the tabber javascript as well.Any advice or help anyone can give would be greatly appreciated. Thanks in advance for any help!

Link to comment
Share on other sites

tabber9.compressed.js has a code block that incorporates any window.onload handler you have already assigned into its own onload handler. For it to work correctly, your onload handler needs to be defined BEFORE tabber9.compressed.js is loaded. Simply repositioning the script should do it.

Link to comment
Share on other sites

tabber9.compressed.js has a code block that incorporates any window.onload handler you have already assigned into its own onload handler. For it to work correctly, your onload handler needs to be defined BEFORE tabber9.compressed.js is loaded. Simply repositioning the script should do it.
Ok cool... I apologize in advance, but I don't know what to reposition. Do I need to take a snippit of code out of tabber9.compressed.js and move it to its own .js file?
Link to comment
Share on other sites

No. Move your tracking snippet to a location before you include the tabber script.
Ok, that's what I thought at first. I did move my tracking code before the tabber script, and the tabber still doesn't not function.
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...