I'm using the Creating a Web Site Missing Manual and typing the xhtml from Chapter 2 into TextEdit, but when I save it and open it in Safari, what is displayed is the text that I have typed -- not a webpage.
It's as if the browser doesn't want to believe what I have typed is xhtml for a webpage. Help!!!
Help get this topic noticed by sharing it on Twitter, Facebook, or email.
The most likely problem here is that your file is not saved with the correct file extension. In order for your html or xhtml to be interpreted by the browser, your file needs to be saved with a .html file extension.
If the file is saved as .txt you will just see the plain text file containing your markup. If the file is saved as .xhtml your browser may show you a message like this: "This XML file does not appear to have any style information associated with it. The document tree is shown below." and then display the markup of your file as an XML document tree.
Check to see if your file is saved as a .html file. If it is, but is still not being interpreted by the browser, can you try pasting a screenshot here of your browser with the file open (including the address bar).
I agree that this can be frustrating at first, especially because the smallest typo can break what you're working on. But don't worry, we'll figure this out, and you'll be a pro in no time!
OK, I figured this out. It's pretty simple, if you're not a noob like me.
When you use TextEdit, you have to go to the Format dropdown and select "Make Plain Text" for the file you're going to create. If you don't do this, you get the problem I had, whether or not you add .html. Once it's in this format, the browser recognizes it.
I know I'm not reading the Missing Manual for TextEdit, but if you're going to claim that you can Create A Web Site by using simple text editors, you might consider reader-proof instructions for the text editors you do mention in the book.
This two-day roadblock for me only 28 pages into your 587-page book makes me wonder how useful this book (or any other Missing Manual) is really going to be. It's not a good feeling.
I'm sorry you had this problem, and I agree, we should have made it clear in Chapter 2 how you save plain text in TextEdit.
I'll pass your experience along to the author so we can address the problem in an errata and future versions of the book. I appreciate your writing to us so we can save other readers the same frustration.
Editor, Creating a Web Site
Ok, I had the same issue recently, and yeah, it is frustrating! My problem of NOT viewing files as a webpage in my Safari browser was with existing files of both .txt and .html files [ya, weird]...
Solution is to first save it as plain text, then manually add ".html" or ".xhtml" to the file afterwards--viola!
In 'get info' one can verify that it is still recognized as plain text, but the end tag (.html/.xhtml) elicits an open from browser by default, unless you have changed preferences. GL on your webpage editing by hand!! :)
my question, to go along with dave's is, i am makeing a web page, by hand, and sending it to a computer that only runs Safari, my site only comes up at the test that i put together in notepad on my PC, works fine in IE, but wont open corectly in Safari.
anyhelp would be much appriciated.
I am running Lion and saving a document and manually adding .html at the end of it is not allowed and when you convert it to Plain Text it automaticly makes it .txt. To fix this problem, right click your .txt/.html file and click "GET INFO" Then where i says file name and extension, change the extension to .html and you are all set to go!