Forum Moderators: open

Message Too Old, No Replies

IE7 php + javascript bug

         

absalom

2:47 pm on Feb 25, 2007 (gmt 0)

10+ Year Member



Ive run across a problem thats driving me insane. Ive googled and googled but I cant find anything on this. In IE7 the contents of the page disappears randomly like 3 out of 4 times. The source code is still there, and if I use an js-alert it pops up, but the page is absolutly blank.

I have a php-file which echos xhtml and javascript. Its a very very simple page. If i remove the php OR javascript it works perfectly. But when they're combined I keep getting the blank page 3 out of 4 times.

ANYONE?

Birdman

3:00 pm on Feb 25, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Let's have a look at the parts you said you removed.

absalom

3:36 pm on Feb 25, 2007 (gmt 0)

10+ Year Member



Allright, here's one that doesnt work for me in IE7. 3 out of 4 refreshes it only displays the aler box.

<?

echo("

<?xml version=\"1.0\" encoding=\"utf-8\"?>
<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">

<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">
<head>
<title>Foobar</title>
<script type=\"text/javascript\">alert(\"Hello!\");</script>
</head>
<body>Hello!</body>
</html>

");

?>

Birdman

4:21 pm on Feb 25, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I would suggest removing the xml declaration and see if that stops the prob.

An XML declaration is not required in all XML documents; however XHTML document authors are strongly encouraged to use XML declarations in all their documents. Such a declaration is required when the character encoding of the document is other than the default UTF-8 or UTF-16 and no encoding was determined by a higher-level protocol. Here is an example of an XHTML document. In this example, the XML declaration is included.

[w3.org...]

absalom

5:16 pm on Feb 25, 2007 (gmt 0)

10+ Year Member



Nope, that wasnt it.

I've now also found out that it only occurs when I hit the refresh button, not when I hit enter in the address bar.

absalom

5:24 pm on Feb 26, 2007 (gmt 0)

10+ Year Member



TTT