M
MS
Hi,
The following bookmarklet is one I altered to use from the library lookup
project. Basically the 1st 2 lines of the code below extracts a book's
ISBN number (worldwide unique ID) from the book's page on a site like
Amazon. The next 3 lines open a new window on my local library's site with
the URL formatted like a GET posting of a form to do the search on the
library's site for the ISBN retrieved by the 1st 2 lines of code.
javascript:var%20re=/([\/-]|is[bs]n=)(\d{7,9}[\dX])/i;
if(re.test(location.href)==true){var%20isbn=RegExp.$2;
void(win=window.open('http://www.address.uk/bin/def?input='+isbn,
'LibraryLookup','scrollbars=1,resizable=1,
location=1,width=575,height=500'))}
This used to work perfectly, but now my library has changed their system
and the site will no longer accept a GET URL and requires a post.
jamie.ly in this forum showed be how to POST the data automatically, and
what I came up with is this:
javascript:'<body onload="document.forms[0].submit()">
<form Method="post" action="www.address.com/TP/doSearch.do">
<input name="searchType" value="advSearch" />
<input name="st1" value="controlNumber" />
<input name="sv1" value=isbn />
<input name="sb1" value="And" />
<input name="st2" value="title" />
<input name="sv2" value="" />
<input name="sb2" value="And" />
<input name="st3" value="author" />
<input name="sv3" value="" />
<input name="searchLocation" value="talislms" />
<input name="searchCollection" value="1" />
<input name="searchSites" value="-1" />
<input name="searchDates" value="" />
<input name="searchManualDate" value="" />
<input name="searchLanguages" value="" />
<input name="searchFormats" value="" />
<input name="searchOPUS" value="" />
<input name="pageSize" value="20" />
</form></body>'
When I merged the 2 bits of code together I ended up with a new window
opening showing my library's search page and then the form acting on the
original page, in this case a book page on Amazon's site. Obviously the
form to be posted needs to be done on the newly opened page (the library's
search page) and not on the Amazon page (which gave me a 404 as you'd expect).
Try as I might I can't work out how to join the 2 bits of code together
correctly, E.G. open a new window and once opened and loaded, run the form
code on it.
Can someone help please? Many thanks, and regards, etc..
The following bookmarklet is one I altered to use from the library lookup
project. Basically the 1st 2 lines of the code below extracts a book's
ISBN number (worldwide unique ID) from the book's page on a site like
Amazon. The next 3 lines open a new window on my local library's site with
the URL formatted like a GET posting of a form to do the search on the
library's site for the ISBN retrieved by the 1st 2 lines of code.
javascript:var%20re=/([\/-]|is[bs]n=)(\d{7,9}[\dX])/i;
if(re.test(location.href)==true){var%20isbn=RegExp.$2;
void(win=window.open('http://www.address.uk/bin/def?input='+isbn,
'LibraryLookup','scrollbars=1,resizable=1,
location=1,width=575,height=500'))}
This used to work perfectly, but now my library has changed their system
and the site will no longer accept a GET URL and requires a post.
jamie.ly in this forum showed be how to POST the data automatically, and
what I came up with is this:
javascript:'<body onload="document.forms[0].submit()">
<form Method="post" action="www.address.com/TP/doSearch.do">
<input name="searchType" value="advSearch" />
<input name="st1" value="controlNumber" />
<input name="sv1" value=isbn />
<input name="sb1" value="And" />
<input name="st2" value="title" />
<input name="sv2" value="" />
<input name="sb2" value="And" />
<input name="st3" value="author" />
<input name="sv3" value="" />
<input name="searchLocation" value="talislms" />
<input name="searchCollection" value="1" />
<input name="searchSites" value="-1" />
<input name="searchDates" value="" />
<input name="searchManualDate" value="" />
<input name="searchLanguages" value="" />
<input name="searchFormats" value="" />
<input name="searchOPUS" value="" />
<input name="pageSize" value="20" />
</form></body>'
When I merged the 2 bits of code together I ended up with a new window
opening showing my library's search page and then the form acting on the
original page, in this case a book page on Amazon's site. Obviously the
form to be posted needs to be done on the newly opened page (the library's
search page) and not on the Amazon page (which gave me a 404 as you'd expect).
Try as I might I can't work out how to join the 2 bits of code together
correctly, E.G. open a new window and once opened and loaded, run the form
code on it.
Can someone help please? Many thanks, and regards, etc..