Help with Bookmarklet

G

Giles

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: (e-mail address removed)
 
M

Martin Honnen

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.
 
S

Spats30

Qr=document.getSelection.text is an incorrect statement. Thus the
variable goes "undefined"
 
G

Giles

Thanks. I tried what you gave me and it works beautifully.
Thanks Spats30 for your information as well.

--Giles Riesner
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top