Client Side Things
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesClient Side Things

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
You eat, breathe and sleep innovation. Build your mobile intelligence with BlackBerry® experts this July. Register Today!
  #1  
Old December 23rd, 2003, 08:54 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
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.

Reply With Quote
  #2  
Old December 23rd, 2003, 09:00 PM
notepad notepad is offline
Codewalkers Loyal (3000 - 3499 posts)
 
Join Date: Apr 2007
Location: Central, IL USA
Posts: 3,214 notepad User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
Send a message via AIM to notepad
RE: strange problem with popup

moved

Reply With Quote
  #3  
Old December 23rd, 2003, 09:52 PM
Blindeddie Blindeddie is offline
Codewalkers Regular (2000 - 2499 posts)
 
Join Date: Apr 2007
Location: NJ - USA
Posts: 2,152 Blindeddie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 4
RE: strange problem with popup

post an example url and the specific javascript error as well as the code, I will take a look...

Reply With Quote
  #4  
Old December 25th, 2003, 08:36 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
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.



Reply With Quote
  #5  
Old December 25th, 2003, 08:38 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
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.



Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesClient Side Things > strange problem with popup


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway