KebdnK: Probleme mit onMouseOver

Hier der Quelltext.

<html>
<head>
</head>
<body>
<DIV ID="dek" CLASS="dek"></DIV>
<SCRIPT TYPE="text/javascript">
Xoffset=-60;    // modify these values to ...
Yoffset= 20;    // change the popup position.
var nav,old,iex=(document.all),yyy=-1000;
if(navigator.appName=="Netscape"){(document.layers)?nav=true:old=true;}
if(!old){
var skn=(nav)?document.dek:dek.style;
if(nav)document.captureEvents(Event.MOUSEMOVE);
document.onmousemove=get_mouse;}
function popup(msg){
var content="<TABLE  WIDTH=150 BORDER=1 bgcolor=white BORDERCOLOR=black CELLPADDING=2 CELLSPACING=0><TD ALIGN=center><FONT COLOR=black SIZE=2>"+msg+"</FONT></TD></TABLE>";
if(old){alert(msg);return;}
else{yyy=Yoffset;
 if(nav){skn.document.write(content);skn.document.close();skn.visibility="visible"}
 if(iex){document.all("dek").innerHTML=content;skn.visibility="visible"}
 }
}
function get_mouse(e){
 var x=(nav)?e.pageX:event.x+document.body.scrollLeft;skn.left=x+Xoffset;
 var y=(nav)?e.pageY:event.y+document.body.scrollTop;skn.top=y+yyy;
}
function kill(){
 if(!old){yyy=-1000;skn.visibility="hidden";}
}
function dummy()
{
}
//-->
</SCRIPT>
<table width="100%">
<tr>
<td align="center" width="50%">Creed</td>
<td align="center" width="50%"><a class="dunkel" href="http://www.amazon.de/exec/obidos/ASIN/B000055WYK/qid=1064766180/sr=2-2/ref=sr_2_11_2/028-4619090-3999732" target=_blank onMouseOut="kill()" onMouseOver="popup('Anspieltipps:<br>What if, Faceless Man, With Arms wide open, Higher')">Human Clay</a></td>
</tr>
<tr>
<td align="center" width="50%">Creed</td>
<td align="center" width="50%"><a class="dunkel" href="http://www.amazon.de/exec/obidos/ASIN/B000023Z1N/qid=1064766180/sr=2-3/ref=sr_2_11_3/028-4619090-3999732" target=_blank onMouseOut="kill()" onMouseOver="popup('Anspieltipps:<br>What's this Life for')">My own Prison</a></td>
</tr>
<tr>
<td align="center" width="50%">Creed</td>
<td align="center" width="50%"><a class="dunkel" href="http://www.amazon.de/exec/obidos/ASIN/B00005RHA0/qid=1064766180/sr=2-1/ref=sr_2_11_1/028-4619090-3999732" target=_blank onMouseOut="kill()" onMouseOver="popup('Anspieltipps:<br>Who's got my Back, Signs, One last Breath, Stand here with me, Weathered')">Weathered</a></td>
</tr>
<tr>
<td align="center" width="50%">Eve 6</td>
<td align="center" width="50%"><a class="dunkel" href="http://www.amazon.de/exec/obidos/ASIN/B00004U14O/qid=1064765662/sr=1-8/ref=sr_1_11_8/028-4619090-3999732" target=_blank onMouseOut="kill()" onMouseOver="popup('Anspieltipps:<br>Promise, Sunset Strip Bitch, Here's to the Night, Jet Pack')">Horrorscope</a></td>
</tr>
<tr>
<td align="center" width="50%">Fastball</td>
<td align="center" width="50%"><a class="dunkel" href="http://www.amazon.de/exec/obidos/ASIN/B000005ZKM/qid=1064765778/sr=1-2/ref=sr_1_11_2/028-4619090-3999732" target=_blank onMouseOut="kill()" onMouseOver="popup('Anspieltipps:<br>The Way, Which Way to the Top, Out of my Head')">All the Pain Money can buy</a></td>
</tr>
<tr>
<td align="center" width="50%">Fastball</td>
<td align="center" width="50%"><a class="dunkel" href="http://www.amazon.de/exec/obidos/ASIN/B000066BMU/qid=1064765778/sr=2-2/ref=sr_2_11_2/028-4619090-3999732" target=_blank onMouseOut="kill()" onMouseOver="popup('Anspieltipps:<br>You're an Ocean, Love is expensive and free, Morning Star, Whatever get's you on')">The harsh Light of Day</a></td>
</tr>
<tr>
<td align="center" width="50%">Lit</td>
<td align="center" width="50%"><a class="dunkel" href="http://www.amazon.de/exec/obidos/ASIN/B00000I7HH/qid=1064767047/sr=2-2/ref=sr_2_11_2/028-4619090-3999732" target=_blank onMouseOut="kill()" onMouseOver="popup('Anspieltipps:<br>My own worst Enemy, Miserable, Perfect One, Happy, A Place in the Sun')">A Place in the Sun</a></td>
</tr>
<tr>
<td align="center" width="50%">Lit</td>
<td align="center" width="50%"><a class="dunkel" href="http://www.amazon.de/exec/obidos/ASIN/B00005Y30S/qid=1064767047/sr=2-1/ref=sr_2_11_1/028-4619090-3999732" target=_blank onMouseOut="kill()" onMouseOver="popup('Anspieltipps:<br>Addicted, Happy in the Meantime, Sunny Weather, She comes, Over my Head')">Atomic</a></td>
</tr>
<tr>
<td align="center" width="50%">Manfred Mann's Earthband</td>
<td align="center" width="50%"><a class="dunkel" href="http://www.amazon.de/exec/obidos/ASIN/B00002DE58/qid=1064767273/sr=1-2/ref=sr_1_10_2/028-4619090-3999732" target=_blank onMouseOut="kill()" onMouseOver="popup('Anspieltipps:<br>Davy's on the Road again, Mighty Quinn, Don't kill it Carol, For You, Redemption Song')">The Best of Manfred...</a></td>
</tr>
<tr>
<td align="center" width="50%">Oleander</td>
<td align="center" width="50%"><a class="dunkel" href="http://www.amazon.de/exec/obidos/ASIN/B00000I5M6/qid=1064765145/sr=1-3/ref=sr_1_11_3/028-4619090-3999732" target=_blank onMouseOut="kill()" onMouseOver="popup('Anspieltipps:<br>Why I'm here, I walk alone, Boys don't cry, Never again')">February Son</a></td>
</tr>
<tr>
<td align="center" width="50%">Oleander</td>
<td align="center" width="50%"><a class="dunkel" href="http://www.amazon.de/exec/obidos/ASIN/B00007GOVU/ref=pd_sims_dp__1/028-4619090-3999732" target=_blank onMouseOut="kill()" onMouseOver="popup('Anspieltipps:<br>Rainy Day, Better Luck next Time, Joyride, Runaway Train')">Joyride</a></td>
</tr>
<tr>
<td align="center" width="50%">Oleander</td>
<td align="center" width="50%"><a class="dunkel" href="http://www.amazon.de/exec/obidos/ASIN/B00005A8K3/ref=pd_sims_dp__1/028-4619090-3999732" target=_blank onMouseOut="kill()" onMouseOver="popup('Anspieltipps:<br>Halo, Benign, Tightrope, Champion')">Unwind</a></td>
</tr>
<tr>
<td align="center" width="50%">R.E.M.</td>
<td align="center" width="50%"><a class="dunkel" href="http://www.amazon.de/exec/obidos/ASIN/B000005RQE/qid=1064766116/sr=2-2/ref=sr_2_11_2/028-4619090-3999732" target=_blank onMouseOut="kill()" onMouseOver="popup('Anspieltipps:<br>It's the End of the World as we know it, The One I love')">Document</a></td>
</tr>
</table>
</center>
</body>
</html>

Vielen Dank im Voraus.

Ciao KebdnK

  1. Hallo KebdnK,

    Hier der Quelltext.
    ...

    ein bissel Dokumentation was du eigentlich willst wär bestimmt nicht schlecht um dir weiter zuhelfen !!!
    Oder hab ich die in dem rießigen Quelltext übersehen ???
    Ich versteh zumindest nicht was du willst und kann die deshalb auch nicht helfen !!!

    samy,

    1. Das Problem ist:
      Bei manchen Links führt er das Javascript richtig aus und bei manchen zeigt er, dass er ein ')' erwartet.
      Ich hoffe, das hilft dir weiter. Musst am besten selbst mal probieren.

      1. Hallo!

        Innerhalb der Anweisung inn der Funktion popup() steht der auszugebene Text logischerweise in einfachen Anführungszeichen. So muss es ja auch sein.

        Dein Browser kann das auch alles solange verstehen, wie er am Anfang und am Ende des Textes diese Anführungszeichen findet. In deinen Links findet er aber auch manchmal drei davon:

        onMouseOver="popup('Anspieltipps:<br>What's this Life for')"

        Folgende Schreibweise behebt den Fehler:

        onMouseOver="popup('Anspieltipps:<br>What's this Life for')"

        Gruß, denito