要请教一个 JS 调用的问题
<!DOCTYPEhtml><html><body><scriptsrc="123.js"></script><scripttype="text/javascript">...
<!DOCTYPE html>
<html>
<body>
<script src="123.js"></script>
<script type="text/javascript">
var aa=simplify("12345&25846");
document.write(aa);
</script>
</body>
这下面是123.js
function simplify(codes) {
var items = codes.split("&");
var result = quickSort(items, 0, items.length - 1);
var bets = [];
var index = -1;
var exist = false;
var frist = result[0];
var begin = result[0];
var end;
for (var i = 0; i < result.length; i++) {
index++;
end = result[i];
if (parseInt(result[i]) + 1 == parseInt(result[i + 1])) {
continue
}
exist = true;
bets.push(begin);
bets.push(index);
begin = result[i + 1];
index = -1
}
if (false == exist) {
bets.push(begin + "-" + index)
}
var data = Array.prototype.map.call(bets.join(),
function(c) {
return c.charCodeAt(0)
});
return compress(bets.join())
}
http://pan.baidu.com/s/1pKE4Pbt
这里就是 可以帮我看看吗 展开
<html>
<body>
<script src="123.js"></script>
<script type="text/javascript">
var aa=simplify("12345&25846");
document.write(aa);
</script>
</body>
这下面是123.js
function simplify(codes) {
var items = codes.split("&");
var result = quickSort(items, 0, items.length - 1);
var bets = [];
var index = -1;
var exist = false;
var frist = result[0];
var begin = result[0];
var end;
for (var i = 0; i < result.length; i++) {
index++;
end = result[i];
if (parseInt(result[i]) + 1 == parseInt(result[i + 1])) {
continue
}
exist = true;
bets.push(begin);
bets.push(index);
begin = result[i + 1];
index = -1
}
if (false == exist) {
bets.push(begin + "-" + index)
}
var data = Array.prototype.map.call(bets.join(),
function(c) {
return c.charCodeAt(0)
});
return compress(bets.join())
}
http://pan.baidu.com/s/1pKE4Pbt
这里就是 可以帮我看看吗 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询