Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Java > Java and JDK > Pro JSP
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Pro JSP Advanced JSP coding questions. Beginning questions will be redirected to the Beginning JSP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro JSP section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 31st, 2007, 10:27 AM
Registered User
 
Join Date: Jul 2007
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Works in IE but not in FF

I have the following function that works fine in IE but it gives and error in FF. What can I do to make this work in both browsers?.

The error that FF gives is the following:
 
Quote:
quote:event is not defined
Quote:

mtdChecaTecla()pestanas.js (line 28)
onkeydown(keydown charCode=0, keyCode=97)peemgral01.jsp (line 1)
[Break on this error] if ( event.altKey && event.keyCode != 18 ) {
AND HERE IS THE CODE
Code:
var mbFrameEncontrado = false;
var lObjFramePestanas = new Object();
var lObjFormPestanas  = new Object();

function mtdChecaTecla()    {

    if (  event.altKey  &&  event.keyCode != 18 )    {

        var lObjFrames = top.frames;
        var lbOprimioAtl = event.altKey;
        var liAsciiTecla = event.keyCode;

        mtdBuscaFrame( lObjFrames );

        if ( mbFrameEncontrado )    {

            lObjFramePestanas.mtdChecaTecla( lbOprimioAtl, liAsciiTecla )

            mbFrameEncontrado = false;
        }

    }
}
Reply With Quote
  #2 (permalink)  
Old September 12th, 2007, 11:20 PM
Friend of Wrox
 
Join Date: Mar 2007
Location: Hyderabad, A.P., India.
Posts: 373
Thanks: 0
Thanked 1 Time in 1 Post
Default

"event" object will not be availble directly in javascript when you use FF it works only with IE, you've to pass it as argument to the java script method while calling it. Try like as follows
function mtdChecaTecla(event) {
...
}
and in the html/jsp try like
<input type="text" onkeyup="mtdChecaTecla(event);" />

Hope that solves it.

- Rakesh
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Javascript works in IE7 not in FF 2 swifty_programmer Javascript 2 August 31st, 2007 02:07 AM
odd FF error, IE does nothing when run. JustABob Javascript 4 November 29th, 2005 01:50 PM
fade in not working in FF but does in IE crmpicco Javascript How-To 1 November 8th, 2005 12:49 PM
Window status works in FF, but not IE...why? msprothero Javascript 2 March 22nd, 2005 10:10 AM
Cross-frame scripting, works in FF but not IE Snib Javascript 4 October 25th, 2004 08:54 PM



All times are GMT -4. The time now is 08:34 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.