Lunarpages Web Hosting Forum

Author Topic: Embedded javascript not working  (Read 9093 times)

Offline 1DollarDean

  • Newbie
  • *
  • Posts: 2
Embedded javascript not working
« on: December 18, 2007, 06:19:36 AM »
Hi Everyone.  This is my first post so I hope I don't mess it up.

I have a very simple line of code that cloaks my affiliate link in the status bar of the browser.

   <p><a href="" target="_blank" onmouseover="window.status='';return true;" onmouseout="window.status=' ';return true;"><img src="" width="468" height="60" alt="" border="0"/></a></p>

The code runs fine locally but refuses to work on the server.  I have tested it with both IE7 and Firefox with javascript on.  I've run the code locally on my xampp Apache server and it works fine.  On the Lunarpages server the embedded javascript does not work.    The uploaded html file that contains this line of code runs fine on the server except for the embedded javascript so the file is not corrupt.  I know that javascript actually runs in the browser and not on the server and as far as I know there are no server settings related to javascript so why doesn't it work?

Any help with this problem would be greatly appreciated.  Please keep in mind that I am not a javascript programmer so please keep it simple for my simple mind. :-)

Offline scanman20

  • Senior Moderator
  • Über Jedi
  • *****
  • Posts: 1556
Re: Embedded javascript not working
« Reply #1 on: December 18, 2007, 06:43:35 AM »
In terms of Firefox this is a security feature. Window.status is disabled by default from being affected by JavaScript. You can edit your about:config dom.disable_window_status_change but that would only affect you and not your users. Basically this stops people from hiding where links are going to which is what you're trying to accomplish. As for IE7, according to the mdsn blog, "Status Bar Scripting--Scripts will no longer be able to set the status bar text through the window.status and window.defaultStatus methods by default in the Internet and Restricted Zones. This helps prevent attackers from leveraging those methods to spoof the status bar."
« Last Edit: December 18, 2007, 06:46:39 AM by scanman20 »
Even a broken clock is right twice a day.
MCSE - MCSA - MCP (<- unused since 2006!)

Offline 1DollarDean

  • Newbie
  • *
  • Posts: 2
Re: Embedded javascript not working
« Reply #2 on: December 18, 2007, 07:08:13 AM »

You answered my question.

Now what I need is a way to redirect the link.  I use a redirect for several of the links on my website to mask my affiliate links but links that display an image or banner cannot be redirected using any of the methods I've been using.  I understand that the 1px image displayed by some affiliate text links must be displayed for tracking purposes and that keeps me from using a redirect.  So it's back to the drawing board for me and my primative programming skills.  Or I'll just have to leave those ugly affliate links hanging out there in the open.

Thanks again and have a Merry Christmas!