【发布时间】:2017-07-28 14:50:29
【问题描述】:
在搜索了很多并尝试了 5-6 次演示后,但都没有达到我想要的效果。 我有将其他域(网站)的服务显示为 iframe 的服务页面 在该 iframe 下方我有我的联系我们表格,但我的问题是 iframe 页面还包含联系我们页面。我想删除它。
是否可以删除从 iframe 源加载的表单?
编辑:我的代码
<script type="text/javascript">
function remove_elemment() {
var form = document.forms;
form.style.display = "none";
}
};
function doRemove() {
document.frame.document.getElementById('my_iframe').remove_elemment();
}();
</script>
<div class="floating-widget">
<iframe id="my_iframe" src="http://192.168.0.104/wordpress/?p=1" frameborder="0" width="100%" height="800">
</iframe>
</div>
html中加载的评论表单如下
<div id="respond" class="comment-respond">
<h3 id="reply-title" class="comment-reply-title">Leave a Reply <small><a rel="nofollow" id="cancel-comment-reply-link" href="/wordpress/?p=1#respond" style="display:none;">Cancel reply</a></small></h3>
<form action="http://192.168.0.104/wordpress/wp-comments-post.php" method="post" id="commentform" class="comment-form" novalidate="">
<p class="comment-notes"><span id="email-notes">Your email address will not be published.</span> Required fields are marked <span class="required">*</span></p>
<p class="comment-form-comment"><label for="comment">Comment</label> <textarea id="comment" name="comment" cols="45" rows="8" maxlength="65525" aria-required="true" required="required"></textarea></p>
<p class="comment-form-author"><label for="author">Name <span class="required">*</span></label> <input id="author" name="author" type="text" value="" size="30" maxlength="245" aria-required="true" required="required"></p>
<p class="comment-form-email"><label for="email">Email <span class="required">*</span></label> <input id="email" name="email" type="email" value="" size="30" maxlength="100" aria-describedby="email-notes" aria-required="true" required="required"></p>
<p class="comment-form-url"><label for="url">Website</label> <input id="url" name="url" type="url" value="" size="30" maxlength="200"></p>
<p class="form-submit"><input name="submit" type="submit" id="submit" class="submit" value="Post Comment"> <input type="hidden" name="comment_post_ID" value="1" id="comment_post_ID">
<input type="hidden" name="comment_parent" id="comment_parent" value="0">
</p>
</form>
</div>
【问题讨论】:
-
把你的html也放上去
标签: javascript php jquery html iframe