我在asp.net的.aspx页面编写了代码,用于执行javascript函数。我收到两个错误,我无法解决它们。请帮我解决以下问题。
代码:
<asp:ImageButton ID="ImageButton2" runat="server"
ImageUrl="~/images/insert_to_shopping_cart.png" ToolTip="Add to basket"
onclick="addCookie(ShoppingCart,((System.Data.DataRowView)Container.DataItem)[2] , ((System.Data.DataRowView)Container.DataItem)[0],((System.Data.DataRowView)Container.DataItem)[3]);" />
功能:
function addCookie(name,value,prod_name,prod_price) {
var today=new Date();
var expires=expires*1000*3600*3;
var currentCookie=getCookie(name);
if(currentCookie==null){
document.cookie =name+'='+escape(value)+","+ escape(prod_name)+","+escape(prod_price)+((expires)? ';
expires='+new Date(today.getTime()+expires).toGMTString(): '');
} else {
document.cookie =name+'='+currentCookie+","+escape(value)+","+ escape(prod_name)+","+escape(prod_price)+ ((expires)?';
expires='+new Date(today.getTime()+ expires).toGMTString():'');
}
showdiv("Basket_body") __doPostBack('Basket1_UpdatePanel1','');
}
2个错误:
) expected
Invalid expression term ')'