joycecwj Posted May 25, 2009 Share Posted May 25, 2009 to run json function is it need a json function call? i read alot example all the json function start with $(document).ready(function(){ if i dun wan to do that my json function will run? Link to comment https://forums.phpfreaks.com/topic/159528-json/ Share on other sites More sharing options...
Maq Posted May 25, 2009 Share Posted May 25, 2009 to run json function is it need a json function call? i read alot example all the json function start with $(document).ready(function(){ if i dun wan to do that my json function will run? Huh? Link to comment https://forums.phpfreaks.com/topic/159528-json/#findComment-841500 Share on other sites More sharing options...
joycecwj Posted May 25, 2009 Author Share Posted May 25, 2009 sorry sorry. is like how to run a json function. its need any function call? example : function save(){ var finalpoint=marker.getPoint(); //alert (finalpoint); // alert(finalpoint); // var JSONObject = new Object; var data = finalpoint; data[data.length]={name:"data",value:data[0]}; //alert(data); /*var data = $("#add-point :input").serializeArray(); data[data.length] = { name: "lng", value: finalpoint[0] }; data[data.length] = { name: "lat", value: finalpoint[1] }; alert(data.value);alert(data.value);*/ // var dataString = $.toJSON(finalpoint); /*$.ajax({ type: "POST", url: URL, cache:false, data: values, dataType:'json', success: function(json) {*/ $("#add-point").submit(function(){ $.post($("#add-point").attr('action'),data, function(json){ alert (data); //$("#add-point .error").fadeOut(); if (json.status == "fail") { $("#add-point .error").html(json.message).fadeIn(); } if (json.status == "success") { $("#add-point :input[name!=action]").val(""); var location = json.data; alert(location); } }, "json"); return false; }); } oni need to write save(); to execute it? understand wat i mean? Link to comment https://forums.phpfreaks.com/topic/159528-json/#findComment-841510 Share on other sites More sharing options...
darkfreaks Posted May 25, 2009 Share Posted May 25, 2009 http://stackoverflow.com/questions/790968/missing-after-element-list-parsing-json Link to comment https://forums.phpfreaks.com/topic/159528-json/#findComment-841786 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.