SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Guru
    Join Date
    Dec 2008
    Posts
    692
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    script not workng for FF

    var evt=window.event||arguments.callee.caller.arguments[0]; /// was added for FF
    var targ=window.event?evt.srcElement:evt.target; /// was added for FF

    var spread = document.getElementById('fpspread').GetSpread(targ);

    i have the following javascript

    it works fine in IE but in FF though i dont get any error i dont get the values/data

    how do i modify it so that it works for both

  2. #2
    SitePoint Guru
    Join Date
    Apr 2006
    Posts
    802
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    change arguments.callee.caller.arguments[0] to arguments[arguments.length-1]


    arguments[0] usually works, unless you are passing any arguments in the call to the handler.
    the non-ie browsers append an event object reference to the function call.

    that's why you can say:

    Code:
    function handler(ev){
      ev=window.event || ev;
    }
    without passing ev explicitly from an event.
    Last edited by mrhoo; Jun 4, 2009 at 06:25. Reason: formatting


Bookmarks

Posting Permissions

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