Skip to main content

Posts

Showing posts with the label JSON

JSON and JSONP in Javascripit

JSON and JSONP in Javascripit JSON is a subset of the object literal notation of JavaScript. JSON in JavaScript Example: var myJSONObject = {"Address": [ {"city": "Azamgarh", "state": "Uttar Pradesh", "country": "INDIA"}, {"city": "Lucknow", "state": "Delhi", "country": "USA"}, {"city": "Noida", "state": "Goa", "country": "UK"} ] }; Code Explaination: Here bindings is an object. It contains array of 3 object. Members can be retrieved using dot or subscript operators. Example : myJSONObject.bindings[0].method JSON Objects JSON objects are written inside curly braces Example : var name = {"firstName":"John", "lastName":"Doe"} JSON Arrays JSON arrays are written inside square brackets. Example : var employeeList = "emplo...

JSON Jquery Ajax

If use want to trigger ajax on Click   $('.taskStat').live('click',function(){        $.ajax({             type: 'POST',             url: ajax_url+"Members/change_Addtask/"+stat,             success: function(data) {                 var obj=JSON.parse(data);                 if(obj.resp=='true')                 {                     alert("Hello sudhir");                 } else                 {          ...