question about jquery

0 Bright Ahiati · May 20, 2015
im really new with this stuff. is there a way to use jquery(ajax) to retrieve data from a php script in an array. i need to send and retrieve data using ajax but i need the data in an integer format.

Post a Reply


Oldest  Newest  Rating
0 Ali Hassan · May 20, 2015
you can use the data attribute to send data to the php script file and dataType to determine what is the data type of the returned data from that script file like so


url: "myPhp.php",
type: "get",
data: {id: 5} ,// and object of the data name and data value pairs
dataType: "json" // returns a json object,
success: function(returnedData){

console.log(returnedData); // logs the data returned by the php script file to the console

+1 Abdullah Nauman · May 20, 2015
For future reference:
  • 1



A scripting language that is added to standard HTML to create interactive effects, apps, games for the browser.