如果擷取迴圈內的值解決辦法

來源:互聯網
上載者:User
如果擷取迴圈內的值
問題:如何在需要彈出的DIV中顯示、迴圈中的值呢?

比如我$records 數組中還有$records["qq"] 如何當使用者點擊這個tr的時候、自動將這個tr裡$records["qq"]的值傳到彈出的div裡面
JScript code
function popUserDetail(x){    var popUp = document.getElementById("popUserDetail");  var h = (x.rowIndex)*20;        popUp.style.top= 25 + h + "px";        popUp.style.left="142px";        popUp.style.width="200px";        popUp.style.height="100px";        popUp.style.visibility="visible";            }


PHP code
         while ($records = mysql_fetch_array($rows))               {                   $arr = ct($records['uniqueid']);                  $fileLastUploadTime  = $arr[1];                    print       '                         '.st($records['lastT'],$fileLastUploadTime).'                          '.$records['barName'].'                          '.$records['lastLogin'].'                          '.date("Y-m-d H:i:s",$arr[1]).'                          '.$records['endTM'].'                          '.$arr[0].'                          '.$records['version'].'                          ';                  }  print                  '                    d                          
客戶編碼:
初次登陸:
客戶地址:
聯絡QQ:
';print ' 首頁| 上一頁| 下一頁| 尾頁
'.$total.'條記錄 當前第'.$pageId.'頁 共'.$pageCount.'頁 ';




------解決方案--------------------
print '
設一個id
print '...聯絡QQ:';

然後Js函數裡
function popUserDetail(x, qq){
var popUp = document.getElementById("popUserDetail");
var h = (x.rowIndex)*20;
popUp.getElementById('qq').innerText = qq;
popUp.style.top= 25 + h + "px";
popUp.style.left="142px";
popUp.style.width="200px";
popUp.style.height="100px";
popUp.style.visibility="visible";
}

是這個意思?還是我曲解你的想法了
------解決方案--------------------
  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.