Forum Moderators: open

Message Too Old, No Replies

Conflict between js and gif's?

         

Dexie

1:42 pm on Jan 29, 2005 (gmt 0)

10+ Year Member



Hi all,

I have this in a page:

<a href="javascript:mailpage()">Send details of this page to a friend<span style="text-decoration: none">
</span></a>

<script language="JavaScript" type="text/javascript" src="sendtofriends.js">
</script

**and in the sendtofriends.js file is this:

<!-- hide script from old browsers

function mailpage()
{
mail_str = "&#109;&#097;&#105;&#108;&#116;&#111;:?subject=" + document.title;
mail_str += "&body=Hi,%0D%0A%0D%0AJust came across this webpage and thought you might like to see it.%0D%0A%0D%0A" + document.title;
mail_str += ".%0D%0A%0D%0A" + location.href;
location.href = mail_str;
}

// end hiding script from old browsers -->

But the problem is that whenever anyone clicks on it, the gif images on the page stop moving - is there a known conflict between javascript and gif's please?

Any help would be much appreciated.

Sev.

kaled

3:04 pm on Jan 29, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Firstly, in external javascript, there is no need to "hide from old browsers".

Secondly, there is no point obfuscating the "mailto:" at the beginning.

However, to answer your question, the gif animation may terminate as a result of the attempt to change location.

You could try location.replace(mail_str); but I'm less than confident this will work.

Kaled.