Controller is firing but I can't get the $_GET |
You can send data back from a POST too and it is done identically to the way you would respond to a GET. It's only AJAX after all.
You'll want to add handling to the JavaScript. Code: document.onreadystatechange = function () { You can also use event listeners to handle readyState changes. Here's one for DONE a.k.a. xhr.readyState == 4 Code: xhr.addEventListener("loadend", callbackFn, false); Where "callbackFn" is a function to handle the response. It can be an in-line anonymous function too. And if you really, really, really insist on using get the way to pass data is to construct your url complete with a query string. Code: var url = 'http://localhost/Subit_backend/register' + '?email=' + jsonResponse["email"]; // if jsonResponse["email"] is a string |
Welcome Guest, Not a member yet? Register Sign In |