0

Ive accidently deleted something needed in the body I think for this code, but I cannot work out what it needs. I think the descarea div is missing? Can you help me rewriteit?

<div class='row4' style='position:absolute; background-color:yellow;border:1px solid #000000; padding:10px; display:none' id='miniTopic'></div>
<script>
function Request() {
if (window.XMLHttpRequest ) { return new XMLHttpRequest(); }
else if (window.ActiveXObject) {
try {
return new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e) {
try {
return new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e) {
return false;
}
}
}
}
function SetDescPos(e) {
if (typeof event!='undefined') {
e=new Object();
e.pageX=event.clientX+document.body.scrollLeft;
e.pageY=event.clientY+document.body.scrollTop;
}
descarea=document.all?document.all.miniTopic:document.getElementById("miniTopic");
descarea.style.left=e.pageX+2;
descarea.style.top=e.pageY+2;
}
function GetTopic(url,tTitle) {

maxlen=300;

if (typeof saveDesc=='undefined') { saveDesc=[]; }
if (typeof saveDesc[url]!='undefined') { descarea=document.all?document.all.miniTopic:document.getElementById("miniTopic");
descarea.innerHTML="<b><u>"+tTitle+"</u></b><br />"+saveDesc[url];
descarea.style.display='';
}
else {
url=url;
tTitle=tTitle;
descReq=Request();
descReq.open("http://inny.ipbfree.com/GET",url);
descarea=document.all?document.all.miniTopic:document.getElementById("miniTopic");
descarea.innerHTML="<b>Loading Topic Preview...Please Wait... <img src='http://static.whosgoing.com/images/loading.gif'>";
descarea.style.display='';
descReq.onreadystatechange=function() {
if (descReq.readyState==4) {
txt=descReq.responseText;
txt.match(/<div class=["']postcolor["']>(.*?)<\/div>/i);
ntxt=RegExp.$1;
if (ntxt.length>maxlen) {
ntxt=ntxt.substring(0,maxlen);
if (ntxt.match(/(<[^>]*?$)/i)!=null) { ntxt=ntxt.replace(RegExp.$1,''); }
ntxt+="...";
}
descarea=document.all?document.all.miniTopic:document.getElementById("miniTopic");
descarea.innerHTML="<b><u>"+tTitle+"</u></b><br />"+ntxt;
saveDesc[url]=ntxt;
}
}
descReq.send(null);
}
}
if (document.location.href.match(/showforum=[0-9]+/i)) {
as=document.getElementsByTagName("a");
for (p=0; p<as.length; p++) {
if (as[p].href && as[p].href.match(/showtopic=[0-9]/i)) {
u=as[p].href;
as[p].onmouseover=function() { GetTopic(this.href,this.innerHTML); }
as[p].title='';
as[p].onmouseout=function() { descarea=document.all?document.all.miniTopic:document.getElementById("miniTopic"); descarea.style.display="none"; }
}
}
}
document.onmousemove=SetDescPos;
</script>
2
Contributors
5
Replies
6
Views
7 Years
Discussion Span
Last Post by Inny
0

The second one works, but Im not seeing the text preveiw only the title, and a '1' on every thread. (see pic), there should be more given the maxlength include.

Help just a little more please? I really appreciate it! :)

[IMG]http://i46.tinypic.com/16kuvcl.jpg[/IMG]

0

its ok, I figured you were right the first time, but forgot the semicolon after
'descReq.open("GET",url)'. It works now again. Thankyou so much for all your help today mate! You rock! :)

1

You're welcome.
Please mark your threads 'solved' and don't forget the up arrows.

Votes + Comments
Excellent Polite freindly And accurate help with my coding issues. MFX Your a ledgend! :)
0

Sorry about the dyslexic typo in the reputation. 'FMX'.
:)

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.