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

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文件中就可以(自動把引入文檔寫好)。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章