$(document).ready(function() {
var mystring="fusioncharts,om,bdutt";
var arr = mystring.split( , ); //array returned
for(var i = 0; i < arr.length; i++) {
alert(arr[i]);
}
}
上述法典是否可行?
EDIT-----
真正的法典是:
handle1 = getUrlVars();
if(handle1 == ) {
$("input#handle1").val( barackobama );
$("input#handle2").val( aplusk );
$("input#handle3").val( charliesheen );
handle1 = barackobama,aplusk,charliesheen ;
} else {
alert(handle1); // this says fusioncharts,om,bdutt
var queryvals = [];
queryvals = handle1.split( , );
alert( length +queryvals.length); // *** this says nothing ***
for(var i = 0; i < queryvals.length; i++) {
alert(queryvals[i]); // *** nothing here too.. ****
}
}
整块都在(文件)面。
我无法发现一些简单的错误。