Problems using notepad as an .shtml editor

liunx

Guest
Hi everyone,<br />
<br />
I've created a set of .shtml files that we use on our webpage. The problem I am having is that after using notepad to edit my index.shtml file, it will not load in IE after saving. It instead displays as the actual text source in the IE window.<br />
<br />
I have tried disabling word wrap with no luck. I am thinking it may have something to do with carriage returns or something, because quite frankly I am stumped as to why after editing, the page refuses to properly load.<br />
<br />
Here is the original file source which loads fine:<br />
<br />
<!--#include file="head.shtml"--><br />
<font face="Verdana" size="2"><br />
<font color="#6588D8" size="+1"><br />
<b>Latest News</b><br />
</font><br />
<br><br />
<br><br />
<!-- --><br />
<b>Chris S.</b> - Wednesday, February 19, 2003<br><br />
<br>The <a href=http://www.htmlforums.com/archive/index.php/"http://********.website.com/~********/forums/">forums</a> are back up and running again.<br />
<br><br />
<br><br />
<br><br />
<br><br />
<br><br />
<!-- --><br />
<!-- --><br />
<!--#include file="bottom.shtml"--><br />
<br />
If I save the above as index.shtml using notepad it displays fine in IE.<br />
<br />
Below is the same code that will not display properly:<br />
<br />
<!--#include file="head.shtml"--><br />
<font face="Verdana" size="2"><br />
<font color="#6588D8" size="+1"><br />
<b>Latest News</b><br />
</font><br />
<br><br />
<br><br />
<!-- --><br />
<b>Chris S.</b> - Wednesday, February 19, 2003<br><br />
<br>This is the second of our news updates.<br />
<br><br />
<br><br />
<br><br />
<br><br />
<br><br />
<!-- --><br />
<!-- --><br />
<b>Chris S.</b> - Wednesday, February 24, 2003<br><br />
<br>The <a href=http://www.htmlforums.com/archive/index.php/"http://********.website.com/~********/forums/">forums</a> are back up and running again.<br />
<br><br />
<br><br />
<br><br />
<br><br />
<br><br />
<!-- --><br />
<!-- --><br />
<!--#include file="bottom.shtml"--><br />
<br />
If I save the above as index.shtml it loads as a regular text file in IE for some reason. Am I overlooking something obvious?<!--content-->This may sound basic but what are you using for "save as type" (not file name, but 'save as type') ? text files or 'all files' ? should be all files.<br />
<br />
You may want to try this:<br />
save as type: all files<br />
filename: myfile.shtml<br />
<br />
or if that does not work:<br />
save as type: all files<br />
filename: myfile.html<br />
and then rename to .shtml after the fact<!--content-->kdjoergensen,<br />
<br />
Edit:<br />
<br />
I just tried what you suggested, changing the filename to index.html and it will display fine saving as "all files" type. But the moment I change the name back to index.shtml it screws up again.....I'm stumped.<!--content-->If you are viewing the page offline, that is probably the problem. An SSI file must be on a server that understands SSI instructions. Many people do not have this installed on their personal computers. Upload the file to your host server online (presuming they do support SSI) and view the page that way.<br />
<br />
If you are viewing the file online, then your host may not support SSI.<br />
<br />
Also, there should be a space before the ending comment areas...<br />
From this...<br />
<!--#include file="head.shtml"--><br />
To this...<br />
<!--#include file="head.shtml" --><!--content-->When you view the document using a web browser are you:<br />
- looking at the document file on your hard drive, or<br />
- looking at your file after it has been uploaded to your web site?<!--content-->ok,<br />
<br />
This is what I'm doing. I'm saving the index.shtml file to a maintenance folder(locally on my winXP machine) where I keep all of my webfiles as I build/update my shtml. The first set of code I posted above works as index.shtml when I save it as index.shtml using notepad. I can right click on index.shtml, choose "open with" and then select "IE", and the page shows up just fine. The second set of code does not.<br />
<br />
This (<!-- m --><a class="postlink" href="http://www.planetquake.com/teamreaction/mank/correct.jpg">http://www.planetquake.com/teamreaction ... orrect.jpg</a><!-- m -->) screenshot shows what the first set of code looks like as it is displayed in IE. Which is how it should look.<br />
<br />
This (<!-- m --><a class="postlink" href="http://www.planetquake.com/teamreaction/mank/incorrect.jpg">http://www.planetquake.com/teamreaction ... orrect.jpg</a><!-- m -->) screenshot shows what the second set of code I posted above looks like in IE. Which plainly shows what I am describing.<br />
<br />
One code will work, the other will not. And I'm unsure if it's the code, or notepad that may be messing me up. I dont know how to explain it any better than this.<!--content-->when you save in notepad you save it ias .txt even though you changed the extension. so in all actuality it looks ike this index.shtml.txt and since windows knows this extension all you see is .shtml<br />
<br />
so go to windows explorer and click on tools and then folder options. then teh view tab you should see something that says "hide file extensinos for known type" make sure this is uncheckd.<br />
<br />
then you will go bak into exporer and find the file in question. my bet is you will see the .txt. if not then you cannot run shtml files on your computer as you need a webserver to run those. sure you can open it up in IE and display it, but the includes are not happening.<br />
<br />
try that and let us know.<!--content-->scoutt,<br />
<br />
If you'll look back at kdjoergensen's post above, he suggests that I save as "filetype" rather than ".txt"<br />
<br />
The box "hide file extensinos for known types" is unchecked, and the filename is .shtml, not .shtml.txt<br />
<br />
I'm not worried about the includes, but the code should at least format in the IE window as a webpage. The first set of code does, as per my screenshot...why doesnt the second?<br />
<br />
Can anyone else take that second code I posted and get it to display in IE as it shown in "correct.jpg" above?<!--content-->I know what KD said, notepad is the problem as it is saving it as txt. trust me. if you run the same code from the code that works and the only thing you did was save it by using notepad then it is a text file. IE will parse html if the file ends in a html extension and seeing as it displayed the contents just as it sits then it is a text file. trust me, you opened a text file. <br />
<br />
even if it was a shtml extension it would still parse the html inside that file. but seeing as it didn't the file can only be .txt<!--content-->
 
Back
Top