You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

39 lines
1.0 KiB

  1. window.onload=function(){
  2. var url="./st-xm/Api/car_team_controll.php?method=getDriverCompanyList";
  3. console.log(url);
  4. $.getJSON(url,function(res_data){
  5. console.log(res_data);
  6. if(res_data['code']!="0"){alert(res_data['info']);return;}
  7. var driverCompanyList=res_data['driverCompanyList'];
  8. var HTML='';
  9. for (var i=0,m=driverCompanyList.length;i<m;i++) {
  10. var dict=driverCompanyList[i];
  11. HTML+='<li class="li_title" onclick="show_detail('+dict['res_id']+',\''+dict['res_name']+'\')">';
  12. HTML+='<span style="width:20%;">'+dict['res_name']+'</span>';
  13. var cur_href=window.location.href;
  14. cur_href=cur_href.replace('car_team_list.html','');
  15. HTML+='<span style="width:60%;margin-left:20px">'+cur_href+'car_team.html?res_id='+dict['res_id']+'&res_name='+dict['res_name']+'</span>';
  16. HTML+='</li>';
  17. }
  18. if(HTML){
  19. $('#all_ul').html(HTML);
  20. }else{
  21. $('#all_ul').html('');
  22. }
  23. })
  24. }
  25. function show_detail(res_id,res_name){
  26. var url="car_team.html?res_id="+res_id+"&res_name="+res_name;
  27. window.open(url);
  28. }