Problem in invoking function

Discussion in 'JavaScript' started by Harish kumara, May 18, 2009.

  1. #1
    hi friends am new to javascript and stuck some where in my script and I don't know what the actual problem is....let me explain with code

    I have written a function called "abcd" in script1.js file.

    function abcd()
    {
    Ext.MessageBox.alert('am new to javascript');
    }
    [Am using Extjs framework for client side designing]

    and I have written span tag in the same file

    '<span style="cursor: pointer;" '+'onclick="abcd();">'+'<img src="assets/modules/main/images/gdocs1.jpg"/></span><br/>'

    But strangely I was at the error "Object required" on the same line where the span tag is, when execute the script1.js

    please anybody put me in the right direction
    thank u....:confused:
     
    Harish kumara, May 18, 2009 IP
  2. JavaScriptBank.com

    JavaScriptBank.com Peon

    Messages:
    141
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #2
    And did you import the Extjs framework in/before script1.js file?
     
    JavaScriptBank.com, May 18, 2009 IP