Доброго времени суток формульчики.
Прошу помогите новичку.
Надо убрать onclick jscript что бы кнопка была и без клика
<script>
function getHTTPRequest()
{
var req = false;
try {
req = new XMLHttpRequest();
} catch(err) {
try {
req = new ActiveXObject("MsXML2.XMLHTTP");
} catch(err) {
try {
req = new ActiveXObject("Microsoft.XMLHTTP");
} catch(err) {
req = false;
}
}
}
return req;
}
jQuery(document).ready(function(){
$(".normalm").click(function(e){
var oLeft = 0, oTop = 0;
element = this;
if (element.className == 'normalm') {
do {
oLeft += element.offsetLeft;
oTop += element.offsetTop;
} while (element = element.offsetParent);
var sx = e.pageX - oLeft;
var sy = e.pageY - oTop;
var elid = $(this).attr("id");
fixed(elid, sx, sy);
}
});
})
function goserf(obj)
{
obj.parentNode.innerHTML = "<span class='textgreen'>Ñïàñèáî çà âèçèò</span>";
return false;
}
function fixed(p1, p2, p3)
{
var myReq = getHTTPRequest();
var params = "p1="+p1+"&p2="+p2+"&p3="+p3;
function setstate()
{
if ((myReq.readyState == 4)&&(myReq.status == 200)) {
var resvalue = myReq.responseText;
if (resvalue != '') {
if (resvalue.length > 12) {
if (elem = document.getElementById(p1)) {
elem.className = 'goadvsite';
elem.innerHTML = '<div><a target="_blank" href="/'+resvalue+'" onclick="javascript:goserf(this);">Ïðîñìîòðåòü ñàéò ðåêëàìîäàòåëÿ</a></div>';
}
} else {
if (elem = document.getElementById(resvalue)) {
$(elem).fadeOut('low', function() {
elem.innerHTML = "<td colspan='3'></td>";
});
}
}
}
}
}
myReq.open("POST", "/ajax/us-fixedserf.php", true);
myReq.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
myReq.setRequestHeader("Content-lenght", params.length);
myReq.setRequestHeader("Connection", "close");
myReq.onreadystatechange = setstate;
myReq.send(params);
return false;
}
</script>