473,395 Members | 1,412 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,395 software developers and data experts.

Help with Bookmarklet

I'm modifying some bookmarklets that get into our Library Catalog to
work with Firefox, based on some that work done at another library with
our same system. The bookmarklets they setup work fine in IE.

So far I've been able to get all the ones that prompt for a
single variable to work perfectly in Firefox.

The Author-Title one, however, prompts for TWO variables and it
works EXCEPT for the fact that the boxes for Author and Title
contain the word "undefined" rather than being simply blank boxes
(as as the ones with the single variable).

How do I get the boxes to be blank here as well? I tried several
different things but none worked.

Here's the code:

<a href="javascript:Qr=document.getSelection.text;Qa= prompt
('Author...',Qr);Qt=prompt('Title...',Qr);
if(Qa&&Qt)location.href='http://library.ccbcmd.edu/search~S4/q?
author='+escape(Qa)+'&title='+escape(Qt)">
Combined Author and Title...</a>

Thanks in advance for any help you can provide.

Giles W. Riesner Jr., Library Tech Support
Community College of Balto. Co. - Catonsville
800 S. Rolling Rd., Baltimore MD 21228 USA
Tel/V-Mail 1-410-455-4245
Email: gr******@ccbcmd.edu

Jul 23 '05 #1
3 1067


Giles wrote:

The Author-Title one, however, prompts for TWO variables and it
works EXCEPT for the fact that the boxes for Author and Title
contain the word "undefined" rather than being simply blank boxes
(as as the ones with the single variable).
<a href="javascript:Qr=document.getSelection.text;Qa= prompt
('Author...',Qr);


You want
var Qr = document.getSelection(); var Qa = prompt('Author...', Qr);
at least for Netscape 4 and later, and for Opera 7.
--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 23 '05 #2
Qr=document.getSelection.text is an incorrect statement. Thus the
variable goes "undefined"

Jul 23 '05 #3
Thanks. I tried what you gave me and it works beautifully.
Thanks Spats30 for your information as well.

--Giles Riesner

Jul 23 '05 #4

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

Similar topics

1
by: Robert Oschler | last post by:
In pre-Windows XP Internet Explorer, adding a bookmarklet for a user was really simple. All I add to do was create a link that executed addFavorite(). Internet Explorer under Windows XP won't...
2
by: Smugsboy | last post by:
Hi, Got a problem here. I'm trying to create a bookmarklet on IE6, that passes the outerHTML of the body element as a GET param my site. The problem is that for some page (ie mail.yahoo.com) the...
0
by: gunimpi | last post by:
http://www.vbforums.com/showthread.php?p=2745431#post2745431 ******************************************************** VB6 OR VBA & Webbrowser DOM Tiny $50 Mini Project Programmer help wanted...
25
by: bweaverusenet | last post by:
Hi. I am trying to get some javascript to work in IE6, from the address line. It works in Firefox and, I believe, IE7. It appears that with some number of nested structures, the code does not...
7
by: Amir Michail | last post by:
Hi, I would like to add a submission bookmarklet to my app that takes the current selection and pastes it into the app's rich text editor while preserving formatting. It should work in at least...
3
by: erittaf | last post by:
I am trying to write a javascript bookmarklet that will pull data from a webpage. The webpage in question comes pre-filled with info. I know what element and form numbers are tied to the field that...
5
by: Jonathan Fine | last post by:
If you care about mathematics on the web, this might be for you. I'm the lead developer of MathTran, a web service that provides TeX for math formulas as web service. Visit...
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.