I have a program that [hopefully] will use Ajax to move a variable from JavaScript to PHP. When it runs, it hangs with an error [Firebug]. When I force it to continue, it does give results. I would like the following: 1] don't hang and 2] not be forced to use document.write.
This is a chess program [jq_test.php]. When the user dbl-clicks on a squar, the coordinate of the square should be in the $_POST variable:
2. why are you using document.write in the first place? you are using Jquery, just use .html()
3. what are you trying to accomplish with your post data? Youve already made a variable to catch the id it's moving from, but you are reiterating it in the actual data....
** remember to wrap your code in code blocks by clicking on the black hash mark.***
and you keep chaning the code to this for some reason and it doesnt make sense.
Code:
data{move_from: $(this).attr("id")}),
07-06-2011, 03:30 PM
woofy613
Thsnks.
How do I "remember to wrap your code in code blocks by clicking on the black hash mark."?
Using your suggested code, the result appears in all the squares with the id of b.
What is desired is to have the result in the $_POST variable w/o any output to the screen. If we have to start w/ screen output to fine tune the code, OK. The output should appear only once on the screen and not in any of the squares.
Thanks again.
07-07-2011, 11:37 AM
woofy613
Dan -
Any more ideas? I'm really stuck on this and I'd like to be able to finish.
Thanks ever so much
07-07-2011, 03:31 PM
woofy613
To all users of this list -
Does anyone have any ideas how too solve the problem?