| | |||||
| ||||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| NamePros Member Join Date: Aug 2003 Location: Ontario, Canada
Posts: 98
![]() | 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? |
| |
| | #2 (permalink) |
| Senior Member Join Date: Aug 2002
Posts: 1,255
![]() ![]() | 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> |
| |
| | THREAD STARTER #3 (permalink) |
| NamePros Member Join Date: Aug 2003 Location: Ontario, Canada
Posts: 98
![]() | 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? |
| |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| |