Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. Javascript for Beginners

Javascript for Beginners

Scheduled Pinned Locked Moved The Lounge
javascriptcareerlearninghtmltools
10 Posts 8 Posters 3 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    I'm reading the book JavaScript for Beginners. As much as I hate it the fact is that web development is a part of my job. Anyways, anytime I learn something new I've a tendency to go way back to the beginning and start from scratch. I've written and maintained JavaScript before; however, there are just too many fundamentals that one misses when making a career out of cut-n-paste development. I never regret reading beginner books - I always learn something. One little tidbit I came across while mucking around with a beginner exercise is a short and frustrating little conundrum where I couldn't get an external .js file to include itself in my HTML page. As it turns out, the script tag had to have a separate closing script tag to function properly. One cannot use:

    Anyone know the reason for that?

    Anyways, I always find little tidbits like that and I consider well worth the time.

    A Richard DeemingR D M C 5 Replies Last reply
    0
    • L Lost User

      I'm reading the book JavaScript for Beginners. As much as I hate it the fact is that web development is a part of my job. Anyways, anytime I learn something new I've a tendency to go way back to the beginning and start from scratch. I've written and maintained JavaScript before; however, there are just too many fundamentals that one misses when making a career out of cut-n-paste development. I never regret reading beginner books - I always learn something. One little tidbit I came across while mucking around with a beginner exercise is a short and frustrating little conundrum where I couldn't get an external .js file to include itself in my HTML page. As it turns out, the script tag had to have a separate closing script tag to function properly. One cannot use:

      Anyone know the reason for that?

      Anyways, I always find little tidbits like that and I consider well worth the time.

      A Offline
      A Offline
      AspDotNetDev
      wrote on last edited by
      #2

      No idea, but I too encountered that nuance.

      Thou mewling ill-breeding pignut!

      1 Reply Last reply
      0
      • L Lost User

        I'm reading the book JavaScript for Beginners. As much as I hate it the fact is that web development is a part of my job. Anyways, anytime I learn something new I've a tendency to go way back to the beginning and start from scratch. I've written and maintained JavaScript before; however, there are just too many fundamentals that one misses when making a career out of cut-n-paste development. I never regret reading beginner books - I always learn something. One little tidbit I came across while mucking around with a beginner exercise is a short and frustrating little conundrum where I couldn't get an external .js file to include itself in my HTML page. As it turns out, the script tag had to have a separate closing script tag to function properly. One cannot use:

        Anyone know the reason for that?

        Anyways, I always find little tidbits like that and I consider well worth the time.

        Richard DeemingR Offline
        Richard DeemingR Offline
        Richard Deeming
        wrote on last edited by
        #3

        That syntax might work in an XHTML document served as application/xhtml+xml, but I haven't tried it. In an HTML document, the <script> tag isn't an empty element; you can put the script inline between the opening and closing tags. Only empty/void elements can use the self-closing syntax.


        "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

        "These people looked deep within my soul and assigned me a number based on the order in which I joined" - Homer

        1 Reply Last reply
        0
        • L Lost User

          I'm reading the book JavaScript for Beginners. As much as I hate it the fact is that web development is a part of my job. Anyways, anytime I learn something new I've a tendency to go way back to the beginning and start from scratch. I've written and maintained JavaScript before; however, there are just too many fundamentals that one misses when making a career out of cut-n-paste development. I never regret reading beginner books - I always learn something. One little tidbit I came across while mucking around with a beginner exercise is a short and frustrating little conundrum where I couldn't get an external .js file to include itself in my HTML page. As it turns out, the script tag had to have a separate closing script tag to function properly. One cannot use:

          Anyone know the reason for that?

          Anyways, I always find little tidbits like that and I consider well worth the time.

          D Offline
          D Offline
          Dennis E White
          wrote on last edited by
          #4

          that is because the script tag is never intended to be an empty element and the rule is that any tag which is not defined as being able to be empty needs a closing tag. Read the following: http://www.w3.org/TR/xhtml1/#C_3[^] hope that helps. :)

          you want something inspirational??

          D 1 Reply Last reply
          0
          • D Dennis E White

            that is because the script tag is never intended to be an empty element and the rule is that any tag which is not defined as being able to be empty needs a closing tag. Read the following: http://www.w3.org/TR/xhtml1/#C_3[^] hope that helps. :)

            you want something inspirational??

            D Offline
            D Offline
            derek_bartram
            wrote on last edited by
            #5

            An interesting answer, and I suspect the 'correct' one.... however you can't use the same logic for

            which exhibits the same quirks. In my mind, I'd have preferred the consistency from other tags, but I'm sure there is a better explanation out there somewhere!

            Do you like fishes? I do.

            Richard DeemingR 1 Reply Last reply
            0
            • D derek_bartram

              An interesting answer, and I suspect the 'correct' one.... however you can't use the same logic for

              which exhibits the same quirks. In my mind, I'd have preferred the consistency from other tags, but I'm sure there is a better explanation out there somewhere!

              Do you like fishes? I do.

              Richard DeemingR Offline
              Richard DeemingR Offline
              Richard Deeming
              wrote on last edited by
              #6

              derek_bartram wrote:

              you can't use the same logic for <div> which exhibits the same quirks

              The <div> tag isn't an empty element either. You can only use the self-closing syntax with tags which will never have content - <br />, <img />, etc.


              "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

              "These people looked deep within my soul and assigned me a number based on the order in which I joined" - Homer

              1 Reply Last reply
              0
              • L Lost User

                I'm reading the book JavaScript for Beginners. As much as I hate it the fact is that web development is a part of my job. Anyways, anytime I learn something new I've a tendency to go way back to the beginning and start from scratch. I've written and maintained JavaScript before; however, there are just too many fundamentals that one misses when making a career out of cut-n-paste development. I never regret reading beginner books - I always learn something. One little tidbit I came across while mucking around with a beginner exercise is a short and frustrating little conundrum where I couldn't get an external .js file to include itself in my HTML page. As it turns out, the script tag had to have a separate closing script tag to function properly. One cannot use:

                Anyone know the reason for that?

                Anyways, I always find little tidbits like that and I consider well worth the time.

                M Offline
                M Offline
                Moshe Katz
                wrote on last edited by
                #7

                The reason seems to be historical more than anything else. Since the script element was designed to have something inside it, the fact that we don't use it that way doesn't change the syntax required. If you are looking to reduce the size of your code (either for aesthetics or efficiency), it is valid HTML5 to leave out the language and type attributes:

                The same is true for style tags:

                is valid.

                1 Reply Last reply
                0
                • L Lost User

                  I'm reading the book JavaScript for Beginners. As much as I hate it the fact is that web development is a part of my job. Anyways, anytime I learn something new I've a tendency to go way back to the beginning and start from scratch. I've written and maintained JavaScript before; however, there are just too many fundamentals that one misses when making a career out of cut-n-paste development. I never regret reading beginner books - I always learn something. One little tidbit I came across while mucking around with a beginner exercise is a short and frustrating little conundrum where I couldn't get an external .js file to include itself in my HTML page. As it turns out, the script tag had to have a separate closing script tag to function properly. One cannot use:

                  Anyone know the reason for that?

                  Anyways, I always find little tidbits like that and I consider well worth the time.

                  C Offline
                  C Offline
                  C P User 3
                  wrote on last edited by
                  #8

                  Speaking of JavaScript; zero knowledge guy here; is the Java topic in this site the same one to use for JavaScript questions ? "much as I hate...." Totally understood; totally, completely, whatever. They want you to be an expert on embedded systems, I2C, SPI, and measure voltage to the 0.01 volt accuracy, on one pin, 35 feet away from the microprocessor, and then, you're also supposed to write the JavaScript for a 47 page website, and design the database and write the access code, etc., And get it done yesterday. Anyway, guess who's got to start studying that stuff, "much as I hate...."

                  L 1 Reply Last reply
                  0
                  • C C P User 3

                    Speaking of JavaScript; zero knowledge guy here; is the Java topic in this site the same one to use for JavaScript questions ? "much as I hate...." Totally understood; totally, completely, whatever. They want you to be an expert on embedded systems, I2C, SPI, and measure voltage to the 0.01 volt accuracy, on one pin, 35 feet away from the microprocessor, and then, you're also supposed to write the JavaScript for a 47 page website, and design the database and write the access code, etc., And get it done yesterday. Anyway, guess who's got to start studying that stuff, "much as I hate...."

                    L Offline
                    L Offline
                    Lost User
                    wrote on last edited by
                    #9

                    JavaScript is pretty easy if you've experience in C#. Much of the syntax is the same. I'm enjoying the beginner book - it's a really quick read. I plan to pick up a more advanced text when I'm done. It's a nice way to close out a day of work.

                    M 1 Reply Last reply
                    0
                    • L Lost User

                      JavaScript is pretty easy if you've experience in C#. Much of the syntax is the same. I'm enjoying the beginner book - it's a really quick read. I plan to pick up a more advanced text when I'm done. It's a nice way to close out a day of work.

                      M Offline
                      M Offline
                      Member 4608898
                      wrote on last edited by
                      #10

                      Try copying stuff off the net: for some stupid reason, javascript coders love inline function definitions (like delegates) except that they define them during assignments instead of separately. Makes the code quite unreadable. The only other language I've used that can do something like that is Algol68.

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups