以下代码应该在单击 时<span class="edit_submit"></span>
获取 的内容textarea
并通过 POST 将其发送到edited_page.php
,然后显示 的内容edited_page.php
。目前,我什至不相信该功能正在运行。有任何想法吗?
$('.edit_submit').on('click', function () {
$parent = $(this).parent()
$textarea = $(this).siblings(".el-rte").child(".workzone").child("textarea");
$text = $textarea.val();
$id = $textarea.attr('id');
$parent.html("images/load.jpg").load("edited_page.php", {location: $id, content: $text, page: "<?php echo $page; ?>"});
});
HTML:
<div id="main">
<div class="el-rte">
<div class="workzone" style="height: 400px;">
<textarea id="main" class="edit_area" style="display: none; height: 400px;" name="main">
<b>Hello. </b><i>This is sam </i><u>Testing this website </u>
</textarea>
</div>
</div>
<span class="edit_submit" style="background:black;">Save Edit</span></div>
</div>