日期:2014-05-17  浏览次数:20555 次

请教问题:QQ在线状态 Jquery自定义图片
我的部份Jquery的代码如下:
document.writeln("<DIV id=\"qq_right\" style='RIGHT: 0px; OVERFLOW: visible; POSITION: absolute; TOP: 130px'>");
document.writeln("<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width='120'>" );
document.write('<tr><td><a href="javascript:close_float_left();void(0);" title="close"><IMG src="/img/ltq01.jpg" border=0></a></td></tr>');
document.writeln("<tr id=\"qqz_01\">");
document.writeln("<td>");
document.writeln("<table border='0' id='qqfaceid3' cellspacing='0' cellpadding='0'><tr><td>");

document.writeln("<script>var online= new Array();</script>");
document.writeln("<script src='http://webpresence.qq.com/getonline?Type=1&2532772751:'></script>");

if (online[0] == 1) { document.write("<tr><td><a target='_blank' href='http://wpa.qq.com/msgrd?v=3&uin=2532772751&site=qq&menu=yes'><img border='0' src='/img/ltq04.jpg' alt='onclick' title='onclick'></a></td></tr>") } else { document.write("<tr><td><a target='_blank' href='http://wpa.qq.com/msgrd?v=3&uin=2532772751&site=qq&menu=yes'><img border='0' src='/img/ltq04-a.jpg' alt='onclick' title='onclick'></a></td></tr>") };


document.writeln("</table>");
document.writeln("<\/td>");
document.writeln("<\/tr>");
document.writeln("<\/tr>");
document.writeln("<\/table>");
document.writeln("<\/div>");


我中断执行的时候 online[0]根本没取到值,请问,如何取到此值呢?代码问题在哪里?以上,谢谢!!

------解决方案--------------------
<script>
var online= new Array();
</script>
<script src='http://webpresence.qq.com/getonline?Type=1&2532772751:'></script>
<script>
document.writeln("<DIV id=\"qq_right\" style='RIGHT: 0px; OVERFLOW: visible; POSITION: absolute; TOP: 130px'>");
document.writeln("<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width='120'>" );
document.write('<tr><td><a href="javascript:close_float_left();void(0);" title="close"><IMG src="/img/ltq01.jpg" border=0></a></td></tr>');
document.writeln("<tr id=\"qqz_01\">");
document.writeln("<td>");
document.writeln("<table border='0' id='qqfaceid3' cellspacing='0' cellpadding='0'><tr><td>");

document.writeln("");

if (online[0] == 1) { document.write("<tr><td><a target='_blank' href='http://wpa.qq.com/msgrd?v=3&uin=2532772751&site=qq&menu=yes'><img border='0' src='/img/ltq04.jpg' alt='onclick' title='onclick'></a></td></tr>") } else { document.write("<tr><td><a target='_blank' href='http://wpa.qq.com/msgrd?v=3&uin=2532772751&site=qq&menu=yes'><img border='0' src='/img/ltq04-a.jpg' alt='onclick' title='onclick'></a></td></tr>") };


document.writeln("</table>");
document.writeln("<\/td>");
document.writeln("<\/tr>");
document.writeln("<\/tr>");
document.writeln("<\/table>");
document.writeln("<\/div>");
</script>