
Originally Posted by
dkblackhawk
I can't seem to grasp why this isn't working right now...I am using it as a tab in Chrome to open in a new window and fill in the forms.
Code:
javascript:(function(){ window.open('http://sitename.com?title='+encodeURIComponent(location.href);&url='+encodeURIComponent(location.href)); })();
When I click on the bookmark, nothing happens.
You have syntax errors. You can use a console (press [F12] in most browsers) to find this sort of thing. Decent code editors will also have syntax highlighting that makes simple mistakes like this obvious.
In this case, - you have an extra semicolon after you urlencode the
location.href, - you don't concatenate the second and third strings, and
- you forgot the opening quote for the third string.
Code:
(function(){ window.open( 'http://sitename.com?title=' +encodeURIComponent( location.href )+ '&url=' +encodeURIComponent( location.href ) ); })()
Tested; works (though it's likely your browser's popup blocker will, well, block it).

Originally Posted by
dkblackhawk
Also is it possible to grab the title of the current page in javascript? Thanks

Assuming there is a <title> tag, and that the first one is the correct one:
Code:
var title = document.getElementsByTagName("title")[0].innerHTML;
Bookmarks