Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6

Thread: wondering why

  1. #1
    Regular Coder
    Join Date
    Jul 2002
    Location
    51° 03' -78" N -114° 05' 72" W
    Posts
    617
    Thanks
    0
    Thanked 0 Times in 0 Posts

    wondering why

    why is it that some asp files that I download from websites as demos have the following in the <input type="submit" value="Submit" /> when if you put <input type="submit" value="Submit"> without the / and it still works??? makes no sense to me

  • #2
    New Coder
    Join Date
    Jun 2002
    Location
    London & Oxford
    Posts
    97
    Thanks
    0
    Thanked 0 Times in 0 Posts
    The forward slash is needed to make the tags forward compliant for XHTML.

    In XML (of which XHTML is a flavour) all tags must come in pairs and be correctly closed in order for the document or page to be valid. HTML tags which are usually used singularly such as <img>, <br>, <input> etc. all require this slash so that they are treated as a 'pair'.

    It's a good idea to start doing this now in your code so you are ready for the future.

    It's also worth noting that all attributes should be enclosed in double quotes and all tags written in lower case.
    As easy as 3.1415926535897932384626433832795028841

  • #3
    Regular Coder
    Join Date
    Jul 2002
    Location
    51° 03' -78" N -114° 05' 72" W
    Posts
    617
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Excelent!

    I will definitaly keep note of that

  • #4
    Senior Coder
    Join Date
    Jun 2002
    Location
    41° 8' 52" N -95° 53' 31" W
    Posts
    3,660
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Yup, that's what I do... for a quick tutorial about this, see:

    http://www.w3schools.com/xhtml/



    There are a few very rare things that may frustrate you (such as centering tables on a webpage using CSS, and opening windows in new webpages - I had to figure out a couple of workarounds for those with a bit of googling and experimentation!), but overall you'll find using XHTML results in much cleaner code, and it's backwards compatible.

    But the drawbacks are few from a programming point of view; if you learn about these things and use them, you'll see for yourself why standards are a very GOOD thing... especially after you start writing XHTML compliant code, you'll look at other people's code and think "man, that's ugly!".

    Not to mention it gives you a clearer understanding of the way HTML was intended to work in the first place, before companies like Microsoft and Netscape decided to implement their own "proprietary" tags and functionality.

    If there had been standards in the first place, there wouldn't be so many questions like "how can I get my javascript to work with THIS browser and THAT browser?" and "How come my page displays correctly in IE but not in NS?"

    It's too late to change the bad things that have happened (such as millions of users creating horribly incorrect HTML pages using FrontPage, Netscape Composer, etc.)... but the more developers stick to standards, the friendlier the web becomes... all this stuff helps the "big programming picture", IMHO.
    Last edited by whammy; 02-13-2003 at 02:00 AM.
    Former ASP Forum Moderator - I'm back!

    If you can teach yourself how to learn, you can learn anything. ;)

  • #5
    Regular Coder
    Join Date
    Jul 2002
    Location
    51° 03' -78" N -114° 05' 72" W
    Posts
    617
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thankyou again! Lol Google seems to be a programs best friend lol

  • #6
    Senior Coder
    Join Date
    Jun 2002
    Location
    41° 8' 52" N -95° 53' 31" W
    Posts
    3,660
    Thanks
    0
    Thanked 0 Times in 0 Posts
    It is... have no doubt about that. Google is the bomb.

    I think that's the first place most of the developers I know go for a quick answer to any question (even if it's not about programming). Of course you have to quickly discern what is garbage and skip over that, and I guess you only get that kind of judgment from experience... it's no wonder though why "google it" is such a popular term now.

    Because of a colleague's recommendation, I even installed the "google toolbar" on my Internet Explorer browser...

    Don't forget about http://www.w3schools.com as a general reference, or this forum's parent site for javascript, http://www.javascriptkit.com !

    One of the most important aspects (at least in my opinion) of programming is teaching yourself HOW to learn more efficiently!

    For instance, figuring out the best way to research things for yourself, and experimenting with things until they work, until you understand WHY they work.

    P.S. The application I'm designing at work right now is XHTML 1.1 compliant, and almost all of it even works in Netscape 4.78...


    ...except for my "popup mouseover help page" which pops up upon clicking a help icon...

    However, I introduce the user to how the application works on the main page with an example help icon, and state "if a help window didn't pop up, then you probably need to use an up-to-date browser". Good enough, since as far as I know their whole company uses IE. Every other aspect of the application works the same in all browsers I've tested... Mozilla, NS 6.x, NS 4.x, IE 5.x (and I'm sure 4, but haven't tried it), and IE 6.
    Last edited by whammy; 02-14-2003 at 12:21 AM.
    Former ASP Forum Moderator - I'm back!

    If you can teach yourself how to learn, you can learn anything. ;)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •