2012-04-21 39 views

回答

16
(function ($) { 
    'use strict'; 
    $(document).ready(function() { 
     console.log('working!') 
    }) 
} (jQuery)) 
0

你加的jQuery到您的網站?

在tinker.io上嘗試相同的代碼會產生錯誤,但隨後添加jQuery庫並且錯誤消失。

CDN:http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js

通過使用這個片段

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> 
相關問題