Hi,

Try something like it:

..
var urlJSON = "select.php?param=value";
  $.getJSON(urlJSON, function(json)
{
     ...stuff to do
     }

On Jul 11, 12:34 pm, K Bouton <[EMAIL PROTECTED]> wrote:
> How do I add a dynamic parameter in getJSON url?
>
> [code]
> function onSelectChange(){
>   var whatChecked = $("input:checkbox:checked").val();
>   $.getJSON("select.php", {whatChecked:"somevalue"}, function(json)
> {
>      ...stuff to do
>      }
> [/code]
>
> I want the url that getJSON uses to be dynamic and look like:
> select.php?whatChecked=somevalue
> for example select.php?carType=compact
>
> I can get the somevalue, no problem, but I can't figure out how to
> make whatChecked be the value eg carType and not the word whatChecked!

Reply via email to