JavaScript函数的等效jQuery函数
Equivalent jQuery function of a javascript function
哪个是这个javascript函数的等效jQuery函数?这是在基于 iframe(id='editor')和文本区域(id='text')的文本编辑器上下文中。
function edit(){
edition = document.getElementById("editor").contentWindow;
HTMLcontent = edition.document.getElementsByTagName('body')[0];
HTMLcontent.innerHTML = document.getElementById('text').value;
}
在Jquery中,代码是这样的:
bodyIframe = $("#editor").contents().find("body")[0];
bodyIframe.html($("#text").val());
相关文章:
- 执行ajax成功函数-jQUERY
- 函数jquery.html()不提供数据属性集值
- 将变量放入ajax函数JQuery
- 函数jquery的未定义返回
- 如何在嵌套函数jquery上保持变量的值不变
- 用我的函数jquery给出数据/参数
- Firefox在调用函数(jquery)时冻结
- 在传递节时触发一个函数 - jquery
- 循环执行数组函数jQuery
- 在函数中调用另一个函数JQuery
- 对象不是函数-Jquery/JavaScript
- TypeError:对象不是函数-jquery
- 获取函数jQuery设置的属性
- 从函数jquery获取更新的变量值
- 切换而不是悬停函数jQuery
- 函数jQuery.animation()运行了两次行,但不起作用
- 使用函数 jQuery 获取变量
- 自执行函数 jquery 与 JavaScript 的区别
- 从回调函数 -JQuery 获取返回值
- 一个接一个地执行函数 JQUERY