2012-08-23 69 views

回答

0

它爲我工作。我所要做的就是創建分組視圖並將網址放入代碼中。芹苴我用引號

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> 

<script type="text/javascript"> 
$(document).ready(function(){ 

////////// 
// you will need to change this URL 
var url = "http://sppos/Lists/Statistics/Grouped.aspx"; 
////////// 

var groupings = []; 

$.get(url, function(data) { 
$(data).find("tbody[id^=titl][groupString] > tr > td").each(

function(index, value){ 
groupings.push($(this).text()); 
} 
); 

$("#placeholder").append("<ul></ul>"); 

$.each(groupings, function(index, value){ 

$("#placeholder ul").append("<li>" + value + "</li>") 
}); 
}); 
}); 

</script> 
<div id="placeholder"></div> 

測試後,沒有引號也不行,這可能是一些悲傷的原因