jquery窗口开启器不';nt工作 函数预览内容(lang){ 打开(“+lang”,ckeditor_预览”,“位置=0,状态=0,滚动条=1,宽度=980,高度=600”); }

jquery窗口开启器不';nt工作 函数预览内容(lang){ 打开(“+lang”,ckeditor_预览”,“位置=0,状态=0,滚动条=1,宽度=980,高度=600”); },jquery,input,window,window.opener,Jquery,Input,Window,Window.opener,更正 $(文档).ready input[name=“content”] content['”$lang_k.] $('.preview_content').html(window.opener.jQuery(“input[name=“content”]”)的.value) .html()用于在所选元素内部设置html。$(文档).ready(函数(){您期望什么?实际发生了什么?我在任何地方都看不到名为content的输入,我也不知道为什么要将PHP直接注入到jQuery选择器字符串中。

更正

  • $(文档).ready
  • input[name=“content”]
  • content['”$lang_k.]

    $('.preview_content').html(window.opener.jQuery(“input[name=“content”]”)的.value)


.html()
用于在所选元素内部设置html。

$(文档).ready(函数(){
您期望什么?实际发生了什么?我在任何地方都看不到名为
content
的输入,我也不知道为什么要将PHP直接注入到jQuery选择器字符串中。
<script type="text/javascript" charset="utf-8">
function PreviewContent(lang) {
    window.open("<?php echo base_url('system/pages/preview/about/') ?>" + lang, "ckeditor_preview", "location=0,status=0,scrollbars=1,width=980,height=600");
}

</script>

<tr>                                            
<td valign="top"><?php echo lang('label_content'); ?></td><td>
                                             <?php                                              echo $this->ckeditor->editor("content[$lang_k]", $text->content);                   ?>                                          
<input type="button" value="Preview Content" onclick="PreviewContent('/<?php echo $lang_k;    ?>');" /></td>
<script>
$().ready(function() {
$('.preview_content').html(window.opener.jQuery("input[name=content]<?php echo $p_lang; ?>").value);
});    
</script>

<div class="preview_content"></div>