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? Quote 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? Quote 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? Quote 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 Quote Link to comment https://forums.phpfreaks.com/topic/159528-json/#findComment-841786 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.