首页 > Web开发 > 详细

html中资源文件共享

时间:2015-07-09 02:17:35      阅读:297      评论:0      收藏:0      [点我收藏+]

我在一个html中写入项目中其他页面需要共同引用的资源文件,然后将这个html分别引入其他需要这些资源文件的html。可是,效果出不来,要报错。

source_yun.html的完整代码如下:

<script src="../yun_sour/jquery/jquery-1.11.2.js"></script>
<script src="../yun_sour/jquery/jquery.validate.min.js"></script>
<script src="../yun_sour/jquery/additional-methods.min.js"></script>

?引用source_yun.html的页面test.html的完整代码如下:

test.html:

<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>test</title>
    <object data="source_yun.html"></object>
</head>
<body>
<input type="text" class="text" value="yun lian">
</body>
</html>
<script>
    $(document).ready(function(){
        alert($(".text").val());
    });
</script>

?打开网页运行,会提示$ is not defined。意思就是,source_yun.html中的资源文件,没有成功引入test.html中。

有没有人知道,要怎么引入才行???

html中资源文件共享

原文:http://yunlian0621.iteye.com/blog/2225337

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!