Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Mar 2005
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Help with Firefox error: "... has no properties"

    Hello all.
    I have a problem with this script in Firefox(Win, Mac) - yet it runs just fine in IE Win and Safari. The script:
    Code:
    function do_output_cb(out_str) { 
    document.getElementById("outtext").innerHTML = out_str; 
    } 
    function do_output() { 
    var chars; 
    
    var e = window.event; 
    var c = String.fromCharCode(e.keyCode).toLowerCase();
    
    chars = document.getElementById("text").value;
    
    chars = chars + c;
    if (chars != "") 
    { 
    x_arrayCheck(chars, do_output_cb); 
    } 
    else 
    { 
    document.getElementById("outtext").innerHTML = ""; 
    } 
    }
    The error being thrown says "Error: e has no properties," and i'm guessing it happens on the line in bold. Is this one of those DOM support issues?
    Thanks in advance!

  • #2
    Senior Coder
    Join Date
    Mar 2005
    Location
    Portsmouth UK
    Posts
    4,519
    Thanks
    3
    Thanked 507 Times in 494 Posts
    try playing with

    PHP Code:
    <script language="JavaScript" type="text/javascript">
    <!--

    function 
    vtbKeyPress(e){
      if (!
    document.all){
       
    KeyCode=e.which// Demo Only
      
    }
      else {
       
    KeyCode=event.keyCode// Demo Only
      
    }
      
    alert(KeyCode)
    }

    if (!
    document.all){
     
    document.captureEvents(Event.KEYDOWN)
    }

    document.onkeypress=vtbKeyPress


    //-->
    </script> 

  • #3
    New to the CF scene
    Join Date
    Mar 2005
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    ehh, thanks for that. I'm not having too much luck with that, either -- now it throws the same error for IE! If I could just understand what was happening...
    I'm trying to catch keyboard input from a text field called "text," and throw it to a function called x_arrayCheck(). I'm a javascript newb, btw :-)
    Thanks!

  • #4
    Senior Coder
    Join Date
    Mar 2005
    Location
    Portsmouth UK
    Posts
    4,519
    Thanks
    3
    Thanked 507 Times in 494 Posts
    not much time so crude

    PHP Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
        "http://www.w3.org/TR/html4/strict.dtd"
    >

    <
    html>

    <
    head>
      <
    title></title>
    </
    head>

    <
    body>
      <
    script language="JavaScript" type="text/javascript">
    <!--
    var 
    pass;

    function 
    vtbKeyPress(e){
      if (!
    pass){return; }
      if (!
    document.all){
       
    KeyCode=e.which// Demo Only
      
    }
      else {
       
    KeyCode=event.keyCode// Demo Only
      
    }
      
    alert(KeyCode)
      
    x_arrayCheck(String.fromCharCode(KeyCode));
    }

    if (!
    document.all){
     
    document.captureEvents(Event.KEYDOWN)
    }

    document.onkeypress=vtbKeyPress

    function x_arrayCheck(kcs){
      
    alert(kcs)
    }
    //-->
    </script>

    <input name="text" size="10" onfocus="javascript:pass=1;" onblur="javascript:pass=null;" >
    </body>

    </html> 

    tested in Ie but prob with Moz onblur of alert

  • #5
    New to the CF scene
    Join Date
    Jan 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    I am having the same issue with properties.....

    I am having the same type of issue. However, I have been educated that the document.all propery does not work with Firefox. Firefox does have an Error tool that will tell you exactly where the error lies.
    Tools ----> Error Console.


  •  

    Posting Permissions

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