• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

IE page source differs from Chrome page source...

Ichinisan

Lifer
I have a PHP submission form that seems to work fine in both IE and Chrome. When viewing page source in Chrome, I noticed that a <script> tag was never closed:

Chrome:
Code:
<script type='text/javascript'>document.getElementById("submitted").value="yes";

IE:
Code:
<script type='text/javascript'>document.getElementById("submitted").value="yes";</script>

From my PHP source, this is the statement that generates that bit of HTML:
Code:
echo '<script type=\'text/javascript\'>document.getElementById("submitted").value="yes";</script>';

I'm new to PHP and I'm not very familiar with the syntax. I understand that \' should output a single-quote, and a "." combines literal strings and string variables.

"submitted" is a hidden input element, only there to detect if the page was loading for the first time, or if the user already clicked "Submit" without completing all the required fields.

Is there some better way to do that statement?

Thanks!

...now that I think about it, PHP is pre-processed. Why would the server send different HTML to IE versus Chrome? My code has no manual browser detection.

[edit]
I used telnet to request the page without using any browser. The server definitely returns valid code with the closing tag. Why does Google Chrome omit this from the page source?!
 
Last edited:
OK, I've simplified it to pure HTML (no PHP) and confirmed that there's a problem with Chrome's View Source option (even when displaying a local HTML file).

Code:
<html>
<input id='submitted'>
<script type='text/javascript'>document.getElementById("submitted").value="Hello, World!";</script>
</html>

Chrome is missing the closing </script> tag when I use the "View Page Source" option. IE shows the closing tag in the source.
 
Does the source show the closing script tag if you close your input tag and give it a type like so?
Code:
<input type="text" id="submitted" />

I am able to see the closing script tag within my Chrome regardless though.
 
I'll have to try that when I get back to work.

I'm using Chrome at home and, just like you, I see the tag with the example HTML.
 
Tested with the /> in the Input element. Made no difference.

I'm using Chrome 16.0.891.0 dev-m, so I guess I should report this to the devs before the bug makes it into a regular release.
 
After having experienced some of the differences between older IE's and the new IE9, I'd have to suggest letting us know which version you are using. IE9 is a headache so far.
 
I'm using Chrome 16.0.891.0 dev-m, so I guess I should report this to the devs before the bug makes it into a regular release.

I would consider that an important piece of information that should have been mentioned in the first post 🙁
 
Back
Top