I'm in the process of changing a few of my shop sections from multi product page layouts to single product pages but on the new single product pages I am getting an error that says "A Javascript error has been found on the page ('Syntax error')."
I've managed to trace this back to the code in my "Javascript Product Stock Query" layout which is as follows:-
It seems to be the 3rd line down that causes the error, the one that reads:-
as when I remove this line I do not get an error.
So my question is, Is my code correct or have I somehow managed to get this spurious line of code added somewhere along the way?
If my code is correct does anyone else get this error message, or, if it's incorrect could someone please let me know the correct code.
Thanks.
Garry.
I've managed to trace this back to the code in my "Javascript Product Stock Query" layout which is as follows:-
Code:
<actinic:block if="%3cactinic%3avariable%20name%3d%22RealTimeStockEnabled%22%20%2f%3e%20%26%26%20%3cactinic%3avariable%20name%3d%22DisplayRealStockLevel%22%20%2f%3e" > <script language="javascript" type="text/javascript"> var nAssocProdRefSID = '<actinic:block type="ComponentList" ><actinic:variable name="ComponentCount" /></actinic:block>' ? <actinic:variable name="SectionID" /> : 0; function displayStock() { var sProdRefs = ""; var sStockList = ""; <actinic:block if="%3cactinic%3avariable%20name%3d%22IsPreviewMode%22%20%2f%3e" > sProdRefs = "<actinic:variable name="RTSProductsInThisSection" selectable="false" />"; sStockList = "<actinic:variable name="RTSStocksInThisSection" selectable="false" />"; getProductStock('<actinic:variable name="StockScriptCGIURL" selectable="false" />', sProdRefs, sStockList, ''); </actinic:block> <actinic:block if="%3cactinic%3avariable%20name%3d%22IsHostMode%22%20%2f%3e%20%26%26%20%21%3cactinic%3avariable%20name%3d%22IsPreviewMode%22%20%2f%3e" > getProductStock('<actinic:variable name="StockScriptCGIURL" selectable="false" />', '<actinic:variable name="ProductReference" />', sStockList, '<actinic:variable name="ShopID" selectable="false" />'); </actinic:block> <actinic:block if="%21%3cactinic%3avariable%20name%3d%22IsHostMode%22%20%2f%3e%20%26%26%20%21%3cactinic%3avariable%20name%3d%22IsPreviewMode%22%20%2f%3e" > getProductStock('<actinic:variable name="StockScriptCGIURL" selectable="false" />', '<actinic:variable name="ProductReference" />', sStockList, ''); </actinic:block> } AttachEvent(window, "load", displayStock); </script> </actinic:block>
Code:
var nAssocProdRefSID = '<actinic:block type="ComponentList" ><actinic:variable name="ComponentCount" /></actinic:block>' ? <actinic:variable name="SectionID" /> : 0;
So my question is, Is my code correct or have I somehow managed to get this spurious line of code added somewhere along the way?
If my code is correct does anyone else get this error message, or, if it's incorrect could someone please let me know the correct code.
Thanks.
Garry.
Comment