Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Won't work on FireFox

Reply
Thread Tools

Won't work on FireFox

 
 
Alex
Guest
Posts: n/a
 
      10-16-2006
Something is wrong, the </script> tag in the string for some reason is
the cause from what I can figure. When I remove it, it runs but not as
it should since it is a broken HTML then.

<html><head></head><body>
<script language="javascript">
function showme(){
a=window.open("","Thank You","status=1,width=350,height=150");
a.document.write('<html><body><img
src="http://www.google.com/intl/en/images/logo.gif"><script
language="javascript">window.location="http://www.aol.com"</script></body></html>');

a.document.close();}
showme();
</script>
</body></html>

 
Reply With Quote
 
 
 
 
Joshie Surber
Guest
Posts: n/a
 
      10-16-2006
The JS interpreter sees the </script> inside your string and closes the
script. This may not be the Right Thing, but a simple workaround would
be to replace </script> with </'+'script inside the string.

Alex wrote:
> Something is wrong, the </script> tag in the string for some reason is
> the cause from what I can figure. When I remove it, it runs but not as
> it should since it is a broken HTML then.
>
> <html><head></head><body>
> <script language="javascript">
> function showme(){
> a=window.open("","Thank You","status=1,width=350,height=150");
> a.document.write('<html><body><img
> src="http://www.google.com/intl/en/images/logo.gif"><script
> language="javascript">window.location="http://www.aol.com"</script></body></html>');
>
> a.document.close();}
> showme();
> </script>
> </body></html>


 
Reply With Quote
 
 
 
 
David Dorward
Guest
Posts: n/a
 
      10-16-2006
Joshie Surber wrote:

> The JS interpreter sees the </script> inside your string and closes the
> script. This may not be the Right Thing,


It is "the right thing", and there are further errors in the markup that the
validator would pick up.

> but a simple workaround would
> be to replace </script> with </'+'script inside the string.


Simpler would be: <\/script>


--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
 
Reply With Quote
 
One Dumm Hikk
Guest
Posts: n/a
 
      10-17-2006


On Oct 16, 2:17 pm, "Joshie Surber" <joshiesur...@gmail.com> wrote:
> The JS interpreter sees the </script> inside your string and closes the
> script. This may not be the Right Thing, but a simple workaround would
> be to replace </script> with </'+'script inside the string.


And that can still cause errors. It's not the "JS interpreter" but
rather the HTML parser that looks, and it isn't looking for </script>,
it can simply look for </ and end the script block.

The "correct" solution is to escape the / in the tag:

<\/script>

--
Randy

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can Firefox 1.5 be installed along side Firefox 1.0.6? Zygon Curry Firefox 6 09-14-2005 11:28 AM
Firefox/Linux import bookmarks from Firefox/Windows? Marek Williams Firefox 2 06-11-2005 04:22 PM
Yahoo! Toolbar Beta for Firefox - Not Compatible with Firefox 1.0.2? NA Firefox 6 04-02-2005 06:13 PM
Firefox gamed - Drudge getting around Firefox popup blocker Venger Firefox 10 12-22-2004 04:37 AM
so what does IE or any of the IE shells have over firefox ? (any anti firefox ppl bother looking at recent plugins available?) *ProteanThread* Firefox 12 10-20-2004 08:31 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57