Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #27613
| From | danca <cyberdanny@tiscalinet.it> |
|---|---|
| Newsgroups | comp.lang.javascript |
| Subject | Re: Javascript needed to work in tandem with a backend |
| Date | 2015-05-13 10:50 +0200 |
| Organization | A noiseless patient Spider |
| Message-ID | <miv369$7au$1@dont-email.me> (permalink) |
| References | <cfe30f66-74a1-4a03-890a-5914e9e2aff7@googlegroups.com> |
Il 11/05/2015 20:00, bit-naughty@hotmail.com ha scritto:
> Hi, I want that a menu should popup on a mouseclick on a couple of
> <div>s onscreen, with for example, a URL as one of the clickable
> options, ie. "Click this to go to yahoo.com". Thing is, the URL will
> need to be with args to the backend PHP script, ie.
> 'yahoo.com/search="gloop" '.However the page itself will by a
> dynamically generated one, ie. the backend script has to fill in the
> "gloop", according to whatever behaviour I want.
>
> How to do this, please? I'm getting a little confused as to the
> quoting, for starters. Can you guys help? :)
>
>
> Thanks so much.
>
Something like this?
Menu:
<a href="yahoo.com/">Search</a>
<a href...> etc.
Input for the text to search:
Enter text to search:<input id="MyIn" type="text">
<button onclick="completeSearchURL()">Click me!</button>
...
A simple script that adds the text entered to the menu href's
<script>
function completeSearchURL(){
var text2add=document.getElementById("MyIn").value;
var aMenu=document.getElementsByTagname("a");
for(var j=0;j<aMenu.length;++j){aMenu[j].href=aMenu[j].href+text2add}
}
HTH
Dan
Back to comp.lang.javascript | Previous | Next — Previous in thread | Find similar | Unroll thread
Javascript needed to work in tandem with a backend bit-naughty@hotmail.com - 2015-05-11 11:00 -0700
Re: Javascript needed to work in tandem with a backend "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2015-05-11 20:36 +0200
Re: Javascript needed to work in tandem with a backend bit-naughty@hotmail.com - 2015-05-13 10:35 -0700
Re: Javascript needed to work in tandem with a backend "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2015-05-13 22:54 +0200
Re: Javascript needed to work in tandem with a backend danca <cyberdanny@tiscalinet.it> - 2015-05-14 12:05 +0200
Re: Javascript needed to work in tandem with a backend bit-naughty@hotmail.com - 2015-05-18 10:32 -0700
Re: Javascript needed to work in tandem with a backend Tim Streater <timstreater@greenbee.net> - 2015-05-18 18:50 +0100
Re: Javascript needed to work in tandem with a backend danca <cyberdanny@tiscalinet.it> - 2015-05-19 19:00 +0200
Re: Javascript needed to work in tandem with a backend bit-naughty@hotmail.com - 2015-05-21 06:30 -0700
Re: Javascript needed to work in tandem with a backend danca <cyberdanny@tiscalinet.it> - 2015-05-13 10:50 +0200
csiph-web