如何在html导入js_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 12:13:48
Original
1084 people have browsed it

如题,我想在我自己做的html中导入文件夹里面所有的js(回到顶部回到底部特效)不知道怎么导入呢?菜鸟啊、。。还没试过。求指点


回复讨论(解决方案)

<script></script>
<script></script>

只能一个个导入吗?不可以将整个文件夹导入么。哎感觉好麻烦呵呵,我去试试。

这个不用js的,用就可以了。
还方便对吧。
就是a的书签功能。
每天回帖即可获得10分可用分!

<script></script>
<script></script>

貌似就这种方法了啊,一个个导入

不会谷歌?

百度也不错

<script></script>
一个一个导入


只能一个个导入!

貌似只能一个一个导入

可以引用一个js,在这个js文件中,用jquery的getScript方法依次导入,但前提是你得有办法能遍历到文件名。

http://api.jquery.com/jQuery.getScript/

锚点多简单啊。

只能一个个导入!

是这样滴!

可以动态无阻塞加载js

			loadJS().load({				url: [					'1.js',					'2.js'					....				],				callback: function(){					...				}			})
Copy after login

额。。我去试过了。我下载了别人做好的js我导入呵呵,还是不行。
我的html文件叫xing.html
我下载了别人做好的内容大概有jquery.js     lanrentuku.js   xixi.css和一张图片

可把多个js引用另写到以js文件里如:
all.js文件里包括
<script></script>
<script></script>
<script></script> 
<script></script>

最后引用 all.js  其实这和一个个导入是一样的 不过这样看起来页面不显臃肿!!!

<script></script> 这样是最标准的

可以专门写个html,将所有js写入。以后直接引用这个就好了。。

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!