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. Web Development
  3. html : absurd behaviour

html : absurd behaviour

Scheduled Pinned Locked Moved Web Development
questionhtmlhelp
17 Posts 7 Posters 0 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.
  • T tiwal

    Can anyone tell me what is wrong about this silly chunk of code ? var neww; var firstpar; var secondpar; function getfirstpar(){ firstpar=document.getElementById("primo").value; } function getsecondpar() { secondpar=document.getElementById("secondo").value; } function startneww(){ neww = windows.open (“Newpage.htm”, “”, “top=100,left=50”); } First parameter Second parameter I've been working about a week trying to figure out what the hell is wrong , and now I am sick and tired ... why doesn't it work at all ? why do I keep having an error warning on line 14 telling me "invalid character" ? Why do I have an error on line 21 telling "object required" ? and why do other similar web pages work well on the same machine ?

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

    tiwal wrote:

    <input type="button" value="set" önclick="getfirstpar();getsecondpar(); startneww();"/>

    You have an umlaut over the o character; it should be onclick. I think maybe your keyboard is generating different characters to the ones you want.

    Use the best guess

    T 1 Reply Last reply
    0
    • G Graham Breach

      In the "startneww" function and in the text inputs you are using smart quotes instead of the standard single or double quote characters. If you can't see any difference, you should probably use a different text editor. Also, in "startneww" it should be window.open() and not windows.open().

      T Offline
      T Offline
      tiwal
      wrote on last edited by
      #4

      thank you maybe it's like you say but I can't see the difference... I have been using both notepad and Visual Studio ....

      A 1 Reply Last reply
      0
      • G Graham Breach

        In the "startneww" function and in the text inputs you are using smart quotes instead of the standard single or double quote characters. If you can't see any difference, you should probably use a different text editor. Also, in "startneww" it should be window.open() and not windows.open().

        T Offline
        T Offline
        tiwal
        wrote on last edited by
        #5

        Yes I know the "windows" error but it's something I introduced in the later versions , by trying and trying again ...it was not in the original ....

        1 Reply Last reply
        0
        • L Lost User

          tiwal wrote:

          <input type="button" value="set" önclick="getfirstpar();getsecondpar(); startneww();"/>

          You have an umlaut over the o character; it should be onclick. I think maybe your keyboard is generating different characters to the ones you want.

          Use the best guess

          T Offline
          T Offline
          tiwal
          wrote on last edited by
          #6

          I swear the umlaut wasn't in the original version, it was "o" .. I don't know what to think .... anyway thank you for the support....

          L 1 Reply Last reply
          0
          • T tiwal

            I swear the umlaut wasn't in the original version, it was "o" .. I don't know what to think .... anyway thank you for the support....

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

            tiwal wrote:

            I swear the umlaut wasn't in the original version

            I believe you, as I have seen this happen before, but I cannot recall how or why.

            Use the best guess

            J 1 Reply Last reply
            0
            • L Lost User

              tiwal wrote:

              I swear the umlaut wasn't in the original version

              I believe you, as I have seen this happen before, but I cannot recall how or why.

              Use the best guess

              J Offline
              J Offline
              Jasmine2501
              wrote on last edited by
              #8

              Probably a spell-checker somewhere along the line as you copy-pasted stuff, automatically fixed it for you. That doesn't really make sense to me because "onclick" is spelled the same way in every language, but it's probably a spell-checker getting in your way.

              L 1 Reply Last reply
              0
              • J Jasmine2501

                Probably a spell-checker somewhere along the line as you copy-pasted stuff, automatically fixed it for you. That doesn't really make sense to me because "onclick" is spelled the same way in every language, but it's probably a spell-checker getting in your way.

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

                Jasmine2501 wrote:

                Probably a spell-checker

                That would surprise me.

                Use the best guess

                M 1 Reply Last reply
                0
                • L Lost User

                  Jasmine2501 wrote:

                  Probably a spell-checker

                  That would surprise me.

                  Use the best guess

                  M Offline
                  M Offline
                  Manfred Rudolf Bihy
                  wrote on last edited by
                  #10

                  That issue has been raised before and IIRC it is done on purpose to fight code injection when inserting HTML. I think Chris is aware of this issue, but I'm not sure if it is on the current agenda. Cheers, Manfred

                  "I had the right to remain silent, but I didn't have the ability!"

                  Ron White, Comedian

                  L 1 Reply Last reply
                  0
                  • M Manfred Rudolf Bihy

                    That issue has been raised before and IIRC it is done on purpose to fight code injection when inserting HTML. I think Chris is aware of this issue, but I'm not sure if it is on the current agenda. Cheers, Manfred

                    "I had the right to remain silent, but I didn't have the ability!"

                    Ron White, Comedian

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

                    As far as I understand the question, this is something the OP created, nothing to do with CodeProject or Chris. Or do you have some extra information about it?

                    Use the best guess

                    M 2 Replies Last reply
                    0
                    • L Lost User

                      As far as I understand the question, this is something the OP created, nothing to do with CodeProject or Chris. Or do you have some extra information about it?

                      Use the best guess

                      M Offline
                      M Offline
                      Manfred Rudolf Bihy
                      wrote on last edited by
                      #12

                      The umlaut ö gets substituted for the o in onclick when you paste some valid javascript code into the editing text field and then submit your post. So yes this does have something to do with CP. :) It has been reported and discussed before in the Site Bugs and Suggestions forum. Cheers!

                      "I had the right to remain silent, but I didn't have the ability!"

                      Ron White, Comedian

                      L A 2 Replies Last reply
                      0
                      • L Lost User

                        As far as I understand the question, this is something the OP created, nothing to do with CodeProject or Chris. Or do you have some extra information about it?

                        Use the best guess

                        M Offline
                        M Offline
                        Manfred Rudolf Bihy
                        wrote on last edited by
                        #13

                        I found the link where Chris admitted the bug and said he fixed it. I think one of the hamsters broke loose and undid this www.codeproject.com/Messages/4389900/Re-Whos-the-silly-monkey-that-did-this-onchange-ön.aspx Guess I'll try it out later from my desktop PC and reraise the bug report. Cheers!

                        "I had the right to remain silent, but I didn't have the ability!"

                        Ron White, Comedian

                        1 Reply Last reply
                        0
                        • T tiwal

                          thank you maybe it's like you say but I can't see the difference... I have been using both notepad and Visual Studio ....

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

                          Directed quotes and "normal" quotes look a little different, and can look very similar depending on the font you are using and your screen resolution. Directed quotes can get into your code, for example, if you copy some code online and paste it into your code.

                          These are “directed” quotes.
                          These are "normal" quotes.

                          See the difference?

                          Thou mewling ill-breeding pignut!

                          1 Reply Last reply
                          0
                          • M Manfred Rudolf Bihy

                            The umlaut ö gets substituted for the o in onclick when you paste some valid javascript code into the editing text field and then submit your post. So yes this does have something to do with CP. :) It has been reported and discussed before in the Site Bugs and Suggestions forum. Cheers!

                            "I had the right to remain silent, but I didn't have the ability!"

                            Ron White, Comedian

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

                            That makes perfect sense, and is probably where I came across it before.

                            Use the best guess

                            1 Reply Last reply
                            0
                            • M Manfred Rudolf Bihy

                              The umlaut ö gets substituted for the o in onclick when you paste some valid javascript code into the editing text field and then submit your post. So yes this does have something to do with CP. :) It has been reported and discussed before in the Site Bugs and Suggestions forum. Cheers!

                              "I had the right to remain silent, but I didn't have the ability!"

                              Ron White, Comedian

                              A Offline
                              A Offline
                              andyokeefe
                              wrote on last edited by
                              #16

                              That makes perfect sense, and is probably where I came across it before.

                              Seo Sligo is the best

                              1 Reply Last reply
                              0
                              • T tiwal

                                Can anyone tell me what is wrong about this silly chunk of code ? var neww; var firstpar; var secondpar; function getfirstpar(){ firstpar=document.getElementById("primo").value; } function getsecondpar() { secondpar=document.getElementById("secondo").value; } function startneww(){ neww = windows.open (“Newpage.htm”, “”, “top=100,left=50”); } First parameter Second parameter I've been working about a week trying to figure out what the hell is wrong , and now I am sick and tired ... why doesn't it work at all ? why do I keep having an error warning on line 14 telling me "invalid character" ? Why do I have an error on line 21 telling "object required" ? and why do other similar web pages work well on the same machine ?

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

                                The function you set on the submit button. Please see the spellings of onclick... Its o is not valid. May be that is the reason.

                                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