Web Hosting Forum | Lunarpages


*
Welcome, Guest. Please login or register.
Did you miss your activation email?



Login with username, password and session length
September 09, 2010, 01:17:38 PM

Pages: [1]   Go Down
  Print  
Author Topic: Source code doesn't show in IE  (Read 579 times)
HCOG
Newbie
*
Offline Offline

Posts: 3


« on: July 28, 2010, 03:05:46 PM »

When I do a View Source using Internet Explorer on some of our files, all I see is "<" . Yet the the page looks fine. If I open these files in Firefox, there is no styling, yet I can see the source code.Example: www.hucrestcog.org/history.html. I am totally baffled by this. Can anyone explain to me what's happening?
Logged
scanman20
Master Jedi
*****
Offline Offline

Posts: 1450



WWW
« Reply #1 on: July 29, 2010, 06:28:41 AM »

Running it through the W3C validator it looks like the encoding for the page is pretty screwed up which would cause this.

"You have used an illegal character in your text. HTML uses the standard UNICODE Consortium character repertoire, and it leaves undefined (among others) 65 character codes (0 to 31 inclusive and 127 to 159 inclusive) that are sometimes used for typographical quote marks and similar in proprietary character sets. The validator has found one of these undefined characters in your document. The character may appear on your browser as a curly quote, or a trademark symbol, or some other fancy glyph; on a different computer, however, it will likely appear as a completely different character, or nothing at all.

Your best bet is to replace the character with the nearest equivalent ASCII character, or to use an appropriate character entity. For more information on Character Encoding on the web, see Alan Flavell's excellent HTML Character Set Issues reference.

This error can also be triggered by formatting characters embedded in documents by some word processors. If you use a word processor to edit your HTML documents, be sure to use the "Save as ASCII" or similar command to save the document without formatting information."
Logged

Even a broken clock is right twice a day.
NotOneBit.com
MCSE - MCSA - MCP
HCOG
Newbie
*
Offline Offline

Posts: 3


« Reply #2 on: July 29, 2010, 10:03:14 AM »

Thank you so much. I will check into that.
Logged
MrPhil
Professor in Nanotechnology
*****
Offline Offline

Posts: 4812



« Reply #3 on: July 30, 2010, 09:49:07 AM »

I have serious doubts about the competence of the author (designer) of this page:
Code:
<META content="text/html; charset=unicode" http-equiv=Content-Type>
The Content-Type (as well as all other HTML "attribute" values) should be in " quotes. It probably doesn't hurt to have the http-equiv after the content, but it's odd. What is "unicode" charset? I've never seen it. According to the W3C validator, it's possibly legal, but not widely supported. You should be using UTF-8 if you need world-wide character support. Firefox says that the page is UTF-16LE (Little Endian -- reversed bytes). The validator doesn't seem to like it, and doesn't recognize any tag until I specify UTF-16 override. I wouldn't be surprised if some browsers (like IE) have trouble with it. Some browsers may just be ignoring the x00 bytes. Either change the "charset" to UTF-16 (or maybe UTF-16LE) or re-save the pages as UTF-8 or even Latin-1 (and update charset appropriately).

Code:
      <DIV align=left>© 2007 Hucrest Community Church of God.&nbsp; All Rights
      Reserved.<BR>Developed by <A
      href="http:%5C%5Cwww.umpquawebdesign.com">Umpqua Web Design</A></DIV></TD>
I would suggest using &copy; rather than hardcoding a non-ASCII symbol. It's better to use such "HTML entities" because they will display correctly no matter what page character encoding (charset) you use -- you can change from (say) Latin-1 to UTF-8 without having to edit and re-save the page. %5C is the backslash \ -- why in the world are backslashes being used for a URL? They should have just coded // and left it at that. Right now the link doesn't work because it comes out http://www.hucrestcog.org/\\www.umpquawebdesign.com (the http:// wasn't seen, so a browser adds your domain to the beginning).

The image map code at the very bottom of the listing appears to apply to the top of the page. I would suggest that the code should be up near the top of the <body>, and that a title= attribute be used for each <area> so you can see what it is when you hover over it (I think title= will work with maps). I hope you didn't pay too much for this site's design work -- the code is atrocious! They might have used some very cheap or old page generator (MSHTML?) that doesn't play by the rules. Sorry to be so negative, but I can only shake my head in dismay at what passes for website coding! Despite all the problems with the code, it's still displaying fairly well with Firefox (except for the header graphics being a little messed up on the history and beliefs pages). I'm not sure why the intended CSS styling is not being applied (text.css plus style attributes) -- maybe try at least declaring the charset properly (or changing to UTF-8) and fixing all the tag attributes with " around them and see if the behavior changes. In any case, throw the pages against the W3C validator (http://validator.w3.org) and fix the reported problems, and somewhere along the line it will probably start looking better in all browsers. The CSS file appears to have been written in Latin-1, while the rest of the page is 16 bit Unicode -- that may be why the CSS is ignored. Re-saving the pages as either Latin-1 or UTF-8 might fix that problem.

To elaborate on what @scanman20 said, never use a word processor (e.g., MS Word) to edit a page, or to cut and paste text from one into an HTML page editor. Just too many goofy things can come along for the ride. Use a flat file text editor (ViM, Notepad++, or in a pinch, plain old Notepad), or at least a real (and up to date) WYSIWYG HTML page editor (Dreamweaver, Page Mason, even Expression Web). However, it doesn't look like using a word processor is at the heart of all the problems these pages have.
Logged

HCOG
Newbie
*
Offline Offline

Posts: 3


« Reply #4 on: August 02, 2010, 03:48:10 PM »

Thank you for such a detailed response, but I didn't see it until today. I spent some time on it this weekend and while far from perfect, it validates.

This was a template that we purchased 3-4 years ago and uses HTML. I'm not sure what version, but tags are in caps and there aren't any quotes to speak of in the original version. The MSHTML must have come with the template.  It hasn't been a problem until recently, but I suppose as browsers and rules change, issues arise with old code.

The DOCTYPE wasn't correct. I changed unicode to UTF-8, added quotes to the values (is that the correct terminology?), fixed the &copy; and the //. I guess I just needed a nudge in the right direction.



Logged
Hutchins
Newbie
*
Offline Offline

Posts: 3


« Reply #5 on: August 06, 2010, 06:56:44 AM »

This also happened to me,but after validating the site,i was able to see where the error was,hope you did that  and got help.all the best mate
Logged

Pages: [1]   Go Up
  Print  
 
Jump to: