AntipixelNo one knows je ne sais quoi like us

Without Christo < Home > 404 to Search Page


Safari Displaying Source Code

Comments: 17


A client contacted me with a question about annoying behaviour in Safari. When clicking on a link, Safari can sometimes display the source code for the page rather than the rendered result of the code. Hitting reload displays the page properly.

I’d never seen this with any previous version of Safari or in the v74, but — this is weird — after hearing from my client and while working on a completely different project, Safari began exhibiting this quirk. It only seemed to happen on one particular page (a template page identical in key respects to many others that were working fine — I checked carefully and couldn’t see anything that would account for bad behaviour). It’s the only time I’ve ever seen it and it hasn’t happened since.

Anyone have any info on this? I’ve checked the Mac sites, Apple, Google, &c, but can’t find mention of it. Any leads much appreciated.

•••
Posted to Computers 2003.05.20 (Tue) • 23:13

Comments

Posted by Dave S.   2003.05.20, 23:56

Dave Hyatt weighs in on the issue. His should probably be the first site to check for Safari bugs, Dave being the developer of it and all.

Posted by pete   2003.05.21, 00:21

don’t have any specifc info (just more noise ;) but I just noticed this today too - weird.

www.space-invaders.com exhibits the same source code display behaviour sometimes - I had assumed that it was the dubious comment hack in the page, but maybe not…?

Posted by Faith   2003.05.21, 01:19

OK, I’m probably going to sound like an idiot for not understanding the situation completely but from what I got from it, I think I have an idea of why. It seems to happen with php files. Maybe the server that the .php or .phtml file was on didn’t support PHP. Or maybe he was working on something that ended with .php and dropped it on safari expecting it to at least display the what the html makes the page look like, knowing that the actual php script wouldnt be rendered. but safari, unlike mac ie, doesn’t want to do that, it just displays all of the phtml. Know what I mean?

Posted by matthew   2003.05.21, 03:36

happens for me consistently on your

http://www.antipixel.com/blog/archives/2002/10/22/stealthesebuttons.html

page

Posted by stevenf   2003.05.21, 04:05

I’ve seen this behavior too, but I have no explanation. It happened on a really simple php test page that had nothing more than a little text and a few paragraph tags. (It most definitely wasn’t valid markup.)

Our server is definitely configured correctly for .php files. And, as mentioned, if the page is reloaded, it usually works fine.

Posted by Sarah   2003.05.21, 04:57

I was having that problem with one of my websites, but found that taking out the xml declaration seemed to fix it.

Posted by Faith   2003.05.21, 06:42

Yeah, I think your right Sarah, I was going to suggest doing that, because when you have the xml decloration at the top AND the stuff in the html tag for xml, the one at the top isn’t needed, and messes up in some browsers.

Posted by Charles   2003.05.21, 07:07

I have the same problem, but it only pops up (so far) when opening the WDG Guide to Cascading Style Sheets which I have saved locally. There’s no xml declaration there…

Posted by Phil Dokas   2003.05.21, 11:54

I can honestly say that I’ve never seen that bug in any version of Safari, from the very first public release, through a few more “releases” and on up through the most recent v74.

I tried all the pages listed here several times, but no dice.

Posted by rich cookson   2003.05.23, 01:14

have you tried making the xml declaration a PHP echo statement? i dunno if this is at all related but my pages never validated as XHTML until i did this for some reason.

Posted by Mr. X   2003.05.23, 04:25

I’ve had that happened too, but couldn’t reliably reproduce the error. The exact same page would sometimes exhibit this behavior but work fine some others. I’d tend to think it’s just a small bug in Safari. It’s still a beta after all…

Posted by Horst   2003.05.24, 06:16

Yes, it happens regularly (but not every time) on this page that I designed: http://www.ub.univie.ac.at/

Posted by jh   2003.05.24, 18:23

Dave S. —- Thanks for the link to Hyatt’s site. I did search there of course but wasn’t using the right terms to pull up that reference.

Horst —- I have no trouble with that page in Safari!

Posted by blabla   2005.10.05, 07:20

Safari 2.0 is the worse of them all.

Want to do a really simple test? Create a compliant xhtml page. But put save it as a PHP file, since you will be adding PHP later.

Open it in safari from your hard drive.

I use Dreamweaver all the time, and until Safari 2.0 this bug did not exist. I am a professional web developer and working with 100% standards/compliant XHTML 1.1

If I simply change the extension to html it displays fine. Opera, IE5, and firefox all display the PHP page correctly. Only safari misses.

Using OS X 10.4.2

It is obviously a little safari bug that I hope gets fixed soon, it is really annoying for troubleshooting files.

On another note, if I upload the file, it displays perfectly. I hope you guys are not getting all the PHP code, that could be a big security issue if the page displays the database username and password.

Posted by almage   2006.03.13, 01:34

Unfortunately, this problem is not specific to php files. I see this a lot, specifically with sites that I maintain. The common thread among these several sites is that Dreamweaver is used to create the web pages, all of which are static (no php, server side includes, etc.)

Reloading the page works about 50% of the time. With sites using frames, reloading often does not work well - one or more frames continue to display source code.

My best method is to Empty the Safari cache, and then reload the page. Unfortunately, even this fails to correctly display rendered HTML about 5% of the time. Persistance does pay off eventually, and with enough cycles of emptying the Safari cache, and re-accessing the framed pages, via reload and/or entering the frameset url again, I manage to eventually see the page as desired.

But I can’t expect the intended viewers of my sites to jump through such hoops.

Has anyone found out the cause of this?

I’ve been suspicious of the DocType attribute that DreamWeaver inserts into each page by default, but have yet to perform a controlled test of this tag…

Posted by Tony   2006.07.06, 19:23

I have developed a website on my server - hosted on a windows server by Crystaltech.

I never saw this happening until I uploaded to clients server. I am awaiting details of their server.

Will keep you updated.

Posted by Peter   2006.09.11, 01:48

I keep getting the mentioned error on one of the sites in maintan, all static, simple html and I haven’t been able to find any kind of pattern.. it happens only to specific pages which are (codewise) exactly like the others and on top of that, sometimes they just work fine. Really weired. The site affected is: www.liebedeinestadt.de At this very moment, the affected pages are ‘Kampagne’, ‘Edition’ & ‘Aktuell’.

Post a comment:

*

* (not displayed)


Remember personal info?
(optional)


* Required
You can use basic HTML below, but URLs don't link automatically.



Make HTML-safe: convert

To help reduce comment spam, you must preview your comment before posting. Sorry about this, but I'm borderline homicidal with the spam crap.

Send This Story to an Enemy









• • •

Search Options

Possibly Related Entries

Complete Archives


Valid XHTML


Antipixel

Antipixel.com
© 2010 Jeremy Hedley
All rights reserved and so forth.
Rights & Administrivia
Privacy info