Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Netscape and Opera just show text were there should be 'html'

Status
Not open for further replies.

mikk

Programmer
Oct 18, 2002
1
0
0
CH
Hi folks,
When I show some html indirectly trough cgi with IExplorer.. e.g. :

[tt]
#!/usr/bin/perl
&startpage;

sub startpage {
print <<HTML_END;

<html>
<head>
</head>
<body>
some interesting text
</body>
</html>

HTML_END
[/tt]

then it works completely fine. But when I start the same script on Netscape or Opera they just show the source code. With other words: they don't understand the text as html. As I'm not a Perl Pro, you perhaps could give me some advice?!?
Thx

Mikk
 
Sure, here's my $.02: NS and Opera suk.

Ok really, the only problems I've ever had with those two browsers is with javascript incompatibility. All of my perl junk has always gone off without a hitch.

How are you calling your scripts into the page? Notorious P.I.G.
 
Oh, just noticed something else. Do you have this line somewhere in your script before you start printing HTML?

Code:
print &quot;Content-type:text/html\n\n&quot;;

I don't see why it would work even in IE if you didn't include that, but ya never know... [wink] Notorious P.I.G.
 
Yes, you need to tell the client that the stuff coming it's way should be treated as html, rather than plain text that just happens to have characters like <, >, and / all over the place.

Try this before you send any of your html:

print &quot;Content-type: text/html\nPragma: no-cache\n\n&quot; ;

I hope that this helps!

As an aside, I have zero patience for people like PerlIsGood who think that every designer should only care about people who use browsers that they happen to prefer. If I felt that way, I'd put every single piece of HTML I write between &quot;<noframes>&quot; and &quot;<noscript>&quot; tags, just because I happen to like using lynx. :) And I would certainly make my HTML unreadable by people using Internet Exploiter.
-- Scott David Gray
reply-to: sgray@sudval.org
 
[noevil]

Hey there big fella, I was just stating a random comment about my preferences. Nowhere in there did i say i didn't code for cross-browser compatibility. [peace] Notorious P.I.G.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top