Connecting Tech Pros Worldwide Help | Site Map

where does the & go LOL

Newbie
 
Join Date: Nov 2008
Posts: 12
#1: 3 Weeks Ago
ok this is the javascript

Expand|Select|Wrap|Line Numbers
  1. <script type="text/javascript">
  2.  
  3.     var options = {
  4.         script:"test.php?json=true&limit=6&one="+document.getElementById('oneone').value,
  5.         //script:"test.php?json=true&limit=6&",
  6.         varname:"input", 
  7.         json:true,
  8.         shownoresults:false,
  9.         maxresults:6,
  10.         callback: function (obj) { document.getElementById('testid').value = obj.id; },
  11.  
  12.     };
  13.     var as_json = new bsn.AutoSuggest('testinput', options);
  14.  
  15. </script>
  16.  
ok now no with this code not commented out i get

Expand|Select|Wrap|Line Numbers
  1. script:"test.php?json=true&limit=6&one="+document.getElementById('oneone').value,
  2.  
i get the value of oneone in firebug test.php?json=true&limit=6&one=s_city

when i comment that out and put in
Expand|Select|Wrap|Line Numbers
  1. script:"test.php?json=true&limit=6&",
  2.  
i get test.php?json=true&limit=6& varname=input

what i am asking is i know (well i think)i need a & in the first little section of code so i keeps adding the var name to the url .

please help thanks
gits's Avatar
Moderator
 
Join Date: May 2007
Location: Munich, Germany
Posts: 4,126
#2: 1 Week Ago

re: where does the & go LOL


what JavaScript framework do you use? it seems like a misuse of the api of a XMLHttpRequest ... I think the params should be added another way ...

kind regards
Reply


Similar JavaScript / Ajax / DHTML bytes