关于 <script type='text/template' > 的妙用 / 使用jquery获取iframe加载完成事件
https://www.cnblogs.com/ddqyc/p/6200539.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>template</title>
<script src="http://libs.baidu.com/jquery/2.1.1/jquery.min.js"></script>
<script type="text/template" id="t1">
<h1>kkk</h1>
<h2>lll</h2>
<div id="k">111</div>
</script>
<script> //console.info(t1) $(document).ready(function(){
var t1 = $("#t1").html();
$("#nav").html(t1);
$("#k").html("kkk");
});
</script>
</head>
<body>
<div id="nav"></div>
</body>
</html>
本意是想加载外面的navi,这个模板只能本页用
换这个
使用jquery获取iframe加载完成事件
https://blog.csdn.net/szwangdf/article/details/7099370
只要是本地的 就存在跨域问题,必须放在服务器上才能访问。
关于 <script type='text/template' > 的妙用 / 使用jquery获取iframe加载完成事件的更多相关文章
- 前端模板<script type="text/template" id="tmpl">
前端模板, 比连接字符串好用多了, 还可以使用循环\判断等语句, 减少工作量 <script type="text/template" id="member-tmp ...
- Js script type="text/template"的使用简单说明
<script type="text/template" id="treeTableTpl"> <tr id="{{row.id}} ...
- <script type="text/template">是干什么的,为什么要把html写在js中? 这是什么编程语言风格,都能这样用吗?
这一段存放了一个模板.在js里面,经常需要使用js往页面中插入html内容.比如这样: var number = 123; $('#d').append('<div class="t& ...
- <script type="text/x-template"> 模板
获取动态的js模板可以用art-template插件 <script type="text/template"> 给<script>设置type=" ...
- 关于MVC模板渲染的一点小事type="text/template"
先上一个demo,简单粗暴,请自便 <!DOCTYPE html> <html> <head lang="en"> <meta chars ...
- script标签中type为<script type="text/x-template">是个啥
写过一点前端的都会碰到需要使用JS字符串拼接HTML元素然后append到页面DOM树上的情况,一般的写法都是使用+号以字符串的形式拼接,如果是短点的还好,如果很长很长的话就会拼接到令人崩溃了. 比如 ...
- JavaScript type="text/template"的用法
JavaScript type="text/template"相当于定义一个模板,如果没有使用html()方法的话,是显示不出来的,我们直接看例子(我是在tp框架的里面写的) &l ...
- document.write('<script type=\"text/javascript\"><\/script>')
document.write('<script type=\"text/javascript\"><\/script>')
- <script type="text/html"></script> js模版使用
<div></div> <script type="text/html" id="javascript_template"> ...
随机推荐
- Powershell 常见问题
unapproved verbs WARNING: The names of some imported commands from the module 'todo' include unappro ...
- linux环境下oracle静默安装
一.安装环境 1.linux版本:redhat6.3_x86_64 2.oracle版本:Oracle Database 11g Enterprise Edition Release 11.2.0.3 ...
- I.MX6 Android can-utils 移植
/******************************************************************* * I.MX6 Android can-utils 移植 * ...
- Oracle VM VirtualBox启动新建虚拟机弹错--不能为虚拟机xxxx电脑 打开一个新任务
有三种方案: 1.先在任务管理器中关掉所有virtualBox的进程,然后进入到C:\Users\Administrator\VirtualBox VMs\ 将相应guest的文件夹随便改个名字,再重 ...
- idea清除缓存和索引
转自:https://blog.csdn.net/mzy755423868/article/details/80559381
- 【190】修改 PowerShell & CMD 显示字体
方法一:Windows7更改替换cmd(powershell)字体完全方法教程 说明:该方法将字体修改成只能显示英文,对于某些中文会乱码!(chcp 850) 方法二:添加中文字体(chcp 936) ...
- 【184】FileZilla 搭建 FTP 及访问
参考:FileZilla 下载中心 参考:使用FileZilla Server轻松搭建个人FTP服务器 建好后,Windows 访问:Windows徽标键+R打开运行窗口,输入ftp://*** ,* ...
- linux 软件开发的源
deb http://mirrors.aliyun.com/ubuntu/ quantal main restricted universe multiversedeb http://mirrors. ...
- 【Aizu - 0005 】GCD and LCM
GCD and LCM Descriptions: Write a program which computes the greatest common divisor (GCD) and the l ...
- 进击的Python【第十章】:Python的高级应用(多进程,进程间通信,协程与异步,牛逼的IO多路复用)
Python的socket高级应用(多进程,协程与异步) 一.多进程multiprocessing multiprocessing is a package that supports spawnin ...