The following code is being used on my web site and works fine in a file I call top.html which is inserted at the top of all the pages in my web site.
I have included the code of top.html in my WSN Links wrapper.tpl file so that it has the "look" of my other site pages.
When I insert this code in my wrapper.tpl code it does not run the script and display the text and link. I have a Google adsense script in the wrapper and it runs ok.
<!-- This script and many more are available free online at --> <!-- The JavaScript Source!! http://javascript.internet.com --> <!-- Original: David Henry (davidputhenry@hotmail.com) --> <!-- Web Site: http://www.davidphenry.com/ -->
<!-- Begin function isPPC() { if (navigator.appVersion.indexOf("PPC") != -1) return true; else return false; } if(isPPC()) { document.write('<b>Send <A CLASS="contact" HREF=\"mailto:\?subject\=Take a look at this page I found, ' + document.title + '?body=You can see this page at: ' + window.location + '\" onMouseOver="window.status=\'Send your friends e-mail about this page\'; return true" TITLE="Send your friends e-mail about this page">this page<\/A> to a friend</b>'); } else { document.write('<b>Send <A CLASS="contact" HREF=\"mailto:\?body\=Take a look at this page I found, ' + document.title + '. You can see this page at: ' + window.location + '\" onMouseOver="window.status=\'Send your friends e-mail about this page\'; return true" TITLE="Send your friends e-mail about this page">this page<\/A> to a friend</b>'); } // End --> </script>
Slashes probably get stripped when it's used directly in the page, and other characaters may be parsed differently as well. It's always best to make your javascripts external calls -- makes upgrading the template much easier as well. Save it in a file stuff.js and use <script language="JavaScript" src="stuff.js"></script>
Edit: The auto-prepending of the forum url there seems to be a little bug, ignore it.
Comments on Java script in wrapper
Forum Regular
Usergroup: Customer
Joined: Sep 22, 2004
Location: Wake Forest, NC
Total Topics: 23
Total Comments: 161
The following code is being used on my web site and works fine in a file I call top.html which is inserted at the top of all the pages in my web site.
I have included the code of top.html in my WSN Links wrapper.tpl file so that it has the "look" of my other site pages.
When I insert this code in my wrapper.tpl code it does not run the script and display the text and link. I have a Google adsense script in the wrapper and it runs ok.
Any suggestions?
The code:
<div align="center">
<font face="Verdana" color="#0000FF">
<SCRIPT LANGUAGE="JavaScript">
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->
<!-- Original: David Henry (davidputhenry@hotmail.com) -->
<!-- Web Site: http://www.davidphenry.com/ -->
<!-- Begin
function isPPC() {
if (navigator.appVersion.indexOf("PPC") != -1) return true;
else return false;
}
if(isPPC()) {
document.write('<b>Send <A CLASS="contact" HREF=\"mailto:\?subject\=Take a look at this page I found, ' + document.title + '?body=You can see this page at: ' + window.location + '\" onMouseOver="window.status=\'Send your friends e-mail about this page\'; return true" TITLE="Send your friends e-mail about this page">this page<\/A> to a friend</b>');
}
else { document.write('<b>Send <A CLASS="contact" HREF=\"mailto:\?body\=Take a look at this page I found, ' + document.title + '. You can see this page at: ' + window.location + '\" onMouseOver="window.status=\'Send your friends e-mail about this page\'; return true" TITLE="Send your friends e-mail about this page">this page<\/A> to a friend</b>');
}
// End -->
</script>
</font>
</div>
developer
Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California
Total Topics: 61
Total Comments: 7868
Slashes probably get stripped when it's used directly in the page, and other characaters may be parsed differently as well. It's always best to make your javascripts external calls -- makes upgrading the template much easier as well. Save it in a file stuff.js and use <script language="JavaScript" src="stuff.js"></script>
Edit: The auto-prepending of the forum url there seems to be a little bug, ignore it.
Forum Regular
Usergroup: Customer
Joined: Sep 22, 2004
Location: Wake Forest, NC
Total Topics: 23
Total Comments: 161
That works!
Thanks once again Paul.