开发者

how to use ajax to post data on to the php page & then write the content to xml file

开发者 https://www.devze.com 2023-02-18 17:59 出处:网络
i want to pass the data returned by a javascript functionand the file name to a php page using ajax and then write that data in a file开发者_StackOverflow i.e takinf the file name from ajax post appen

i want to pass the data returned by a javascript function and the file name to a php page using ajax and then write that data in a file开发者_StackOverflow i.e takinf the file name from ajax post appending that name with .xml and finally writing that data to xml file.


For Posting use jquery post

$.post("myxmlpage.php",  //your url
    { "data1": "data1value", "data2": "data2value"}, //data values
    function(data){ //Your onsuccess call backfunction
        alert(data.name); 
        console.log(data.time); 
    }, "json" //retun data type //can be html/json/xml/text
    );

For writing to xml file. check this link,

0

精彩评论

暂无评论...
验证码 换一张
取 消