在javascript中,怎么中<%=listjsp.get(i)%>转换成字符串
<%List<String>list=(List<String>)request.getAttribute("list");List<String>listjsp=(Li...
<%
List<String> list = (List<String>) request.getAttribute("list");
List<String> listjsp = (List<String>) request
.getAttribute("listjsp");
%>
//button按钮的上一页、下一页
function getButtonHref(actionType , localHref)
{
var targetURL = "";
var targetArray = new Array();
alert(localHref);
<%
for (int i = 0; i < list.size(); i++) {
%>
var ss = localHref.replace(<%=listjsp.get(i)%> , localHref.substring(localHref.lastIndexOf('/') + 1,localHref.indexOf('?'));
targetArray.push(ss);
<%
}
%>
for(var i = 0 ; i < targetArray.length ; i++)
{
alert(targetArray[i]);
}
$("div[align='top'] a").each(function(i){
var target = $(this).attr("href");
var localHrefTemp = localHref.substring(localHref.lastIndexOf('/') + 1,localHref.indexOf('?'));
target = target.substring(target.lastIndexOf('/') + 1,target.indexOf('?'));
if(target.indexOf(localHrefTemp) != -1)
{
if(i > 0 && "PrevPage" == actionType)
{
targetURL = targetArray[i-1];
}else if(i < $(this).length && "NextPage" == actionType){
targetURL = targetArray[i+1];
}else{
alert("跳转错误");
}
<%=listjsp.get(i)%>告诉我不是字符串的类型,我加上"也不好使",请问怎么解决啊,谢谢
}
});
return targetURL;
} 展开
List<String> list = (List<String>) request.getAttribute("list");
List<String> listjsp = (List<String>) request
.getAttribute("listjsp");
%>
//button按钮的上一页、下一页
function getButtonHref(actionType , localHref)
{
var targetURL = "";
var targetArray = new Array();
alert(localHref);
<%
for (int i = 0; i < list.size(); i++) {
%>
var ss = localHref.replace(<%=listjsp.get(i)%> , localHref.substring(localHref.lastIndexOf('/') + 1,localHref.indexOf('?'));
targetArray.push(ss);
<%
}
%>
for(var i = 0 ; i < targetArray.length ; i++)
{
alert(targetArray[i]);
}
$("div[align='top'] a").each(function(i){
var target = $(this).attr("href");
var localHrefTemp = localHref.substring(localHref.lastIndexOf('/') + 1,localHref.indexOf('?'));
target = target.substring(target.lastIndexOf('/') + 1,target.indexOf('?'));
if(target.indexOf(localHrefTemp) != -1)
{
if(i > 0 && "PrevPage" == actionType)
{
targetURL = targetArray[i-1];
}else if(i < $(this).length && "NextPage" == actionType){
targetURL = targetArray[i+1];
}else{
alert("跳转错误");
}
<%=listjsp.get(i)%>告诉我不是字符串的类型,我加上"也不好使",请问怎么解决啊,谢谢
}
});
return targetURL;
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询