-2
var myhtml= '<td class="dataCell"><table border="0" bordercolor="#FFFFFF" cellpadding="0" cellspacing="0" width="100%"><tbody><tr bgcolor="#FFFFFF"><td><div align="right">1.</div></td><td>Kabul Edildi - İZMİR(ÇAMDİBİ/ÇAMDİBİ)</td><td><div>04/02/2013 16:06:16</div></td></tr><tr><td><div align="right">2.</div></td><td>Torbaya Eklendi - İZMİR(ÇAMDİBİ/ÇAMDİBİ)</td><td><div>04/02/2013 16:09:33</div></td></tr><tr bgcolor="#FFFFFF"><td><div align="right">3.</div></td><td>Gönderinin Geliş Kaydı Yapıldı - İZMİR(İZMİR K.İ.M/MERKEZ)</td><td><div>04/02/2013 18:01:35</div></td></tr><tr><td><div align="right">4.</div></td><td>Torbaya Eklendi - İZMİR(İZMİR K.İ.M/MERKEZ)</td><td><div>04/02/2013 18:52:15</div></td></tr><tr bgcolor="#FFFFFF"><td><div align="right">5.</div></td><td>Gönderinin Geliş Kaydı Yapıldı - AYDIN(AYDIN POS.DAG.VE TOP/AYDIN POS.DAG.VE TOP)</td><td><div>05/02/2013 02:22:20</div></td></tr><tr><td><div align="right">6.</div></td><td>Torbaya Eklendi - AYDIN(AYDIN POS.DAG.VE TOP/AYDIN POS.DAG.VE TOP)</td><td><div>05/02/2013 02:35:34</div></td></tr><tr bgcolor="#FFFFFF"><td><div align="right">7.</div></td><td>Gönderinin Geliş Kaydı Yapıldı - AYDIN(SÖKE/SÖKE)</td><td><div>05/02/2013 09:27:41</div></td></tr></tbody></table></td>';
$('#siptakip_1360003997').html($('.dataCell', myhtml)); // ->not work....
$('#siptakip_1360003997').html(jQuery(myhtml).find('.dataCell').html()); // ->not work....

为什么我的 Jquery 代码不起作用?我该如何解决?

4

1 回答 1

0

你想做什么??

这可能会有所帮助...

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="js/jquery.js"></script>
<script>
    $(function(){
        var myhtml= '<td class="dataCell"><table border="0" bordercolor="#FFFFFF" cellpadding="0" cellspacing="0" width="100%"><tbody><tr bgcolor="#FFFFFF"><td><div align="right">1.</div></td><td>Kabul Edildi - İZMİR(ÇAMDİBİ/ÇAMDİBİ)</td><td><div>04/02/2013 16:06:16</div></td></tr><tr><td><div align="right">2.</div></td><td>Torbaya Eklendi - İZMİR(ÇAMDİBİ/ÇAMDİBİ)</td><td><div>04/02/2013 16:09:33</div></td></tr><tr bgcolor="#FFFFFF"><td><div align="right">3.</div></td><td>Gönderinin Geliş Kaydı Yapıldı - İZMİR(İZMİR K.İ.M/MERKEZ)</td><td><div>04/02/2013 18:01:35</div></td></tr><tr><td><div align="right">4.</div></td><td>Torbaya Eklendi - İZMİR(İZMİR K.İ.M/MERKEZ)</td><td><div>04/02/2013 18:52:15</div></td></tr><tr bgcolor="#FFFFFF"><td><div align="right">5.</div></td><td>Gönderinin Geliş Kaydı Yapıldı - AYDIN(AYDIN POS.DAG.VE TOP/AYDIN POS.DAG.VE TOP)</td><td><div>05/02/2013 02:22:20</div></td></tr><tr><td><div align="right">6.</div></td><td>Torbaya Eklendi - AYDIN(AYDIN POS.DAG.VE TOP/AYDIN POS.DAG.VE TOP)</td><td><div>05/02/2013 02:35:34</div></td></tr><tr bgcolor="#FFFFFF"><td><div align="right">7.</div></td><td>Gönderinin Geliş Kaydı Yapıldı - AYDIN(SÖKE/SÖKE)</td><td><div>05/02/2013 09:27:41</div></td></tr></tbody></table></td>';
        $('#siptakip_1360003997').html(myhtml);
    });
</script>
<title>Untitled Document</title>
</head>

<body>

<table>
    <tr id="siptakip_1360003997"></tr>
</table>

</body>
</html>
于 2013-02-05T12:38:06.233 回答