jQuery等效于window.document.write [英] jQuery equivalent for window.document.write

查看:113
本文介绍了jQuery等效于window.document.write的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有人知道javascript中的 window.document.write('')的jQuery等价物?
谢谢

Does anyone know the jQuery equivalent for window.document.write('') in javascript? Thanks

推荐答案

这将在正文结束标记之前添加字符串hello。不完全是的行为,但您可以对任何元素执行此操作,以使内容显示在您想要的位置。

This will add the string "hello" right before the body closing tag. Not exactly the behavior of write, but you can do this to any element to get the content to appear where you want it.

$(document.body).append('hello');

另外还有 prepend(内容) replaceWith(content)满足您的所有插入需求!

Also available are prepend(content) and replaceWith(content) for all your insertion needs!

这篇关于jQuery等效于window.document.write的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆