我有点问题。我的网站上有大量的JavaScript,当我尝试合并它时,我突然无法选择一个选项。
Google Chrome中的控制台显示:
未捕获的TypeError:undefined不是函数 代码只是很长
未捕获的TypeError:无法读取未定义的属性“OptionsPrice”
<script>
var optionsPrice = new Product.OptionsPrice({"productId":"224","priceFormat":{"pattern":"%s\u00a0DKK ","precision":2,"requiredPrecision":2,"decimalSymbol":",","groupSymbol":".","groupLength":3,"integerRequired":1},"includeTax":"true","showIncludeTax":true,"showBothPrices":false,"productPrice":29,"productOldPrice":29,"priceInclTax":29,"priceExclTax":29,"skipCalculate":1,"defaultTax":25,"currentTax":25,"idSuffix":"_clone","oldPlusDisposition":0,"plusDisposition":0,"plusDispositionTax":0,"oldMinusDisposition":0,"minusDisposition":0,"tierPrices":[],"tierPricesInclTax":[]});
</script>
未捕获的TypeError:无法读取未定义的属性'Config'
<script>
var spConfig = new Product.Config({"attributes":{"145":{"id":"145","code":"size","label":"St\u00f8rrelse","options":[{"id":"32","label":"10ml","price":"0","oldPrice":"0","products":["225","226","227","228"]},{"id":"31","label":"30ml","price":"30","oldPrice":"30","products":["229","230","231","232"]}]},"146":{"id":"146","code":"styrke","label":"Styrke","options":[{"id":"36","label":"0mg","price":"0","oldPrice":"0","products":["225","229"]},{"id":"35","label":"6mg","price":"0","oldPrice":"0","products":["226","230"]},{"id":"34","label":"12mg","price":"0","oldPrice":"0","products":["227","231"]},{"id":"33","label":"18mg","price":"0","oldPrice":"0","products":["228","232"]}]}},"template":"#{price}\u00a0DKK ","basePrice":"29","oldPrice":"29","productId":"224","chooseText":"--V\u00e6lg venligst--","taxConfig":{"includeTax":true,"showIncludeTax":true,"showBothPrices":false,"defaultTax":25,"currentTax":25,"inclTaxTitle":"Inkl. moms"}});
</script>
未捕获参考错误:未定义日历
Calendar._DN = ["s\u00f8ndag","mandag","tirsdag","onsdag","torsdag","fredag","l\u00f8rdag"]; // full day names
我希望有些人可以帮助我。 我在Magento平台上,使用自定义模板。
由于
答案 0 :(得分:0)
这听起来像是其中一个JS文件中的语法错误。在定义Product
的地方或第一次出错的地方。
有时您会错过逗号并且未定义整个对象。我会先找那个。
最简单的方法是使用JSLint。
答案 1 :(得分:0)
在哪里定义“产品”? 你应该首先在你的页面中有产品!或者它是否在闭包函数中定义?