Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

<CFINCLUDE> Doesn't Keep Javascript Functionality

Status
Not open for further replies.

scripter73

Programmer
Apr 18, 2001
421
US
Hi,

I have a .CFM template that was originally handed off to me as a .HTML file, so I could include the ColdFusion functionality.

In the original .HTML file, there were Javascript includes for headers/footers. The shell of the .HTML file looks like the following:


<html>
<head>
<!--#include file=”include/header.html”>
<script language=”Javascript” type=”text/Javascript”>
…..standard rollover functions here; image swapping functions
</script>
</head>

<body onload=”…..loads images”>
<!--#include file=”include/navigation.html”>

<!--#include file=”include/footer.html”>
</body>
</html>




Before I change these includes, the rollover works great. However, in order for the header, navigation, and footer to show, I have to update the #include to <cfinclude>. Here’s the shell for that:



<html>
<head>
<cfinclude template=”include/header.html”>
<script language=”Javascript” type=”text/Javascript”>
…..standard rollover functions here; image swapping functions
</script>
</head>

<body onload=”…..loads images”>
< cfinclude template =”include/navigation.html”>

< cfinclude template =”include/footer.html”>
</body>
</html>




When I do this, though, the header, navigation, and footer info shows, but the rollover no longer works. Is there a way to keep my include and retain the JS as well?


Any help is appreciated.


Thanks,
Scripter73




Change Your Thinking, Change Your Life.
 
Using CFINCLUDE shouldn't have any effect on your javascript functions. Something else must be going on.

Have you pulled up the page in the browser and viewed source just to make sure the version that the browser receives has all the appropriate functions and image names/ids?



-Carl
 
Hi,

Thanks for answering. Yes. I have checked the ViewSource. The other ones work, though. Not sure what else to tell you unless you want me to email you the entire .HTML. Then you could replace the #includes with <cfinclude>.

Thanks. I'll keep investigating.




Change Your Thinking, Change Your Life.
 
Just for... well... an interested test...

rename header.html to header.cfm (you don't even have to change any of the code in the file itself) and then cfinclude template=&quot;include/header.cfm&quot;... and the same for the other includes.

It shouldn't matter... but maybe...


-Carl
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top