Webmastersite.net
Register Log In

Java script in wrapper
script will not run

Comments on Java script in wrapper

Rik
Forum Regular

Usergroup: Customer
Joined: Sep 22, 2004
Location: Wake Forest, NC

Total Topics: 23
Total Comments: 161
Rik
Posted Sep 05, 2005 - 9:41 AM:

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>
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Sep 06, 2005 - 1:23 PM:

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.
Rik
Forum Regular

Usergroup: Customer
Joined: Sep 22, 2004
Location: Wake Forest, NC

Total Topics: 23
Total Comments: 161
Rik
Posted Sep 06, 2005 - 6:54 PM:

That works!

Thanks once again Paul.

Search thread for
Download thread as
  • 0/5
  • 1
  • 2
  • 3
  • 4
  • 5



This thread is closed, so you cannot post a reply.