主题 : 其他页面有JS错误
级别: 解元
UID: 24205
积分:314 加为好友
威望: 0 精华: 0
主题:31 回复:93
注册时间:2011-10-07
在线时长:0
1#   发表于:2011-11-02 09:41:52  IP:220.31.*.*
怎样弄啊
级别: 总版主
UID: 10736
积分:149787 加为好友
威望: 212 精华: 42
主题:297 回复:127674
注册时间:2010-09-08
在线时长:90.1
2#   发表于:2011-11-02 09:44:21  IP:59.114.*.*
您是哪个页面,看看标签调到了属性没
路漫漫其修远兮,吾将上下而求索!
级别: 解元
UID: 24205
积分:314 加为好友
威望: 0 精华: 0
主题:31 回复:93
注册时间:2011-10-07
在线时长:0
3#   发表于:2011-11-02 10:46:59  IP:220.31.*.*
就是首页随便点击一个新闻后跳转的页面
级别: 总版主
UID: 10736
积分:149787 加为好友
威望: 212 精华: 42
主题:297 回复:127674
注册时间:2010-09-08
在线时长:90.1
4#   发表于:2011-11-02 10:52:55  IP:59.114.*.*
那您看看新闻内容页模版,报错位置
路漫漫其修远兮,吾将上下而求索!
级别: 解元
UID: 24205
积分:314 加为好友
威望: 0 精华: 0
主题:31 回复:93
注册时间:2011-10-07
在线时长:0
5#   发表于:2011-11-02 11:17:19  IP:220.31.*.*
从这个action方法跳到广告版位.html
@RequestMapping(value = "/adspace.jspx")
public String adspace(Integer id, HttpServletRequest request,
HttpServletResponse response, ModelMap model) {
CmsSite site = CmsUtils.getSite(request);
if (id != null) {
CmsAdvertisingSpace adspace = cmsAdvertisingSpaceMng.findById(id);
List<CmsAdvertising> adList = cmsAdvertisingMng.getList(id, true);
model.addAttribute("adspace", adspace);
model.addAttribute("adList", adList);
}
FrontUtils.frontData(request, model, site);
System.out.println(request.getAttribute("adList"));
return FrontUtils.getTplPath(request, site.getSolutionPath(),
TPLDIR_CSI, TPL_ADSPACE);
}



页面的sHtml为空或不是对象
[#if adspace?? && adspace.enabled] (function() { var Ad =
function(iId,sHtml,fCode,dStart,dEnd,iWeight) { this.iId = iId;
this.sHtml = sHtml; this.fCode = fCode; this.dStart = dStart; this.dEnd
= dEnd; this.iWeight = iWeight; } var ads = new Array(${adList?size});
var adsLen = 0; [#list adList as ad] [#if ad.category=="image"] [#assign
html]
<a href="${(ad.attr.image_link)!}" target="${ad.attr.image_target!}"
title="${(ad.attr.image_title)!}"
onclick="$.get('${base}/ad_click.jspx?id=${ad.id}');"> <img
src="${ad.attr.image_url}" border="0"
[#if (ad.attr.image_width)??] width="${ad.attr.image_width}"
[/#if][#if (ad.attr.image_height)??] height="${ad.attr.image_height}" [/#if]/>
</a>
[/#assign] ads[adsLen++] = new Ad(${ad.id},"${html?js_string}",null,
[#if ad.startTimeMillis??]new
Date(${ad.startTimeMillis})[#else]null[/#if], [#if
ad.endTimeMillis??]new Date(${ad.endTimeMillis})[#else]null[/#if],
${ad.weight}); [#elseif ad.category=="flash"] [#assign html]
<embed type="application/x-shockwave-flash"
pluginspage="http://www.macromedia.com/go/getflashplayer" play="true"
loop="true" menu="true" src="${(ad.attr.flash_url)!}" [#if
ad.attr.flash_width?? && ad.attr.flash_width!=""
] width="${ad.attr.flash_width}" [/#if][#if
ad.attr.flash_height?? && ad.attr.flash_height!=""
] height="${ad.attr.flash_height}"[/#if]></embed>
[/#assign] ads[adsLen++] = new Ad(${ad.id},"${html?js_string}",null,
[#if ad.startTimeMillis??]new
Date(${ad.startTimeMillis})[#else]null[/#if], [#if
ad.endTimeMillis??]new Date(${ad.endTimeMillis})[#else]null[/#if],
${ad.weight}); [#elseif ad.category=="text"] [#assign html]
<a href="${(ad.attr.text_link)!}" target="${(ad.attr.text_target)!}"
onclick="$.get('${base}/ad_click.jspx?id=${ad.id}');"> <span
style="if (ad.attr.text_color)??]color: ${ ad . attr . text_color">${(ad.attr.text_title)!}</span>
</a>
[/#assign] ads[adsLen++] = new Ad(${ad.id},"${html?js_string}",null,
[#if ad.startTimeMillis??]new
Date(${ad.startTimeMillis})[#else]null[/#if], [#if
ad.endTimeMillis??]new Date(${ad.endTimeMillis})[#else]null[/#if],
${ad.weight}); [#elseif ad.category=="code"] ads[adsLen++] = new
Ad(${ad.id},null,function(){${ad.code!}}, [#if ad.startTimeMillis??]new
Date(${ad.startTimeMillis})[#else]null[/#if], [#if
ad.endTimeMillis??]new Date(${ad.endTimeMillis})[#else]null[/#if],
${ad.weight}); [#else] document.write("未知的广告类型:${ad.category!}"); [/#if]
[/#list] var indexArr = new Array(); var now = new Date(); for(var
i=0,j=0,len=ads.length;i
<len ;i++){
if((!ads[i].dStart || now>
ads[i].dStart) && (!ads[i].dEnd || now
<ads [i].dEnd)) {
for(var max=j+ads[i].iWeight;j
<max ;j++) {
indexArr[j] =i; }
}
}

var
rand=parseInt(Math.random() * indexArr.length);
var
show=ads[indexArr[rand]];
if(show.sHtml) {
document.write(show.sHtml);
} else {
show.fCode();
}
$.get("${base}/ad_display.jspx?id="+show.iId);})();
[#else]
广告版位不存在
[/#if]
级别: 总版主
UID: 10736
积分:149787 加为好友
威望: 212 精华: 42
主题:297 回复:127674
注册时间:2010-09-08
在线时长:90.1
6#   发表于:2011-11-02 11:21:19  IP:59.114.*.*
广告版位的ID不正确吗?
路漫漫其修远兮,吾将上下而求索!
级别: 解元
UID: 24205
积分:314 加为好友
威望: 0 精华: 0
主题:31 回复:93
注册时间:2011-10-07
在线时长:0
7#   发表于:2011-11-02 11:49:53  IP:220.31.*.*
这是贴出来的相关代码,不是错误信息,能不能知道是什么原因导致js错误
好像就这里
var Ad = function(iId,sHtml,fCode,dStart,dEnd,iWeight) {
                     this.sHtml= sHtml;
this.iId = iId;
this.fCode = fCode;
this.dStart = dStart;
this.dEnd = dEnd;
this.iWeight = iWeight;
}
级别: 总版主
UID: 10736
积分:149787 加为好友
威望: 212 精华: 42
主题:297 回复:127674
注册时间:2010-09-08
在线时长:90.1
8#   发表于:2011-11-02 11:54:52  IP:59.114.*.*
修改过什么属性么,还是默认模版就是有js错误的?
路漫漫其修远兮,吾将上下而求索!
1 共1页