Can't find variable: $
问题 var scriptFile = $(tempNode).attr("customJScriptSrc"); When passing this i get “Reference Error: Can’t find variable: $” Kindly suggest me any alternative methods. 回答1: add this script: <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> at top of the document(added before your javascript code). or download the library and reference it in you code. 回答2: I had this same problem and it was caused by me putting my .js file before the jQuery .js file in the DOM