Dynadot Aftermarket: discover domain gems worth investing in. Visit our aftermarket.

Javascript: W3C Problem?

SpaceshipSpaceship
Namecheap AuctionsNamecheap Auctions
Namecheap AuctionsNamecheap Auctions
Watch

Mp)Tarh

Established Member
Impact
1
I've always followed the standards set by the W3C, and have always trusted them. Today however, those standards seem to have failed me.

I am sure you all know about window.location.replace() in JavaScript. I have set my document to a basic HTML 4.01 Trans. with text/html meta content type with windows-1252 character encoding.

Are you with me so far?

Now I put in a JavaScript with a window.location.replace(). However, while running this code it doesn't redirect! I narrowed it down to this exact line of code. It works when I put in a window.location = "site.html" but I'm a real stickler for no back buttons :D

If I take out the HTML 4.01 Trans. declaration, it works fine. BUT I WANT MY W3C MARKER! :(
 
0
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
This seems to work for me with the HTML 4.01 DTD on IE 6.0.
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>window.location.replace</title>

<script type="text/javascript">

function replaceWin() {
	window.location.replace("http://webdesigntalk.net");
}
</script>
</head>
<body>
<input type=button value="Click" onclick="replaceWin()">
</body>
</html>

What browsers have you tried it on? I'm not really sure what the problem would be, possibly something with the characte encoding maybe?
 
0
Close
I've only tried it on IE 6.0.2800.1106.

But for some reason, it seems to work now.
I didn't change anything, but it goes perfectly?!
I just had to wait a few days.

:-/

But, who really cares, it works now.
Thanks for your help!
:beer:
 
0
Close
DomainEasy: white label portfolios are live. Enable yours.

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

Switch between accounts
You can now stay logged in to more than one NamePros account in the same browser. Click your avatar, then "Accounts in this browser", to...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back