/    Sign up×
Community /Pin to ProfileBookmark

Running Javascript through URL bar

Hey guys,

Working with Firefox quick search function.

Trying to setup a shortcut such as:

search 12345678

and it populates and actions a form.

The form is built in Javascript (with AJAX) there is only one field…

is this possible? I have done it with basic PHP forms in the past using:

javascript:var%C2%A0s=’%s’; url=’###INSERT YOUR KEYWORD SEARCH URL HERE###’; t=”; qc=0; chunks=url.split(‘%s’); for(i=0; i<s.length; i++){if(s.charAt(i)=='”‘)qc=qc^1; t+=((s.charAt(i)==’ ‘&&qc)?’^‘:s.charAt(i)); }args=t.split(/s/); nurl=”; for(i=0; i<chunks.length; i++){nurl+=chunks[i]; if(args[i]!=undefined)%C2%A0{args[i]=args[i].replace(/^/g,’ ‘); nurl+=args[i]; }}location.replace(nurl,'< BR>’);

wondering what i’m trying to do is even possible? if so could anyone provide any help?

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@donatelloAug 03.2012 — How about something like TinyURL?

You can put this type of service on your own server too...

For example, this search query string:

[URL="http://www.google.com/#hl=en&sclient=psy
-ab&q=filetype:pdf+firefox+search&oq=fil
etype:pdf+firefox+search&gs_l=hp.3...345
1.10345.0.11020.27.26.0.0.0.0.169.2351.1
9j7.26.0...0.0...1c.iyWTy9B9DrM&pbx=1&ba
v=on.2,or.r_gc.r_pw.r_cp.r_qf.&fp=a63d49
6e947e2bd4&biw=1440&bih=683"]http://www.google.com/#hl=en&sclient=psy

-ab&q=filetype:pdf+firefox+search&oq=fil

etype:pdf+firefox+search&gs_l=hp.3...345

1.10345.0.11020.27.26.0.0.0.0.169.2351.1

9j7.26.0...0.0...1c.iyWTy9B9DrM&pbx=1&ba

v=on.2,or.r_gc.r_pw.r_cp.r_qf.&fp=a63d49

6e947e2bd4&biw=1440&bih=683[/URL]


Is now this:

http://tinyurl.com/d4by794
×

Success!

Help @tarleton spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 4.25,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...