Simple web page problem

Discussion in 'Web Design and Development' started by newConvert, Mar 2, 2007.

  1. newConvert macrumors regular

    Joined:
    Aug 25, 2006
    #1
    Hello,

    I am trying to write a basic web page in text editor, i saved it as an html file, but whenever i open it up in a browser it just displays the code behind the page, not what the actual page should look like. How do i get it to render the page properly? It seems to do this in all the browsers. I dont have javascript in there yet, but will shortley, so it has to be able to do that properly as well... Sorry if this is a stupid question!!
     
  2. adrianblaine macrumors 65816

    adrianblaine

    Joined:
    Oct 12, 2006
    Location:
    Pasadena, CA
    #2
    The only thing I can think of is that you still must have some open tags somewhere... I do very little hand coding, but when I did, I always forgot to close tags.
     
  3. beefy23 macrumors member

    Joined:
    Feb 13, 2007
    #3
    Are you actually saving the page to your we.g. Apache Webserver document root? This is how the browser gets to interprete the markup language and render the page.
     
  4. newConvert thread starter macrumors regular

    Joined:
    Aug 25, 2006
    #4

    nope.... i was just saving it in my documents folder... can't you do that? thats how i always used to test em on my windows machine.... sorry to sound like a noob, but what is the we.g. apache webserver document root? Thanks!!
     
  5. beefy23 macrumors member

    Joined:
    Feb 13, 2007
    #5
    Depending on the web page editor that you're using, some of them will allow you to preview the page and give you a good view of what the page would actually look like on the web.

    However you would need a local webserver to properly test the pages. Apologies if the following explanation is a bit too simple - not too sure of your level of expertise in this area. A webserver is a program (eg Apache, IIS) that handles http requests - you put the pages you want to view in its htdocs directory and then point your browser at the pages using an address of the format http://localhost/index.html etc and 'boom' your pages show up in the browser.
     
  6. newConvert thread starter macrumors regular

    Joined:
    Aug 25, 2006
    #6
    thanks... but how come you can just create your page in notepad (in windows) save it to your desktop, then just launch it from there? how come it renders the page then, but not if i do the same thing on a mac?
     
  7. beefy23 macrumors member

    Joined:
    Feb 13, 2007
    #7
    You've got to remember that with different browsers i.e. IE/Safari - there will be different different behaviours. I'm working on the assumption that you're using Safari or Firefox on the Mac and IE on Windows.
     
  8. toddburch macrumors 6502a

    Joined:
    Dec 4, 2006
    Location:
    Katy, Texas
    #8
    newconvert, you are most likely using TextEdit, and your TextEdit preferences needs to be changed to not save in rtf format (or whatever format is the default). Make sure TextEdit save as plain text and you'll be golden.

    Had the same issue myself back in December when I first got my Mac.

    Todd
     
  9. Cult Follower macrumors 6502a

    Cult Follower

    Joined:
    Feb 20, 2007
    Location:
    North Dakota
    #9
    I was having the same problem, thank you.
     
  10. stndn macrumors member

    Joined:
    Oct 22, 2006
    Location:
    earth
    #10
    Did you mention that you're using text edit?

    I just did a simple experiment creating an HTML file using text edit.
    I got the same problem, where the HTML tags you typed are shown as is.

    However, if you try to view source on your browser, you'll see that text edit actually tried to be smart and converted all your HTML contents into what you'll see.

    That means, converting < to < and > to > and all that.

    And that's what caused the problem.

    How to fix it? I'm not sure since text edit doesn't give the option to save the file as plain text. Or, if it does, I can't seem to find it anywhere...

    However, I would suggest if you want to hand code, give smultron a try. That's what I use and I think it's a good one.

    Or, if you just want something simple and quick, give taco software a try as well.


    FYI, you don't need to run any server to display HTML pages on any browsers. HTML files that don't require server processing can be displayed as is just by opening the file from your browser.


    -stndn.
     
  11. Sayer macrumors 6502a

    Sayer

    Joined:
    Jan 4, 2002
    Location:
    Austin, TX
    #11
    In the Format menu is the item "Make Plain Text" which will remove RTF formatting.

    Why there is no plain text option in the Save dialog you need to ask of Apple.
     
  12. Cult Follower macrumors 6502a

    Cult Follower

    Joined:
    Feb 20, 2007
    Location:
    North Dakota
    #12
    I would definately recommend taco html editor. It's very simple, and easy to use, but still gets the jobs done.
     

Share This Page