473,385 Members | 1,834 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

detecting ENTER keypress and click in Address Bar

Hello everyone
I have just finished going through some tutorials on developing
extensions for mozilla and have made a version of the born-geek
toolbar. Being a newbie I am stuck at a relatively simple-sounding
problem and would greatly appreciate any pointers/examples..

The problem: I want to detect an ENTER keypress.
Why: I am developing an extension which should say the site you are
visiting is xyz.com. I can pick up the main URL using
alert(window.content.document.location.href); (thanks to people on
this forum!) but then I need to send it to my server and receive a
reply back. I want to pick up the URL only when an ENTER is pressed or
when the user clicks on the GO in the address bar.

Can someone please point me to a solution?

I checked up this forum and google groups, and did try out if the
keycode==13 thing, but I am confused about the fact that who should
call this function? This function should keep running in the
background irrespective of whether any toolbar buttons are clicked or
not. The same goes for detecting whether the GO key has been clicked.
How do I access this key? Is there a standard name/ID for it?

Thanks in advance,
-A
Jun 27 '08 #1
2 3532
On Apr 12, 1:26 am, newbiegalore <banerjee.anir...@gmail.comwrote:
Hello everyone
I have just finished going through some tutorials on developing
extensions for mozilla and have made a version of the born-geek
toolbar. Being a newbie I am stuck at a relatively simple-sounding
problem and would greatly appreciate any pointers/examples..

The problem: I want to detect an ENTER keypress.
Why: I am developing an extension which should say the site you are
visiting is xyz.com. I can pick up the main URL using
alert(window.content.document.location.href); (thanks to people on
this forum!) but then I need to send it to my server and receive a
reply back. I want to pick up the URL only when an ENTER is pressed or
when the user clicks on the GO in the address bar.

Can someone please point me to a solution?

I checked up this forum and google groups, and did try out if the
keycode==13 thing, but I am confused about the fact that who should
call this function? This function should keep running in the
background irrespective of whether any toolbar buttons are clicked or
not. The same goes for detecting whether the GO key has been clicked.
How do I access this key? Is there a standard name/ID for it?

Thanks in advance,
-A
any pointers would be appreciated! :-)
Jun 27 '08 #2
VK
On Apr 12, 12:26 pm, newbiegalore <banerjee.anir...@gmail.comwrote:
Hello everyone
I have just finished going through some tutorials on developing
extensions for mozilla and have made a version of the born-geek
toolbar. Being a newbie I am stuck at a relatively simple-sounding
problem and would greatly appreciate any pointers/examples..
Where the one could be to use the appropriate newsgroup. It is not a
"go away!" message, but clj is primarily targeted to cross-browser
development for the Web. XPCOM and internal Gecko JavaScript layer
questions for privileged extensions are not really within this domain.
You should ask at mozilla.dev.tech.javascript

You may also look through http://developer.mozilla.org/en/docs/XUL and
http://www.xulplanet.com/
Both are a complete permanent mess for years, so some patience will be
needed.
Jun 27 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Philip Townsend | last post by:
Can anybody tell me how I can disable the enter (keyboard) button from being able to submit a form? In other words, force the user to click a button with the mouse? *** Sent via Developersdex...
9
by: VJ | last post by:
I have a window were I display a bunch of Labels. A click event is attached for each label, when clicked it will display a edit box i.e textbox. If the enter key is pressed in the textbox I want to...
12
by: SJ | last post by:
Hope someone can help me out there I'm struggling with a particular problem... I have a form with many tab pages. On one tab page I've got a button which when clicked with a mouse adds items...
15
by: Adam J. Schaff | last post by:
I have noticed that if a user closes a form via pressing return (either while the OK button has focus or if AcceptButton is set to OK for the form) then the "ENTER" keypress event fires ON THE...
4
by: alien2_51 | last post by:
I have a form with several buttons, I'd like to default to a specific button on the Enter keypress event, How would I do this...?
2
by: matthewr | last post by:
In Internet Explorer, for example, when you hit return in the address bar, the Go button is pressed. In my program, I have a toolstrip with a textbox and button. How do I ensure the button is...
7
by: Marc | last post by:
Hi, I want my user to be able to rename a button control by selcting rename from a menu. This then opens a text box in which to enter the new name in. I want the button control to...
1
by: Joey | last post by:
I have an asp.net 1.1/C# web form with a text box server control and one button server control. Users can type in text to search and then click the button to start the search. I want them to be...
4
by: almurph | last post by:
Hi everyone, I'm a newbie to javascript. I have written some code to detect when a user presses the down-arrow, up-arrow and enter button. Essentially the user can arrow down or up through a...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.