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>

Recommended Answers

All 5 Replies

Ive accidently deleted something

I can't begin to guess what.

Be that as it may, this

descReq.open("http://inny.ipbfree.com/GET",url);

is obviously wrong.

It should probably be this

descReq.open("GET",url)

;or possibly something like this

descReq.open("GET","http://inny.ipbfree.com/");

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]

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! :)

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

commented: Excellent Polite freindly And accurate help with my coding issues. MFX Your a ledgend! :) +5

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.