Forum Moderators: open
<a href="foo" <A target="bar"> test </a>
When I opened the page with IE Explorer 5.5 and took a look at the source with the "View Source" feature this snippet of code was unchanged. But when I opened the same page with Netscape 6.1 and used the View Source feature just like I had done with IE Explorer the result was this:
<a href="foo"> <A target="bar"> test </a>
Netscape 6.1 had added a ">" symbol to the original code.
Now I know this code was sick to begin with! But that is not the point.
What I want to know, just out of pure professional curiosity, is why does the Netscape/Mozilla browser modify HTML code like this? I can't believe it is trying to correct sick HTML code!
The fact that it has altered the missing > is probably just an artifact. IE probably does it internally, but when you view source and get it in notepad, it's only showing the actual downloaded code. So to say that Netscape altered it is one thing, but IE probably did it too (internally)
I would too if I were a browser. Here I'm expecting an end tag, but I get a begin tag. So I assume that the writer meant >.
The idea is that MORE pages will look good in your browser if you can semi-correct bad code in YOUR browser, whereas, the other browser will look bad.
<body bgcolor="#FFFFFF" text="#000000">
<p><a href="foo" <A target="bar">test </a></p>
<p><a href="foo" ><A target="bar">test </a></p>
</body>
</html>
If you view the above code in IExplore the upper link is valid but the lower one is not. If IExplore modded the code internally both links would be invalid. Only Netscape 6/7 shows both links as unvalid, not Netscape 4.7 or Opera. Which leads me to conclude that only Netscape 6.1 mods the code, unless Netscape 6.1 reckognizes both these malformations as invalid but all the other browsers simply ignore the surpefluous "<".
PS. I debug for a living which is why this silly **** bothers me.
Watch out, here come the CEA - Code Enforcement Agency.
This would be the correct way...
<a href="foo" target="foofoo">test</a>
I don't understand what you're saying.
f you view the above code in IExplore the upper link is valid but the lower one is not.
If IExplore modded the code internally both links would be invalid.
Only Netscape 6/7 shows both links as unvalid, not Netscape 4.7 or Opera.
Netscape 6.1 had added a ">" symbol to the original code.
My question? What is the problem?
[added after seeing p1r post]
No I didn't even look at it. I was just looking at the < and the > and assumed wrong. Yes, we need the cops here.
PS. What is the matter with the formatting of my post?
[edited by: bobriggs at 4:27 am (utc) on Aug. 27, 2002]
This discussion could have been avoided if yhad just tried it out.
Netscape 6/7:
Both links show up none of them is clickable
Other Browsers:
Both links show up upper one is clickable lower one not.
I care about whether Netscape 6/7 renders the source it displays in "view source" because I think it would be pretty stupid to display some modified code in "view source" and then render something else. What pray tell is the point of a "view source" function if what it shows is not what gets rendered?
This discussion could have been avoided if yhad just tried it out.
You're right about that.
I was looking for a one character error. Not an entire screwup piece of code.
It's amazing anything would render that stuff.
<a href="foo"> <A target="bar"> test </a>
<a href=> followed by <a target = ???
If I were the browser, I'd have two options.
1. Try to display it.
2. Tell you that you're an idiot.
Browsers are going to choose 1.
If they try to display it, internally, they'll modify the original code to what they think you meant, without telling you that you've made a grave mistake.
So what I'm trying to say is this:
IE will show you source in notepad - It won't show you what it changed the code to. And it will change the code.
NS is just showing you what it thought you meant.
I would prefer the browsers just try to render the code and tell me I am a moron if it is not strictly correct syntax,... kinda like a C compiler. If my C compiler went trying to guess what I menant by some sick piece of C code and did not tell me I would be pretty pissed when I started debugging. I prefer to be informed about the full extent of my galactic stupidity. :)
Netscapes guesswork cost me five minutes of my life longer than it should have to figure out what was wrong.
I'm in agreement with you on the last statement because I'd LOVE to have stuff validated. But life isn't so simple. The browser developers seem to have learned all the little mistakes (along with their own proprietary code).
Unfortunately, the better a browser can display crummy code, the more popular it becomes.
Glad to have you in the forum, DI.
Hmm, I guess I'm wrong.. coulda sworn it pulled notepad.. been awhile since I've done a view source from NN
Venerable old Netscape hates to have to run a MS program to view its source. I'm with you, though, crash, I think there's a way to get it to do it. Key is prefs.js.
Another thing about NS view source is this: it will have unraveled the javascript code in the headers, all in one line. Actually, the view souce in NS is pretty useless. You can't even copy/paste it in Win. And you're constantly horiziontally scrolling. Just my gripes.