簡體   English   中英

jQuery占位符插件'jQuery未定義'

[英]jquery placeholder plugin 'jQuery is not defined'

由於jQuery占位符腳本,我在此頁面上遇到問題,導致Chrome和IE中出現“未定義jQuery”錯誤。

  • jQuery在插件腳本之前聲明。
  • 據我所知,與$沒有沖突

我真的很沮喪,任何建議都很好。 干杯

問題來自http://www.environment.nsw.gov.au/js/decc/ignitionSuite.js ,它在iframe中動態包含jQuery和jquery.placeholder:

jqPath = "http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"
jqPlaceholderPath = "http://www.environment.nsw.gov.au/js/decc/jquery.placeholder.min.js"
...
loadjscssfile(jqPath, "js");
...
loadjscssfile(jqPlaceholderPath, "js");

由於腳本是動態包含的,因此在第一個腳本加載之前,不需要瀏覽器阻止執行。 這意味着jquery.placeholder完全有可能在jQuery之前首先加載,並且發生錯誤。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM