waldette Posted August 1, 2013 Share Posted August 1, 2013 Hello all, i have a problem processing multiple varibles between php and jquery. js file: $.ajax({ type: "POST", url: "process.php", data: postData, success: function(result) { i need to send differents variables from php to this js file. Example: result.one result.two ... Is it possible get multiple variables from php to js? Then i need do this, for example: success: function(result) { if(result.ONE == yes){ .... }else if (result.TWO == anything){ .... } help pls! Link to comment Share on other sites More sharing options...
waldette Posted August 5, 2013 Author Share Posted August 5, 2013 nothing? no1 know it? i investigate and its anything same json, but i dont know how to use it. can any1 explain me a example pls? Link to comment Share on other sites More sharing options...
vekia Posted August 6, 2013 Share Posted August 6, 2013 the question is where you use this php file? it's a module? controller? external script? everytyhing depends on it. what to do? you have to create template file with simple echos. just append variables to the smarty assign array, then in the tpl file use: <script> myvariable={$first_variable}; another={$second_variable}; </script> and you will be able to use these variables from script that you creating. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now