开发者

How can I send wysiwyg editor code to php by ajax

I have nicEditor wysiwy开发者_StackOverflow中文版g editor in my page (textarea tag) .

I want to send the output of the code editor to php page by ajax , this is my request .


You can do a php require to include any type of file:

textarea.html:

<textarea>
//htmlcode
</textare>

page.php:

 <?php
 //php code
 require "textarea.html"
 ?>

is that what you are talking about? Or are you refering to using javascript to get html code from the file?


i don't know exactly how nicEdit works, but according to nicedit.com, it just changes all <textarea>s to rich html editors. I'm guessing you can still refer to the textareas the same way, which would by to do what @atlavis said:

<textarea id='text1'></textarea>

<script>
var textarea document.getElementById('text1').value;
textarea = escape(textarea);

//now send textarea to the php with a XHR request

</script
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜