Hello all -
For a site I am developing it turns out I have about 3 or 4
windows.Onload events that need to happen.
While these were all included in a standard cf template include as the
nav.cfm header file - It turns out that I need to split them out - Some
pages don't use one of the onload initialization statements and it
causes IE 5 and early NS to have run time errors and crash.
I tried splitting them and initializing some in body others in js - and
a trick I read about onload1(), onload2() of sort in body tag.. but I
have had no luck ...
Short Question -
So basically - anyone have a sample piece of code on handling multiple
onLoad js functions?
Long explanation of items/theories tried. Maybe it's simply late and I
am missing something really obvious. Any direction appreciated.
I thought that if I added the lsit of pages to a list array and did
something like this ( quick sample theory/code )
But I did not have much luck -------
array pages = {thisone.cfm, thatone.cfm, anotherone.cfm};
var currentpagename = enviromental variable for current page name;
window.onload = function() {
/* these need to be called on ALL pages */
initializeMenu("infoMenu", "infoActuator", 3, "info");
initializeMenu("industryMenu", "industryActuator", 0);
initializeMenu("documentsMenu", "documentsActuator", 0);
if (bw.bw){
swapImage();
}
/* This needs to be called on ONLY certain pages */
for(int i=0; i<pages array; i++){ // This will include the
scroll text portion if needed
if pages array value = currentpagename;
if (bw.bw) scrolltextInit();
}//END for loop
}
So - I decided to simplify - and simply set a variable LoadScroll on the
pages I needed the scroll to load -
<cfset LoadScroll = "LoadMe">
With a simple
<cfif LoadScroll EQ "LoadMe">
<script type="text/javascript"
src="http://64.234.202.15/scrollsYes.js"></script>
<cfelse>
<script type="text/javascript"
src="http://64.234.202.15/scrollsNo.js"></script>
</cfif>
The contents of the scrollsYes.js and scrollsNo.js were simply the
onload functions -
I know this is NOT a eleqouent solution - but I was just trying to get
anything to work .
In all cases the onload commands still either conflicted or were simply
ignored.
I was really hoping to implement a simple if then statement in an
application.cfm file - But in the first case - for the life of me I
didn't see a CGI variable that existed to get the current file called
and in second case - I got odd misc glitches pop up with no logic of why
it would work then not work.
So basically - anyone have a sample piece of code on handling multiple
onLoad js functions?
Thanks!!!!!!!
jason miller
P.S. I know I reached my question quota for today - just I am supposed
to have quite a large site for final walk through in morning and I am
quite far off. Still have about 13 flash movies and create!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription:
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Your ad could be here. Monies from ads go to support these lists and provide more
resources for the community. http://www.fusionauthority.com/ads.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4