Re: Re: Re: jQuery to PHP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 22 Jun 2011 at 21:56, Ethan Rosenberg <ethros@xxxxxxxxxxxxx> wrote: 

> At 04:30 PM 6/22/2011, you wrote:
>> On 22 Jun 2011 at 20:56, Jim Lucas <lists@xxxxxxxxx> wrote:

>> So the OP is using the form's action to reload the page, and
>> seemingly making an ajax call under some circumstance that will also
>> retrieve the whole contents of the same page - and do what with it?
>>
>> Anyway if you just want to get the coords of a square into a form by
>> clicking, I'd have thought just use JavaScript. No need for ajax for
>> that bit, IMO. Use the ajax stuff to send the move off to the chess
>> program script, and use its reply to update the board showing the new
>> position.

> I am not trying to reload the page.  I am trying to send the
> coordinate of the chess square, which is identified by an id, to the
> form.  The ajax call does work, since when it runs, it shows an alert
> "Yippee".  However, nothing appears in $_POST or $_GET.  I hope this
> clarifies the issue.

Ethan,

1) The page will reload when you click on "Enter move", ISTM.

2) Instead of doing alert("yippee"), seems to me you should alert on the results of the ajax call. I don't know how you get at those with jquery, but I imagine that is where you'll find the results of doing var_dump($_POST);

3) Where *are* you expecting the output from var_dump($_POST); to appear, and why?

4) You say the ajax call "works". Well, for some value of "works", perhaps, but you are calling for your own page to be the script to be run, I can't really see the point of that.

5) For a simple but effective ajax example, see http://www.clothears.org.uk.

6) If you're attaching an onclick to each table cell, the onclick handler can write the cell's id into the form, seems to me. Why use ajax for that?

BTW, I'm replying via the list (even though so far this has minimal PHP content) because my mail host at clothears appears to be on earthlink's shitlist.

--
Cheers  --  Tim

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux