If your page contains a frame, and THAT frame contains and EXTERNAL/REMOTE page that contains the javascript that is "listening" for the "H" keypress, then you will NOT be able to rebind the event. In other words, what you are trying to do is not possible. The security restrictions imposed by the browser will not give you access to the iframe content/objects if it is from a different domain.
hielo
Veteran Poster
1,124 posts since Dec 2007
Reputation Points: 116
Solved Threads: 244
then you will need to do so AFTER the page has loaded. To clarify, basically this is what needs to be done:
//assuming this is what is there initially
document.body.onkeypress=function(){
//code that "listens" for "H"
...
};
then you need to override that listener after page load:
onload=function(){
//assuming this is what is there initially
document.body.onkeypress=function(){
//YOUR function definition here.
...
};
}
hielo
Veteran Poster
1,124 posts since Dec 2007
Reputation Points: 116
Solved Threads: 244
.... browser add-on .....
?????
Airshow
WiFi Lounge Lizard
2,683 posts since Apr 2009
Reputation Points: 321
Solved Threads: 372
Iv had a go at that, the key I need to override is backspace but entering the backspace code (8) does not seem to work. How should that work?
it will be better if you post what you have
@Airshow: I suspect he's developing something similar to a Greasemonkey script/"extension"
hielo
Veteran Poster
1,124 posts since Dec 2007
Reputation Points: 116
Solved Threads: 244
Hielo,
@Airshow: I suspect he's developing something similar to a Greasemonkey script/"extension"
Aha! Thanks, this topic makes sense now.Airshow
Airshow
WiFi Lounge Lizard
2,683 posts since Apr 2009
Reputation Points: 321
Solved Threads: 372