当前位置: 动力学知识库 > 问答 > 编程问答 >

ajax - post web page to php

问题描述:

I want to post a whole page using ajax to php file to be parsed.

say the sources is `http://www.mysite.com/page-1.

now post this page (from <html> to </html>) to "parse-page.php". and retrieve it with $_POST['document'].

网友答案:

Considering you just want to post the data and ignore anything coming back from the php, this should work.

$.post("parse-page.php", {'document', $('body').html()});

For more info: http://api.jquery.com/jQuery.post/

网友答案:

I'm thinking you can use javascript to store the innertext of the html tag and send that variable through ajax.

分享给朋友:
您可能感兴趣的文章:
随机阅读: