object(mysqli_result)#13 (5) {
["current_field"]=>
int(0)
["field_count"]=>
int(25)
["lengths"]=>
NULL
["num_rows"]=>
int(1)
["type"]=>
int(0)
}
jQuery.noConflict() - 程序員論壇 - Powered by Discuz!
程序員論壇
標題: jQuery.noConflict() [打印本頁]
作者: GreenCup 時間: 2020-2-27 11:42
標題: jQuery.noConflict()
Many JavaScript libraries use $ as a function or variable name, just as jQuery does. In jQuery's case, $ is just an alias for jQuery, so all functionality is available without using $. If you need to use another JavaScript library alongside jQuery, return control of $ back to the other library with a call to $.noConflict(). Old references of $ are saved during jQuery initialization; noConflict() simply restores them.
就像jQuery一樣,許多JavaScript庫都將$用作函數或變量名。 在jQuery的情況下,$只是jQuery的別名,因此無需使用$即可使用所有功能。 如果您需要在jQuery旁邊使用另一個JavaScript庫,請通過調用$ .noConflict()將$的控制權返回到另一個庫。 $的舊引用在jQuery初始化期間保存; noConflict()只是還原它們。- <script src="other_lib.js"></script>
- <script src="jquery.js"></script>
- <script>
- $.noConflict();
- // Code that uses other library's $ can follow here.
- </script>
複製代碼- <script src="other_lib.js"></script>
- <script src="jquery.js"></script>
- <script>
- $.noConflict();
- jQuery( document ).ready(function( $ ) {
- // Code that uses jQuery's $ can follow here.
- });
- // Code that uses other library's $ can follow here.
- </script>
複製代碼- jQuery.noConflict();
- // Do something with jQuery
- jQuery( "div p" ).hide();
- // Do something with another library's $()
- $( "content" ).style.display = "none";
複製代碼- jQuery.noConflict();
- (function( $ ) {
- $(function() {
- // More code using $ as alias to jQuery
- });
- })(jQuery);
複製代碼
歡迎光臨 程序員論壇 (http://program.thesmartfire.com/) |
Powered by Discuz! X2.5 |