<a href="javascript:void(0)" onclick="locationUrl()">点击 自动加链接</a> function locationUrl(){ var url = '***'; window.location.href = url; //easyUI <script> //选中行的值 function getSelected(){ var row = $('#tt').datagrid('getSelected'); if (row){ alert('Item ID:'+row.itemid+" Price:"+row.listprice); } } //所有行的值 function getSelections(){ var ids = []; var rows = $('#tt').datagrid('getSelections'); //#tt table 下的id for(var i=0; i<rows.length; i++){ ids.push(rows[i].itemid); } alert(ids.join(' ')); } </script> <a href="#" onclick="getSelected()">GetSelected</a> <a href="#" onclick="getSelections()">GetSelections</a>