albuvee
albuvee

Reputation: 2764

JavaScript Bookmarklet to open new Window and transmit params of origin Page

I have a perfectly working bookmarklet to grab the Document-Title and the URL of the current Website and place it into the URL of the new loaded Page (Code below) … now I wonder how to let this domain.com/bookmarklet?… open in a new small window (600x600px), so that I still see the old website from where I grabed the title and url in the background and have the new page (domain.com/bookmarklet?…) in the foreground.

javascript:location.href='http://domain.com/bookmarklet?url='+encodeURIComponent(location.href)+';title='+encodeURIComponent(document.title)

How can I achieve that?

Upvotes: 0

Views: 1493

Answers (2)

Matt Ball
Matt Ball

Reputation: 359776

Use window.open(...) instead of setting location.href = ....

Upvotes: 3

Sander
Sander

Reputation: 13421

you need to use window.open() for that

javascript:window.open ("http://domain.com/bookmarklet?.......","MyBookmarklet");

Upvotes: 1

Related Questions