我下载了一个主题,似乎遇到了一些麻烦。有问题的页面在这里 - http://pureearthsoaps.com/test.html
每个产品都是使用(如果我解释正确的话)Javascript 变量创建的。见下文:
1: {
name: 'Bar Soap',
scent: 'Cucumber & Oatmeal, Patchouli, Peppermint, Frankincense, Holiday, Coffee & Hazelnut, Apple, and more',
size: '1 bar',
price: '3.<span class="small">95</span>',
short_desc: 'An innovative and moisturizing way to keep shower time fun.',
desc: 'Since we all love being happy naked, why not keep it that way? Treat yourself to scrumptious skincare with Naked Bar, an innovative and moisturizing way to keep shower time fun.'},
我在这里输入信息,它对应于这里的代码:
__ += '<li id="wine-list-'+i+'">'+wines[i].name+',</li>';
full += '<div id="wine-info-'+i+'" class="wine-info transition-05"><h2>'+wines[i].name+'</h2><h4></h4>'+
'<div class="line"></div>'+
'<div class="price">$'+wines[i].price+'</div>'+
'<div class="lbl"><label>Scent:</label><span>'+wines[i].scent+'</span></div>'+
'<div class="lbl"><label>Size:</label><span>'+wines[i].size+'</span></div>'+
'<div class="img"></div>'+
'<div class="bottle-x"></div>'+
'<div class="desc">'+wines[i].desc+'</div>'+
'<div class="order">'+wines[i].order+'</div>'+
'</div>';
目前,显示在该产品页面上的“立即订购”按钮出现在每个产品上,但无法链接。上面“order”的div类是在一个程序员朋友的建议下添加的;它使按钮出现,但我们无法使其工作。我在第一个代码块的“desc”行下面添加了这个,但没有成功:
order: '<a onClick="location.href='http://google.com'" href="http://google.com"></a>'
所以……救命!我该如何进行这项工作?