Jump to content


Photo

Please help me before i throw myself off this cliff!!


  • Please log in to reply
4 replies to this topic

#1 d_barszczak

d_barszczak
  • Members
  • PipPipPip
  • Advanced Member
  • 188 posts
  • LocationBradford - UK

Posted 20 October 2006 - 11:14 AM

Can any one find a problem with the following javascript?

< script Type=text\javaScript Language=javaScript>
window.location.replace('www.google.com');
</ script>

Please note the space between < script is not an error just the forum would let me submit.

This has worked fine for me for over 12 months but since my workplace upgraded to ie7
it's all gone to pot. The browser just seems to ignore the code all together. Fire Fox too.

When all else fails - Try reading the manual.

Integrated IT Systems Ltd


#2 obsidian

obsidian
  • Staff Alumni
  • Advanced Member
  • 3,202 posts
  • LocationSeattle, WA

Posted 20 October 2006 - 12:10 PM

you don't need replace on there. you simply need to make your window.location equal to where the browser needs to go:
window.location = "http://www.google.com";

upgrading to IE7 would not effect how FF interprets the javascript.
You can't win, you can't lose, you can't break even... you can't even get out of the game.

<?php
while (count($life->getQuestions()) > 0)
{   $life->study(); } ?>
  LINKS: PHP: Manual MySQL: Manual PostgreSQL: Manual (X)HTML: Validate It! CSS: A List Apart | IE bug fixes | Zen Garden | Validate It! JavaScript: Reference Cards RegEx: Everything RegEx

#3 fenway

fenway
  • Staff Alumni
  • MySQL Si-Fu / PHP Resident Alien
  • 16,199 posts
  • LocationToronto, ON

Posted 20 October 2006 - 04:18 PM

Also, it should be text/javascript - note the forward slash.
Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.

#4 obsidian

obsidian
  • Staff Alumni
  • Advanced Member
  • 3,202 posts
  • LocationSeattle, WA

Posted 20 October 2006 - 05:04 PM

Also, it should be text/javascript - note the forward slash.

with quotes around it ;)

< script type="text/javascript">
window.location = "http://www.google.com";
</ script>

You can't win, you can't lose, you can't break even... you can't even get out of the game.

<?php
while (count($life->getQuestions()) > 0)
{   $life->study(); } ?>
  LINKS: PHP: Manual MySQL: Manual PostgreSQL: Manual (X)HTML: Validate It! CSS: A List Apart | IE bug fixes | Zen Garden | Validate It! JavaScript: Reference Cards RegEx: Everything RegEx

#5 fenway

fenway
  • Staff Alumni
  • MySQL Si-Fu / PHP Resident Alien
  • 16,199 posts
  • LocationToronto, ON

Posted 22 October 2006 - 09:05 PM

Also, it should be text/javascript - note the forward slash.

with quotes around it ;)

< script type="text/javascript">
window.location = "http://www.google.com";
</ script>

I always quote everything... but isn't the slash considered a non-whitespace?
Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users