<div id="content">
<div class="right">
<div id="rating_box">
<h2>Rating</h2>
<div class="padding">
<div id="unit_long11300-62">
<ul class="unit-rating">
<li class='current-rating' style="width:0px;">Currently 0.00/5</li>
<li><a href="#" title="1 out of 10" class="r1-unit" onclick="javascript:sndReq('1','11300-62','222.33.38.83')">1</a></li>
<li><a href="#" title="2 out of 10" class="r2-unit" onclick="javascript:sndReq('2','11300-62','222.33.38.83')">2</a></li>
<li><a href="#" title="3 out of 10" class="r3-unit" onclick="javascript:sndReq('3','11300-62','222.33.38.83')">3</a></li>
<li><a href="#" title="4 out of 10" class="r4-unit" onclick="javascript:sndReq('4','11300-62','222.33.38.83')">4</a></li>
<li><a href="#" title="5 out of 10" class="r5-unit" onclick="javascript:sndReq('5','11300-62','222.33.38.83')">5</a></li>
</ul>
<p>Rating: <strong> 0.0</strong> out of 0 votes
</div>
</div>
</div>
这是一个静态页面 别的我都可以理解,就是我的IP程序是怎么获得的啊
想了半天(真的是半天啊), 没想明白!
JS文件同时发出来 大家帮我看看怎么回事
var xmlhttp
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
try {
xmlhttp=new ActiveXObject("Msxml2.XMLHTTP")
} catch (e) {
try {
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")
} catch (E) {
xmlhttp=false
}
}
@else
xmlhttp=false
@end @*/
if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
try {
xmlhttp = new XMLHttpRequest();
} catch (e) {
xmlhttp=false
}
}
function myXMLHttpRequest() {
var xmlhttplocal;
try {
xmlhttplocal= new ActiveXObject("Msxml2.XMLHTTP")
} catch (e) {
try {
xmlhttplocal= new ActiveXObject("Microsoft.XMLHTTP")
} catch (E) {
xmlhttplocal=false;
}
}
if (!xmlhttplocal && typeof XMLHttpRequest!='undefined') {
try {
var xmlhttplocal = new XMLHttpRequest();
} catch (e) {
var xmlhttplocal=false;
alert('couldn\'t create xmlhttp object');
}
}
return(xmlhttplocal);
}
function sndReq(vote,id_num,ip_num) {
var element = document.getElementById('unit_long'+id_num);
//new Effect.Fade(element);
element.innerHTML = '<div style="height: 30px;"><em>Loading ...</em></div>';
xmlhttp.open('get', 'rate.php?j='+vote+'&q='+id_num+'&t='+ip_num);
xmlhttp.onreadystatechange = handleResponse;
xmlhttp.send(null);
}
function handleResponse() {
if(xmlhttp.readyState == 4){
if (xmlhttp.status == 200){
var response = xmlhttp.responseText;
var update = new Array();
if(response.indexOf('|') != -1) {
update = response.split('|');
changeText(update[0], update[1]);
}
}
}
}
function changeText( div2show, text ) {
// Detect Browser
var IE = (document.all) ? 1 : 0;
var DOM = 0;
if (parseInt(navigator.appVersion) >=5) {DOM=1};
// Grab the content from the requested "div" and show it in the "container"
if (DOM) {
var viewer = document.getElementById(div2show)
viewer.innerHTML=text
}
else if(IE) {
document.all[div2show].innerHTML=text
}
}
要是问题太简单了别骂我啊,我是菜菜鸟