My problem isn't strictly speaking a Linux one, but I've tried to get a
solution to it in more Javascript-targeted places without success and so
am trying this list.
I added a search box to my blog. A person chooses whether to search just
my blog or the Web. I tested it and it worked, subject to one problem:
when I searched my blog only, I got some hits that consisted of many
posts. I wanted the hits to consist of individual posts only.
I found a way to limit hits from a search of my blog to individual posts
only. It involved automatically adding "inurl:post" to a search as it's
sent off to Google.
Here's the code:
<form method="get" action="http://www.google.com/search" target="new"
onsubmit='document.getElementById("q").value += " inurl:post";'>
<input type="text" name="q" size="45" id="q"
maxlength="255" value="" />
<input type="submit" style="cursor:pointer; font-size:10px;"
value="Google Search" />
<input type="radio" name="sitesearch" value="" />
Web *
<input type="radio" name="sitesearch"
value="stumblng.tumblr.com" checked /> The Stumblng Tumblr *<br />
</form>
However, there's a problem with the above. As well as adding
"inurl:post" to searches of my blog, it also adds it to searches of the
Web, which makes the latter type of search useless.
How can I change the above code so that "inurl:post" is only added to
searches of my blog and not to searches of the web?
Thanks for reading this,
Leslie
--
Visit http://stumblng.tumblr.com
An Australian lawyer's tumblelog about things (some legal, most not)
that you might otherwise have missed
--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html