jQuery-jqprint.js打印插件使用高版本jQuery時問題


使用jqprint打印插件的網頁demo代碼:
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>jQuery打印插件jqprint</title>
<!-- <script language="javascript" src="jquery-1.4.4.min.js"></script> -->
<!--
如果您使用的是高版本jQuery調用下面jQuery遷移輔助插件即可
<script src="http://www.jq22.com/jquery/jquery-migrate-1.2.1.min.js"></script>;
三個插件的順序:jquery.1.9.1.min.js->jquery.jqprint-0.3.js->jquery-migrate-1.2.1.min.js
    <script type="text/javascript"
    src="/Shared_Parking_Space/bootstrap/js/jquery.1.9.1.min.js"></script>
<script language="javascript"
    src="/Shared_Parking_Space/js/jquery.jqprint-0.3.js"></script>
<script src="http://www.jq22.com/jquery/jquery-migrate-1.2.1.min.js"></script>;
-->
<script language="javascript" src="jquery.1.9.1.min.js"></script>
<script language="javascript" src="jquery.jqprint-0.3.js"></script>
<script src="http://www.jq22.com/jquery/jquery-migrate-1.2.1.min.js";></script>
<script language="javascript">
    function aa() {
         $("#ddd").jqprint();
    }
</script>
</head>
 
<body>
    <div id="ddd">
         <table>
             <tr>
                 <td>test</td>
             </tr>
         </table>
    </div>
    <input type="button" onclick="aa()" value="打印" />
</body>
</html>

  

使用此插件時,需要注意兩個插件的引用順序,官網是這樣給出的:
<script language="javascript" src="jquery-1.4.4.min.js"></script>
<script language="javascript" src="jquery.jqprint-0.3.js"></script>
在使用jQuery更高版本時,
如果您使用的是高版本jQuery調用下面jQuery遷移輔助插件即可,要使用這個插件,需要電腦能聯網,
如果不是需要網頁一開始就加載一個js的話,把js鏈接放在網頁最下面,能夠提高網頁的加載速度。
另外下載了相關js的離線版本,可以不用聯網使用(復制下面地址到下載器,即可下載相關js文件)。

https://files.cnblogs.com/files/diyunfei/jquery-migrate-1.4.1.min.js

https://files.cnblogs.com/files/diyunfei/jquery-migrate-1.2.1.min.js

https://files.cnblogs.com/files/diyunfei/jquery-1.4.4.min.js

https://files.cnblogs.com/files/diyunfei/jquery.jqprint-0.3.js

https://files.cnblogs.com/files/diyunfei/jquery.1.9.1.min.js

 
jQuery Migrate Plugin介紹,可以打開下面這個網址:

jQuery Migrate Plugin

We have created the  jQuery Migrate plugin to simplify the transition from older versions of jQuery. The plugin restores deprecated features and behaviors so that older code will still run properly on newer versions of jQuery. Use the uncompressed development version to diagnose compatibility issues, it will generate warnings on the console that you can use to identify and fix problems. Use the compressed productionversion to simply fix compatibility issues without generating console warnings.
There are two versions of Migrate. The first will help you update your pre-1.9 jQuery code to jQuery 1.9 up to 3.0. You can get that version here:
The second version helps you update code to run on jQuery 3.0 or higher, once you have used Migrate 1.x and upgraded to jQuery 1.9 or higher:
 

jQuery Migrate 1.2.1 Released相關

They say there are no second acts in software … well, there are always second acts in software. Especially when the first act bombs. With that in mind, version 1.2.1 of the jQuery Migrate plugin has arrived. It can be used with either jQuery 1.9 or jQuery 2.0.
You can find this latest version of the jQuery Migrate plugin on jQuery’s CDN:


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM