Как отправить json и проанализировать его на следующей странице html через URL-адрес в jquery?

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;
)};
7 голосов | спросил Hrudaya Palwe 28 Mayam15 2015, 09:20:50

0 ответов


Похожие вопросы

Популярные теги

security × 330linux × 316macos × 2827 × 268performance × 244command-line × 241sql-server × 235joomla-3.x × 222java × 189c++ × 186windows × 180cisco × 168bash × 158c# × 142gmail × 139arduino-uno × 139javascript × 134ssh × 133seo × 132mysql × 132