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加载完成事件的更多相关文章

  1. 前端模板<script type="text/template" id="tmpl">

    前端模板, 比连接字符串好用多了, 还可以使用循环\判断等语句, 减少工作量 <script type="text/template" id="member-tmp ...

  2. Js script type="text/template"的使用简单说明

    <script type="text/template" id="treeTableTpl"> <tr id="{{row.id}} ...

  3. <script type="text/template">是干什么的,为什么要把html写在js中? 这是什么编程语言风格,都能这样用吗?

    这一段存放了一个模板.在js里面,经常需要使用js往页面中插入html内容.比如这样: var number = 123; $('#d').append('<div class="t& ...

  4. <script type="text/x-template"> 模板

    获取动态的js模板可以用art-template插件 <script type="text/template"> 给<script>设置type=" ...

  5. 关于MVC模板渲染的一点小事type="text/template"

    先上一个demo,简单粗暴,请自便 <!DOCTYPE html> <html> <head lang="en"> <meta chars ...

  6. script标签中type为<script type="text/x-template">是个啥

    写过一点前端的都会碰到需要使用JS字符串拼接HTML元素然后append到页面DOM树上的情况,一般的写法都是使用+号以字符串的形式拼接,如果是短点的还好,如果很长很长的话就会拼接到令人崩溃了. 比如 ...

  7. JavaScript type="text/template"的用法

    JavaScript type="text/template"相当于定义一个模板,如果没有使用html()方法的话,是显示不出来的,我们直接看例子(我是在tp框架的里面写的) &l ...

  8. document.write('<script type=\"text/javascript\"><\/script>')

    document.write('<script type=\"text/javascript\"><\/script>')

  9. <script type="text/html"></script> js模版使用

    <div></div> <script type="text/html" id="javascript_template"> ...

随机推荐

  1. YTU 2441: C++习题 复数类--重载运算符2+

    2441: C++习题 复数类--重载运算符2+ 时间限制: 1 Sec  内存限制: 128 MB 提交: 847  解决: 618 题目描述 定义一个复数类Complex,重载运算符"+ ...

  2. eclipse svn修改用户名密码

    1,svn客户端删除 2,eclipse 补充,上图为网友资料,但实际操作过程中,发现eclipse中svn为svnkit,但相应目录下无.keyring文件,最后按步骤2删除auth下所有文件,再次 ...

  3. Ural 2003: Simple Magic(数论&思维)

    Do you think that magic is simple? That some hand-waving and muttering incomprehensible blubber is e ...

  4. 字符设备驱动另一种写法—mmap方法操作LED

    最近在看韦老师的视频,讲解了很多种字符设备的驱动写法.经过自己的研究之后,我发现还有另外一种写法,直接在应用层操作,省去了内核中的地址映射部分,使得用户可以在应用层直接操作LED.        mm ...

  5. UI:单例的写法

    单例设计模式 参考 UIApplication sharedApplocation 详细解释 :参考 通讯录的helper 类的读取本地plist 文件的时候,使用的单例单例的要点有三个:一个类只能有 ...

  6. js函数定义 参数只要写名称就可以了

    js函数定义  参数只要写名称就可以了 以下为标准: function add(type)  { } 不要写成下面这个样子 function add(var type)  { } 哎 妹的  老何ja ...

  7. HDU5996:dingyeye loves stone

    题目链接:dingyeye loves stone 题意:给出一棵树,树上的每个节点都有石子若干, 两人博弈,每次操作都可以把任意节点的任意石子数转移到它的父亲节点, 若无法操作则输,给出树上的节点及 ...

  8. typedef struct和struct 的区别 用途

    刚刚想到的,我们在用结构体的时候会遇到'->'和'.',这是什么情况呢? 不能混用的(c和c++不同语言对它们没有影响)   我说的不能混用的意思是'.'用于结构体指针的指向......而'-& ...

  9. python_pdb断点调试常用命令

    Python pdb调试 在需要断点调试的地方,加上:import pdb;pdb.set_trace() h:打印当前版本pdb可用的命令,如果需要查询某个命令,可以输入 h [command]l: ...

  10. 深入理解Android

    http://blog.csdn.net/innost/article/details/47254381