|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
You eat, breathe and sleep innovation. Build your mobile intelligence with BlackBerry® experts this July. Register Today! |
|
#1
|
|||
|
|||
|
strange problem with popup
hi..i'm using a javascript popup with php to show some messages..but when i pass the message to the popup something very strange happens.
if i do $msg = "messages comes here"; it gives me an error(javascript error), if i do $msg ="messagecomeshere" everything works fine. i don't know whats happening, it works well till i insert a space,nl,etc. can some one help me? i can post the code if it helps. |
|
#2
|
|||
|
|||
|
RE: strange problem with popup
moved
|
|
#3
|
|||
|
|||
|
RE: strange problem with popup
post an example url and the specific javascript error as well as the code, I will take a look...
|
|
#4
|
|||
|
|||
|
RE: strange problem with popup
hi.
here is the php code, the popup code, and the css. //friends.php <?php $friends[] = 'Nuno "Nasf" Faria'; $friends[] = 'Susana "Susanflyer" Pereira'; $friends[] = 'Miguel "Firewalker" Pinto'; $friends[] = 'Alberto "Albie" Simões'; $friends[] = 'José "Jac" Alves'; $friends[] = 'José "Ralliart" Moura'; $friends[] = 'Paulo "Coredump" Cabral'; echo "<html>n"; echo "<head>n"; echo "</head>n"; echo "<body>n"; echo "<DIV ID="dek" class="dek"></DIV>"; echo "<script language=JavaScript type=text/javascript src="scripts/dek.js"></script>n"; echo "<p align=center>these are with any doubt my best friends i meet over the years in Bragan"; echo "<br>n"; sort($friends); $a = count($friends); $b = $friends[0]; //echo "$a<br>n"; echo "<br>n"; echo "<div align=left><br>n"; echo "<table width="50%">n"; echo "<tr><td class= "inside2" bgcolor="#aaaa00" width="50%" height="5%"><a href="#" onMouseOver=javascript:popup($b,'#aaccaa') onmouseout=javascript:kill()>$friends[0]</a></td></tr>n"; echo "<tr><td bgcolor="#aaaa00" width="50%" height="5%"><a href="#" onMouseOver=javascript:popup() onmouseout=javascript:kill()>$friends[1]</a></td></tr>n"; echo "<tr><td bgcolor="#aaaa00" width="50%" height="5%"><a href="#" onMouseOver=javascript:popup() onmouseout=javascript:kill()>$friends[2]</a></td></tr>n"; echo "<tr><td bgcolor="#aaaa00" width="50%" height="5%"><a href="#" onMouseOver=javascript:popup() onmouseout=javascript:kill()>$friends[3]</a></td></tr>n"; echo "<tr><td bgcolor="#aaaa00" width="50%" height="5%"><a href="#" onMouseOver=javascript:popup() onmouseout=javascript:kill()>$friends[4]</a></td></tr>n"; echo "<tr><td bgcolor="#aaaa00" width="50%" height="5%"><a href="#" onMouseOver=javascript:popup() onmouseout=javascript:kill()>$friends[5]</a></td></tr>n"; echo "</table>n"; echo "</div>n"; echo "</body>n"; echo "</html>n"; ?> //dek.js //Pop up information box II (Mike McGrath (mike_mcgrath@lineone.net, http://website.lineone.net/~mike_mcgrath)) //Permission granted to Dynamicdrive.com to include script in archive //For this and 100's more DHTML scripts, visit http://dynamicdrive.com Xoffset=500; // modify these values to ... Yoffset=200; // change the popup position. var old,skn,iex=(document.all),yyy=-1000; var ns4=document.layers var ns6=document.getElementById&&!document.all var ie4=document.all if (ns4) skn=document.dek else if (ns6) skn=document.getElementById("dek").style else if (ie4) skn=document.all.dek.style if(ns4)document.captureEvents(Event.MOUSEMOVE); else{ skn.visibility="visible" skn.display="none" } document.onmousemove=get_mouse; function popup(friend,msg){ var content="<TABLE WIDTH=290 height=200 CELLPADDING=0 CELLSPACING=0 "+ "><th>"+friend+"</tr><tr><TD width=290 height=100 ALIGN=center><FONT COLOR=white SIZE=2>"+msg+"</FONT></TD></tr>"+ "<tr><td align=center width=290 height=100><FONT COLOR=white SIZE=2>Puke?</FONT></td></tr></TABLE>"; yyy=Yoffset; if(ns4){skn.document.write(content);skn.document.c lose();skn.visibility="visible"} if(ns6){document.getElementById("dek").innerHTML=content;skn.display=''} if(ie4){document.all("dek").innerHTML=content;skn.display=''} } function get_mouse(e){ //var x=(ns4||ns6)?e.pageX:event.x+document.body.scrollL eft; skn.left=Xoffset; //var y=(ns4||ns6)?e.pageY:event.y+document.body.scrollT op; skn.top=yyy; } function kill(){ yyy=-1000; if(ns4){skn.visibility="hidden";} else if (ns6||ie4) skn.display="none" } //css chrome.css BODY { FONT-SIZE: 10px; MARGIN: 10px; COLOR: #ffffff; FONT-FAMILY: MS Sans Serif, Arial, Helvetica; BACKGROUND-COLOR: #a4491d; SCROLLBAR-FACE-COLOR: #e1d8ce; SCROLLBAR-HIGHLIGHT-COLOR: #e1d8ce; SCROLLBAR-SHADOW-COLOR: #e1d8ce; SCROLLBAR-3DLIGHT-COLOR: #e1d8ce; SCROLLBAR-ARROW-COLOR: #d95d18; SCROLLBAR-TRACK-COLOR: #a4491d; SCROLLBAR-DARKSHADOW-COLOR: #e1d8ce } TD { FONT-SIZE: 14px; COLOR: #ffffff; FONT-FAMILY: MS Sans Serif, Arial, Helvetica; BORDER-RIGHT: #ffffff 1px solid; BORDER-TOP: #ffffff 1px solid; BORDER-LEFT: #ffffff 1px solid; BORDER-BOTTOM: #ffffff 1px solid; BACKGROUND-COLOR: #000000 } A:link { COLOR: #ffffff; TEXT-DECORATION: none } A:visited { COLOR: #ffffff; TEXT-DECORATION: none } A:active { COLOR: #ffffff; TEXT-DECORATION: none } A:hover { BACKGROUND-COLOR: #ffffff; COLOR: black } DIV { FONT-SIZE: 9px; COLOR: #ffffff; FONT-FAMILY: MS Sans Serif, Arial, Helvetica } DIV.dek{ POSITION : absolute; VISIBILITY : hidden; Z-INDEX : 200; } input { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; font-weight: normal; color: #5a6ba1; border: #5a6ba1; border-style: solid; border-top-width: 1px; border-right-width: 1px; border-left-width: 1px; border-bottom-width: 1px; background-color: #ffffff } textarea { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; font-weight: normal; color: #5a6ba1; border: #5a6ba1; border-style: solid; border-top-width: 1px; border-right-width: 1px; border-left-width: 1px; border-bottom-width: 1px; background-color: #ffffff } i hope this helps. |
|
#5
|
|||
|
|||
|
RE: strange problem with popup
hi.
here is the php code, the popup code, and the css. //friends.php <?php $friends[] = 'Nuno "Nasf" Faria'; $friends[] = 'Susana "Susanflyer" Pereira'; $friends[] = 'Miguel "Firewalker" Pinto'; $friends[] = 'Alberto "Albie" Simões'; $friends[] = 'José "Jac" Alves'; $friends[] = 'José "Ralliart" Moura'; $friends[] = 'Paulo "Coredump" Cabral'; echo "<html>n"; echo "<head>n"; echo "</head>n"; echo "<body>n"; echo "<DIV ID="dek" class="dek"></DIV>"; echo "<script language=JavaScript type=text/javascript src="scripts/dek.js"></script>n"; echo "<p align=center>these are with any doubt my best friends i meet over the years in Bragan"; echo "<br>n"; sort($friends); $a = count($friends); $b = $friends[0]; //echo "$a<br>n"; echo "<br>n"; echo "<div align=left><br>n"; echo "<table width="50%">n"; echo "<tr><td class= "inside2" bgcolor="#aaaa00" width="50%" height="5%"><a href="#" onMouseOver=javascript:popup($b,'#aaccaa') onmouseout=javascript:kill()>$friends[0]</a></td></tr>n"; echo "<tr><td bgcolor="#aaaa00" width="50%" height="5%"><a href="#" onMouseOver=javascript:popup() onmouseout=javascript:kill()>$friends[1]</a></td></tr>n"; echo "<tr><td bgcolor="#aaaa00" width="50%" height="5%"><a href="#" onMouseOver=javascript:popup() onmouseout=javascript:kill()>$friends[2]</a></td></tr>n"; echo "<tr><td bgcolor="#aaaa00" width="50%" height="5%"><a href="#" onMouseOver=javascript:popup() onmouseout=javascript:kill()>$friends[3]</a></td></tr>n"; echo "<tr><td bgcolor="#aaaa00" width="50%" height="5%"><a href="#" onMouseOver=javascript:popup() onmouseout=javascript:kill()>$friends[4]</a></td></tr>n"; echo "<tr><td bgcolor="#aaaa00" width="50%" height="5%"><a href="#" onMouseOver=javascript:popup() onmouseout=javascript:kill()>$friends[5]</a></td></tr>n"; echo "</table>n"; echo "</div>n"; echo "</body>n"; echo "</html>n"; ?> //dek.js //Pop up information box II (Mike McGrath (mike_mcgrath@lineone.net, http://website.lineone.net/~mike_mcgrath)) //Permission granted to Dynamicdrive.com to include script in archive //For this and 100's more DHTML scripts, visit http://dynamicdrive.com Xoffset=500; // modify these values to ... Yoffset=200; // change the popup position. var old,skn,iex=(document.all),yyy=-1000; var ns4=document.layers var ns6=document.getElementById&&!document.all var ie4=document.all if (ns4) skn=document.dek else if (ns6) skn=document.getElementById("dek").style else if (ie4) skn=document.all.dek.style if(ns4)document.captureEvents(Event.MOUSEMOVE); else{ skn.visibility="visible" skn.display="none" } document.onmousemove=get_mouse; function popup(friend,msg){ var content="<TABLE WIDTH=290 height=200 CELLPADDING=0 CELLSPACING=0 "+ "><th>"+friend+"</tr><tr><TD width=290 height=100 ALIGN=center><FONT COLOR=white SIZE=2>"+msg+"</FONT></TD></tr>"+ "<tr><td align=center width=290 height=100><FONT COLOR=white SIZE=2>Puke?</FONT></td></tr></TABLE>"; yyy=Yoffset; if(ns4){skn.document.write(content);skn.document.c lose();skn.visibility="visible"} if(ns6){document.getElementById("dek").innerHTML=content;skn.display=''} if(ie4){document.all("dek").innerHTML=content;skn.display=''} } function get_mouse(e){ //var x=(ns4||ns6)?e.pageX:event.x+document.body.scrollL eft; skn.left=Xoffset; //var y=(ns4||ns6)?e.pageY:event.y+document.body.scrollT op; skn.top=yyy; } function kill(){ yyy=-1000; if(ns4){skn.visibility="hidden";} else if (ns6||ie4) skn.display="none" } //css chrome.css BODY { FONT-SIZE: 10px; MARGIN: 10px; COLOR: #ffffff; FONT-FAMILY: MS Sans Serif, Arial, Helvetica; BACKGROUND-COLOR: #a4491d; SCROLLBAR-FACE-COLOR: #e1d8ce; SCROLLBAR-HIGHLIGHT-COLOR: #e1d8ce; SCROLLBAR-SHADOW-COLOR: #e1d8ce; SCROLLBAR-3DLIGHT-COLOR: #e1d8ce; SCROLLBAR-ARROW-COLOR: #d95d18; SCROLLBAR-TRACK-COLOR: #a4491d; SCROLLBAR-DARKSHADOW-COLOR: #e1d8ce } TD { FONT-SIZE: 14px; COLOR: #ffffff; FONT-FAMILY: MS Sans Serif, Arial, Helvetica; BORDER-RIGHT: #ffffff 1px solid; BORDER-TOP: #ffffff 1px solid; BORDER-LEFT: #ffffff 1px solid; BORDER-BOTTOM: #ffffff 1px solid; BACKGROUND-COLOR: #000000 } A:link { COLOR: #ffffff; TEXT-DECORATION: none } A:visited { COLOR: #ffffff; TEXT-DECORATION: none } A:active { COLOR: #ffffff; TEXT-DECORATION: none } A:hover { BACKGROUND-COLOR: #ffffff; COLOR: black } DIV { FONT-SIZE: 9px; COLOR: #ffffff; FONT-FAMILY: MS Sans Serif, Arial, Helvetica } DIV.dek{ POSITION : absolute; VISIBILITY : hidden; Z-INDEX : 200; } input { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; font-weight: normal; color: #5a6ba1; border: #5a6ba1; border-style: solid; border-top-width: 1px; border-right-width: 1px; border-left-width: 1px; border-bottom-width: 1px; background-color: #ffffff } textarea { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; font-weight: normal; color: #5a6ba1; border: #5a6ba1; border-style: solid; border-top-width: 1px; border-right-width: 1px; border-left-width: 1px; border-bottom-width: 1px; background-color: #ffffff } i hope this helps. |
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Client Side Things > strange problem with popup |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|