www.webdeveloper.com
Results 1 to 5 of 5

Thread: [RESOLVED] Error: SetEventHandler is not defined

  1. #1
    Join Date
    Nov 2008
    Posts
    4

    resolved [RESOLVED] Error: SetEventHandler is not defined

    Hey there!
    I was wondering why my javascript code below outputs the following error:

    Error: SetEventHandler is not defined
    Line: 27


    Javascript on line 27/28
    SetEventHandler("scroll", wereScrolling());
    SetEventHandler("resize", wereResizing());

    All i want is that when the user scrolls down or resizes the window that it executes the functions (wereScrolling() and wereResizing())

    Thanks a million

  2. #2
    Join Date
    Feb 2003
    Location
    Michigan, USA
    Posts
    5,773

  3. #3
    Join Date
    Nov 2008
    Posts
    4
    Thanx for ur reply

    um what is that suppose to mean? (im new to js)

    All i need is that when someone is scrolling or resizing the page, a javascript handler comes in and tells wereScrolling() function to execute

    Thanks heaps
    Last edited by toxinhead; 11-21-2008 at 06:16 PM.

  4. #4
    Join Date
    Feb 2003
    Location
    Michigan, USA
    Posts
    5,773
    Browsers do not come preprogrammed with a function called SetEventHandler. You need to write the JavaScript for it. Somewhere on your page you should see:
    Code:
    function SetEventHandler() {
      // some code
    }
    You also might have a SCRIPT tag that imports a JavaScript file:
    HTML Code:
    <script type="text/javascript" src="path/to/file.js"></script>
    Basically, somewhere there needs to be JavaScript code that defines a function called SetEventHandler. Can you post the HTML of the page you are working on?

  5. #5
    Join Date
    Nov 2008
    Posts
    4
    Ooops my bad!
    Lol its working now, i forgot the actual function haha

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles