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. What in the world is wrong with this script?

What in the world is wrong with this script?

Scheduled Pinned Locked Moved The Lounge
helpquestionhtmldesigntools
9 Posts 5 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.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    Can you please tell me what is wrong with this script. Every time I load the HTML document into IE5.5 it gives me an error message that says: "Line: 7 Error: object required" Line 7 contains this: window.status = "X=" + window.event.x + " Y=" + window.event.y; What drives me crazy is that the script is too short to have hidden bugs. Another thing, it seems like setInterval() is what causes the error because when I omit it and make a little modification to the script it works smoothly (look code listing #2). So, could you please tell me what I did wrong? P.S. I know that this posting shouldn't be here and I'm sorry for that. I posted the same message on the web design forum but with no replies so far. I just can't wait to know the problem with the script. Thanks for any suggestions ----- START OF CODE LISTING #1 ----- Test page <!-- function ShowMousePosition() { window.status = "X = " + window.event.x + " Y = " + window.event.y; } --> <!-- window.setInterval("ShowMousePosition()", 1000); --> ----- END OF CODE LISTING #1 ----- ----- START OF CODE LISTING #2 ----- Test page <!-- function ShowMousePosition() { window.status = "X = " + window.event.x + " Y = " + window.event.y; } --> ----- END OF CODE LISTING #2 -----

    L 1 Reply Last reply
    0
    • L Lost User

      Can you please tell me what is wrong with this script. Every time I load the HTML document into IE5.5 it gives me an error message that says: "Line: 7 Error: object required" Line 7 contains this: window.status = "X=" + window.event.x + " Y=" + window.event.y; What drives me crazy is that the script is too short to have hidden bugs. Another thing, it seems like setInterval() is what causes the error because when I omit it and make a little modification to the script it works smoothly (look code listing #2). So, could you please tell me what I did wrong? P.S. I know that this posting shouldn't be here and I'm sorry for that. I posted the same message on the web design forum but with no replies so far. I just can't wait to know the problem with the script. Thanks for any suggestions ----- START OF CODE LISTING #1 ----- Test page <!-- function ShowMousePosition() { window.status = "X = " + window.event.x + " Y = " + window.event.y; } --> <!-- window.setInterval("ShowMousePosition()", 1000); --> ----- END OF CODE LISTING #1 ----- ----- START OF CODE LISTING #2 ----- Test page <!-- function ShowMousePosition() { window.status = "X = " + window.event.x + " Y = " + window.event.y; } --> ----- END OF CODE LISTING #2 -----

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

      Hello, I'm new to this stuff, but I looked into the documentation for the event object, and this is what I found: "The event object is available only during an event—that is, you can use it in event handlers but not in other code. Although all event properties are available to all event objects, some properties might not have meaningful values during some events. For example, the fromElement and toElement properties are meaningful only when processing the onmouseover and onmouseout events." I think that the interval thing is not an event handler where the event object is valid... Best regards Eddy Steevens DHTML novice

      J L 2 Replies Last reply
      0
      • L Lost User

        Hello, I'm new to this stuff, but I looked into the documentation for the event object, and this is what I found: "The event object is available only during an event—that is, you can use it in event handlers but not in other code. Although all event properties are available to all event objects, some properties might not have meaningful values during some events. For example, the fromElement and toElement properties are meaningful only when processing the onmouseover and onmouseout events." I think that the interval thing is not an event handler where the event object is valid... Best regards Eddy Steevens DHTML novice

        J Offline
        J Offline
        Jim A Johnson
        wrote on last edited by
        #3

        They just don't get it, Chris. Just delete the messages.

        G 1 Reply Last reply
        0
        • J Jim A Johnson

          They just don't get it, Chris. Just delete the messages.

          G Offline
          G Offline
          Giles
          wrote on last edited by
          #4

          I think a burning at the stake is in order.:) I love a good burning. Nice. Giles Forster

          C 1 Reply Last reply
          0
          • L Lost User

            Hello, I'm new to this stuff, but I looked into the documentation for the event object, and this is what I found: "The event object is available only during an event—that is, you can use it in event handlers but not in other code. Although all event properties are available to all event objects, some properties might not have meaningful values during some events. For example, the fromElement and toElement properties are meaningful only when processing the onmouseover and onmouseout events." I think that the interval thing is not an event handler where the event object is valid... Best regards Eddy Steevens DHTML novice

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

            Thanks Steevens for your great explanation, it really makes sense to me.

            1 Reply Last reply
            0
            • G Giles

              I think a burning at the stake is in order.:) I love a good burning. Nice. Giles Forster

              C Offline
              C Offline
              Colin J Davies
              wrote on last edited by
              #6

              Actually being at a stake burning must have a wretched smell, Maybe just Drawn and Quatered would do.(good historical punishments) Regardz Colin

              L 1 Reply Last reply
              0
              • C Colin J Davies

                Actually being at a stake burning must have a wretched smell, Maybe just Drawn and Quatered would do.(good historical punishments) Regardz Colin

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

                Sorry, I didn't read the off-topic thread when I replied to it...

                C 1 Reply Last reply
                0
                • L Lost User

                  Sorry, I didn't read the off-topic thread when I replied to it...

                  C Offline
                  C Offline
                  Chris Maunder
                  wrote on last edited by
                  #8

                  No matter. It was off-topic but we have a happy customer so all's well that ends well. Thanks for taking the time to look into it for him. cheers, Chris Maunder

                  G 1 Reply Last reply
                  0
                  • C Chris Maunder

                    No matter. It was off-topic but we have a happy customer so all's well that ends well. Thanks for taking the time to look into it for him. cheers, Chris Maunder

                    G Offline
                    G Offline
                    Giles
                    wrote on last edited by
                    #9

                    Its all fun and games in the end.

                    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