The "data" part of ajax should be some pair, for example:
data: {myVar:value}
myVar will then become your POST variable with the value 'value' (not
the literal string) in your PHP script.

To extend on the comment using Firebug, you should use it for Firefox.
The Firebug console will show you requests that are done through AJAX
including parameters that are GET/POSTed and the response it returns.
Very useful for debugging.

On Feb 12, 5:16 am, Liam Potter <radioactiv...@gmail.com> wrote:
> you can test if it would work using firebug, just check the net tab for
> activity from the page to "some.php"
>
> weidc wrote:
> > Hi,
>
> > i got a radio button. if this radio button is checked it shell send
> > the value of the button to a .php document. didn't used ajax at all so
> > i don't know how to do this.
>
> > at the moment i tried something like this:
>
> > $(":radio").click(function()
> >            {
> >                    $("#infoding").css("display","block");
> >                    var value = $(this).val();
> >                    $.ajax({
> >                       type: "POST",
> >                       url: "some.php",
> >                       data: value,
> >                       success: function(msg){
> >                             alert( "Data Saved: " + value );
> >                       }
> >                    });
>
> >            });
>
> > got it out of some documentation but don't know if it would work
> > 'cause i'm not able to test it at the moment.
>
> > i'd like to know if this would work and if not how it could work.
> > i'd be happy about any help.
>
> > thanks
> > -weidc
>
>

Reply via email to