81
rated 0 times
[
86]
[
5]
/ answers: 1 / hits: 18271
/ 9 Years ago, thu, may 28, 2015, 12:00:00
I want to send json data through url to next html page. I checked it by emulator as I am working for mobile app, the url could not redirect to next page it is crashing at the moment what is the reason behind this. How can I parse it on next page .I am new to the jquery any idea? my json data contains result of two different sql queries in an array
$.ajax({
type : POST,
datatype : json,
url : http://Localhost/phpBB3/check_pass.php?username=+ username + &password=+ password+&f=68,
success: function(data){
alert(data);
window.location.href=source/testmenu.html?varid= + data +&username= + username +&password= + password;
}
});
This is the code on next page
$(document).ready(function GetUrlValue(VarSearch){
var SearchString = window.location.search.substring(1);
var arr = SearchString.split('&');
console.log(arr);
//Set session variables
var username = arr[1].split('=')[1];
var password = arr[2].split('=')[1];
document.getElementById('username').value = username;
document.getElementById('password').value = password;
)};
More From » jquery