iframe子页怎么获取父页的window对象

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了iframe子页怎么获取父页的window对象相关的知识,希望对你有一定的参考价值。

参考技术A 1、父页面中的iframe
复制代码 代码如下:
<iframe name="parentPage"></iframe>
2、子页面中元素的属性
复制代码 代码如下:
<input type="text" id="date" data-dojo-type="dijit/form/DateTextBox" value="2013-11-12"/>
3、取子页面中DateTextBox中值
复制代码 代码如下:
var statisDate = window.frames["parentPage"].document.getElementById('date').value;本回答被提问者和网友采纳

WordPress父页和子页摘录

Snippet for a parent page to list child pages with excerpts.
  1. <div class="entry-content entry">
  2.  
  3. <?php the_content(); ?>
  4.  
  5. </div><!-- .entry-content -->
  6.  
  7. <!-- list child-pages with links and excerpt -->
  8. <?php global $post; ?>
  9. <?php $pages = get_pages( array( 'child_of' => $post->ID, 'orderby' => 'menu_order' ) ); ?>
  10. <?php if ( $pages ) : ?>
  11. <?php $inner_query = new WP_Query("post_type=page&posts_per_page=-1&post_parent={$id}&orderby=menu_order&order=ASC");
  12. while ($inner_query->have_posts()) : $inner_query->the_post(); ?>
  13. <h2 class="children-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
  14. <?php the_excerpt(); ?>
  15.  
  16. <?php endwhile; endif; ?>
  17.  
  18. <?php wp_reset_query(); ?>

以上是关于iframe子页怎么获取父页的window对象的主要内容,如果未能解决你的问题,请参考以下文章

母版页的铵钮事件去获取子页的内容

iframe 怎么继承父页面的 css 和 js

子iframe 怎么访问 父的 iframe方法

如何让iframe动态改变,单是却不刷新父页

在Wordpress中打开父页/子页时显示子页

各位大侠我想问一下 iframeresizer.js 父页面和子页面怎么互调方法?(跨域)