Gossamer Forum
Home : General : Internet Technologies :

javascript question

Quote Reply
javascript question
hi

What I want to do is print the URL of the window that's currently open by clicking on a link in my bookmarks bar. If the user has a few windows open as tabs in their browser, it should print the one that's currently being viewed or in front.

By clicking directly on this bookmarkt it means there is effectively no referring URL, and the history doesn't apply either (I don't think?).

This is what I've got which pops up the window but the href is coming up as undefined...

Code:

javascript:{void( prompt( document.write( window.location.href ) ,''))}

Can anyone help with this one?

Regan
Quote Reply
Re: [ryel01] javascript question In reply to
actually, if anyone can tell me how to access the actual URL that this javascript call creates that would do the trick...

window.history.back()

Regan
Quote Reply
Re: [ryel01] javascript question In reply to
Total guess:

document.write( window.history.back.href )

Hope that helps/works Blush

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] javascript question In reply to
nope, that didn't work - undefined. Unimpressed

r
Quote Reply
Re: [ryel01] javascript question In reply to
Doh :/

How about this?

document.location.href=document.referrer;

Hope that helps.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] javascript question In reply to
hi andy - nope, that won't work because there's no referrer.

What I'm trying to do is...

when someone is browsing the web and they find a page they like, they can click on my toolbar bookmark (or whatever it ends up being) and it will save the url of that page to their bookmarks database on my server.

not sure if that helps.

r
Quote Reply
Re: [ryel01] javascript question In reply to
Mmm.. something like this then?

http://javascript.internet.com/...ils/bookmark-us.html

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] javascript question In reply to
hi Andy - yes, "similar" to that concept, accept the pages they are browsing won't be mine so I can't insert a bookmark us link into the html page.

it's just a toolbar link or something that's always there, so if you like a particular page you click on my link (?) and it saves that URL to your own personal bookmarks list "on my server" (not in their browser).

r
Quote Reply
Re: [ryel01] javascript question In reply to
Mmm.. not sure thats possible (at least note with some kind of C/vB knowledge). Afraid thats well out of my area <G>

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] javascript question In reply to
In Reply To:
Afraid thats well out of my area <G>

me too I feel. Unsure

ahhhhhhhhhhhhhh well.

i like your icon.

r
Quote Reply
Re: [ryel01] javascript question In reply to
Quote:
i like your icon.

Cool

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [ryel01] javascript question In reply to
Hi,

Quote:
actually, if anyone can tell me how to access the actual URL that this javascript call creates that would do the trick...

window.history.back()


Browsers don't let you do this due to security considerations (you shouldn't be able to view what URL's a browser has been to).

Cheers,

Alex
--
Gossamer Threads Inc.