NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page Javascript: W3C Problem?

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search


Closed Thread
 
LinkBack Thread Tools
Old 11-14-2003, 05:38 PM THREAD STARTER               #1 (permalink)
NamePros Member
 
Mp)Tarh's Avatar
Join Date: Aug 2003
Location: Ontario, Canada
Posts: 98
Mp)Tarh is an unknown quantity at this point
 



Javascript: W3C Problem?


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
????: NamePros.com http://www.namepros.com/programming/15585-javascript-w3c-problem.html

If I take out the HTML 4.01 Trans. declaration, it works fine. BUT I WANT MY W3C MARKER!
__________________
Yeah... I knew that. What?
Mp)Tarh is offline  
Old 11-15-2003, 03:16 PM   #2 (permalink)
Senior Member
Join Date: Aug 2002
Posts: 1,255
deadserious has a spectacular aura aboutdeadserious has a spectacular aura about
 



This seems to work for me with the HTML 4.01 DTD on IE 6.0.
????: NamePros.com http://www.namepros.com/showthread.php?t=15585
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?
deadserious is offline  
Old 11-16-2003, 05:26 AM THREAD STARTER               #3 (permalink)
NamePros Member
 
Mp)Tarh's Avatar
Join Date: Aug 2003
Location: Ontario, Canada
Posts: 98
Mp)Tarh is an unknown quantity at this point
 



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:
__________________
Yeah... I knew that. What?
Mp)Tarh is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


Liquid Web Smart Servers  
All times are GMT -7. The time now is 02:37 AM.

Managed Web Hosting by Liquid Web
Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger