Jump to content
Sign in to follow this  
nasekt

Append a string to search query after clicking submit/search button

Recommended Posts

In this case, Let's take Google Search as example:The code is JScript .NET, which is basically a .NET version of Javascript. Regardless of language, Anyone with appending type of skill can answer my question.This code is used in Fiddler(It's a Man-in-the-middle proxy)

if (oSession.uriContains("&q=")) // oSession is a Fiddler object session // uriContains() function, checks for case-insensitive string from the URI{   var str = oSession.fullUrl; var sAppend = "test1+test2+test3"; if (!oSession.uriContains(sAppend))  {   oSession.fullUrl = str.replace( "&q=","&q="+sAppend);  }}

For those who are confused, It says, If &q= is present in the URI, replace &q= with &q=test1+test2+test3Problem: It appends test1+test2+test3 instantly, when it sees &q= in the URL.Basically, how do I make it wait until I click the submit/search buttonThank you.Update: I heard about Onsubmit() event, but not really familiar with it. How do I use it? like, should I go to google source page and edit the form id?Also, Any other methods besides Onsubmit()?

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...