您的位置:首页 > 产品设计 > UI/UE

easyUI引用必要的css,js文件示例 基础(三)--cdn

2017-07-28 10:51 519 查看
easyUI中CDN

1.
easyui中的调用(css、js文件的调用)-----CDN的引用
这个就像你在用jquery库的时候类似都要调用里边一些必要的js等的库文件(现成已经编辑好的,你直接使用就好)

(1)easyUI调用网络上现成的的文件
```
<link rel="stylesheet" type="text/css" href="http://www.w3cschool.cc/try/jeasyui/themes/default/easyui.css"> <link rel="stylesheet" type="text/css" href="http://www.w3cschool.cc/try/jeasyui/themes/icon.css">
<link rel="stylesheet" type="text/css" href="http://www.w3cschool.cc/try/jeasyui/demo/demo.css"> <script type="text/javascript" src="http://code.jquery.com/jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="http://www.w3cschool.cc/try/jeasyui/jquery.easyui.min.js"></script>

这是其中的一种示例调用w3C里边的,也可以调用其他的例如:
```

<link
rel="stylesheet" type="text/css" href="http://www.jeasyui.net/Public/js/easyui/themes/default/easyui.css">

<link rel="stylesheet" type="text/css" href="http://www.jeasyui.net/Public/js/easyui/themes/icon.css"><script
type="text/javascript" src="http://code.jquery.com/jquery-1.6.1.min.js"></script><script
type="text/javascript" src="http://www.jeasyui.net/Public/js/easyui/jquery.easyui.min.js"></script>```

也可以使用这个(根据自己的需求灵活选择变动)
```

<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css"
/><script src="http://code.jquery.com/jquery-1.9.1.js"></script><script
src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script><link
rel="stylesheet" href="http://jqueryui.com/resources/demos/style.css" />```

(2)本地上的调用

第一步先下载官网上的现成easyUI的文档解压后打开如下:



第二步:导入到你的项目

我用的是myeclipse工具,你也可以根据自己用的工具灵活套用一下思路类似;

先把jquery-easyui-1.5.2的包导入到项目中;

第三部的就是像第一步中的引用(一些必备的包):
```

<link
href="../easyui1.5.2/theme/default/easyui.css" rel="stylesheet" type="text/css" />

<link

href="../easyui1.5.2/theme/icon.css"

rel="stylesheet"

type="text/css"

/>

<link

rel="stylesheet"

href="../easyui1.5.2/themes/metro/datagrid.css"

type="text/css"></link>

<script

type="text/javascript"

src="../easyui1.5.2/jquery.easyui.min.js"></script>

<script

type="text/javascript"

src="../jquery-3.1.1/jquery-3.1.1.min.js"></script>

<script

type="text/javascript"

src="../easyui1.5.2/plugins/jquery.pagination.js"></script>```

注意:要找到文件的位置 ,src=“”这个路径一定要写正确,不然调用失败的。我用的myeclipse的话可以直接找到 包的位置直接点击拉取到你想用的html文件中就可以(自动把引入文档写好)。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  easyUI