![]() |
AJAX Noob
Alright I'm new to ajax but I wanted to know how to go about this using POST I can't find examples and the ones I look at show I'm doing this right but it doesnt seem to be working maybe someone can catch my error.
Index Code:
<html>players.php PHP Code:
|
Does it really need to be done using POST? Personally I would use GET and do it the following way:
Code:
ajaxRequest.open("GET", "players.php?limit=" + limit, true);If it's absolutely necessary for it to be done using POST then sorry for not being much help there. |
its okay, its not necessary I'm doing this as a learning experience, yeah I know how to do it with GET it's successful with that I just want to learn how to do it with POST as said previously :-\. thanks though
|
with a POST request you have to send the parameters separating them from the url. so you create a variable in which you place the values from your form
Code:
var parameters = "limit=" + encodeURI( document.getElementById("limit").value );Code:
... |
i was using this to post name-value pairs to a php script
you can add onblur="ajaxFunction(this.id,this.value)" to your forms input fields so they can validate in real time. I had div elements with id's the same as their corrosponding form field but with an x infront (i read somewhere not to give things the same id). hope this helps anyone... Code:
function ajaxFunction(id,value){ |
| All times are GMT +1. The time now is 12:41 PM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.