PDA

View Full Version : eval codes problems



aclmoonbeam
03-22-2006, 04:52 PM
hi.
l used the script from this website and l put it in my website. but the problem is l seeing some codes up there in my website and do not know how to fix it. my codes has two parts. one to put in the <head> and the other one to put in the <body> the first one l having problem..

my first code is here..

<style type="text/css">
<!--
h1 {
color:#cc3333;
font-family:"Comic Sans MS",Helvetica;
}
h3 {
color:#993333;
font-family:"Comic Sans MS",Helvetica;
}
.kisser {
position:absolute;
top:0;
left:0;
visibility:hidden;
}
-->
</style>

<script language="JavaScript1.2" type="text/JavaScript">
<!-- cloak

//Kissing trail- By dij8 (dij8@dij8.com)
//Modified by Dynamic Drive for bug fixes
//Visit http://www.dynamicdrive.com for this script

kisserCount = 15 //maximum number of images on screen at one time
curKisser = 0 //the last image DIV to be displayed (used for timer)
kissDelay = 1000 //duration images stay on screen (in milliseconds)
kissSpacer = 50 //distance to move mouse b4 next heart appears
theimage = "lips_small.gif" //the 1st image to be displayed
theimage2 = "small_heart.gif" //the 2nd image to be displayed


//Browser checking and syntax variables
var docLayers = (document.layers) ? true:false;
var docId = (document.getElementById) ? true:false;
var docAll = (document.all) ? true:false;
var docbitK = (docLayers) ? "document.layers['":(docId) ? "document.getElementById('":(docAll) ? "document.all['":"document."
var docbitendK = (docLayers) ? "']":(docId) ? "')":(docAll) ? "']":""
var stylebitK = (docLayers) ? "":".style"
var showbitK = (docLayers) ? "show":"visible"
var hidebitK = (docLayers) ? "hide":"hidden"
var ns6=document.getElementById&&!document.all
//Variables used in script
var posX, posY, lastX, lastY, kisserCount, curKisser, kissDelay, kissSpacer, theimage
lastX = 0
lastY = 0
//Collection of functions to get mouse position and place the images
function doKisser(e) {

posX = getMouseXPos(e)
posY = getMouseYPos(e)
if (posX>(lastX+kissSpacer)||posX<(lastX-kissSpacer)||posY>(lastY+kissSpacer)||posY<(lastY-kissSpacer)) {
showKisser(posX,posY)
lastX = posX
lastY = posY
}
}
// Get the horizontal position of the mouse
function getMouseXPos(e) {
if (document.layers||ns6) {
return parseInt(e.pageX+10)
} else {
return (parseInt(event.clientX+10) + parseInt(document.body.scrollLeft))
}
}
// Get the vartical position of the mouse
function getMouseYPos(e) {
if (document.layers||ns6) {
return parseInt(e.pageY)
} else {
return (parseInt(event.clientY) + parseInt(document.body.scrollTop))
}
}
//Place the image and start timer so that it disappears after a period of time
function showKisser(x,y) {
var processedx=ns6? Math.min(x,window.innerWidth-75) : docAll? Math.min(x,document.body.clientWidth-55) : x
if (curKisser >= kisserCount) {curKisser = 0}
eval(docbitK + "kisser" + curKisser + docbitendK + stylebitK + ".left = " + processedx)
eval(docbitK + "kisser" + curKisser + docbitendK + stylebitK + ".top = " + y)
eval(docbitK + "kisser" + curKisser + docbitendK + stylebitK + ".visibility = '" + showbitK + "'")
if (eval("typeof(kissDelay" + curKisser + ")")=="number") {
eval("clearTimeout(kissDelay" + curKisser + ")")
}
eval("kissDelay" + curKisser + " = setTimeout('hideKisser(" + curKisser + ")',kissDelay)")
curKisser += 1
}
//Make the image disappear
function hideKisser(knum) {
eval(docbitK + "kisser" + knum + docbitendK + stylebitK + ".visibility = '" + hidebitK + "'")
}

function kissbegin(){
//Let the browser know when the mouse moves
if (docLayers) {
document.captureEvents(Event.MOUSEMOVE)
document.onMouseMove = doKisser
} else {
document.onmousemove = doKisser
}
}
window.onload=kissbegin
// decloak -->
</script>

my second code in the body is here

<script language="JavaScript" type="text/JavaScript">
<!-- cloak
// Add all DIV's of hearts
if (document.all||document.getElementById||document.layers){
for (k=0;k<kisserCount;k=k+2) {
document.write('<div id="kisser' + k + '" class="kisser"><img src="' + theimage + '" alt="" border="0"></div>\n')
document.write('<div id="kisser' + (k+1) + '" class="kisser"><img src="' + theimage2 + '" alt="" border="0"></div>\n')
}
}

// decloak -->
</script>

<p align="center"><font face="Arial" size="-2">Free DHTML scripts provided by<br>
<a href="http://www.dynamicdrive.com">Dynamic Drive</a></font></p>

l love this codes and would like to have it in my website.

l seeing this codes everytime l opened my website.

eval(docbitK + "kisser" + curKisser + docbitendK + stylebitK + ".left = " + processedx) eval(docbitK + "kisser" + curKisser + docbitendK + stylebitK + ".top = " + y) eval(docbitK + "kisser" + curKisser + docbitendK + stylebitK + ".visibility = '" + showbitK + "'") if (eval("typeof(kissDelay" + curKisser + ")")=="number") { eval("clearTimeout(kissDelay" + curKisser + ")") } eval("kissDelay" + curKisser + " = setTimeout('hideKisser(" + curKisser + ")',kissDelay)") curKisser += 1 } //Make the image disappear function hideKisser(knum) { eval(docbitK + "kisser" + knum + docbitendK + stylebitK + ".visibility = '" + hidebitK + "'") } function kissbegin(){ //Let the browser know when the mouse moves if (docLayers) { document.captureEvents(Event.MOUSEMOVE) document.onMouseMove = doKisser } else { document.onmousemove = doKisser } } window.onload=kissbegin // decloak -->

when l viewed the codes on my website .. l saw these.

cookie_name="pop1";
cook_value="1!!1143092084";
cook_expires="Thu, 23 Mar 2006 05:35:44 GMT";
document.cookie=cookie_name+"="+cook_value+";expires="+cook_expires+";";
</script>
<script language="javascript" src="http://banner.0catch.com/cgi-bin/popup_mainsite.js"></script>
<!script language="JavaScript" src="http://dist.belnk.com/4/placement/2317/"><!/script>

















<! 0Catch CODE INSERT PARNTER: 0catch GLOBALPARTNER: 741 GLOBALDOMAIN: 741.com --></noscript></div></xmp></style>
<style type="text/css">
<!--
.link {font:12px verdana; text-decoration:none; font-weight:bold; color:BLUE; }
A:hover { color:#349901; }
-->
</style>

<center>
<table border=0 cellspacing=0 cellpadding=0>
<!partner is 741 192.168.100.18>
<td bgcolor="#ffffff"><center><font color="BLUE" size=-1>
<a href="http://www.741.com" target="_blank">FREE WEB HOSTING</a> |
<a href="http://www.hostcritique.com/" target="_blank">best web host</a> |
<a href="http://www.talk121.com/" target="_blank">Teen Chat</a> |
<a href="http://www.bluehost.com" target="_blank">wordpress hosting</a> |
<a href="http://www.superbhosting.net" target="_blank">cheap web hosting</a> |
<a href="http://www.bluehost.com" target="_blank">affordable web hosting</a> |
<a href="http://www.bluehost.com">php hosting</a><BR>
<a href="http://www.bluehost.com">web page hosting</a> |
<a href="http://www.ipowerweb.com">web hosting</a> |
<a href="http://www.valueweb.com">web hosting</a> |
<a href="http://www.bluehost.com">web site hosting</a> |
<a href="http://www.bluehost.com">website hosting</a> |
<a href="http://www.bluehost.com">web hosting services</a> |
<a href="http://www.discountlaptops.com">notebook computer</a>

</font></center></td><tr>
<td><center>
<script type="text/javascript"><!--
google_ad_client = "pub-5552695562134581";
google_alternate_ad_url = "http://bannerimages.0catch.com/ryan.html";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "text";
google_ad_channel ="";
google_color_border = "000000";
google_color_bg = "F0F0F0";
google_color_link = "0000FF";
google_color_url = "008000";
google_color_text = "000000";
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</center></td><! END OF 0CATCH BANNER CODE ################################></table></center><!POP YES 1 741 1143092084-0 he=llo; visited=03%2F22%2F2006; visited=03%2F22%2F2006; PBa11031=general; USERaclmoonbeamacl.741.com=67I67I80I76I69I72I>

www.aclmoonbeamacl.741.com

hope someone can help me..

thanks.
regards
acl

Twey
03-22-2006, 05:42 PM
Please link to the page. I can see many problems with this code already. For example, eval() is almost never needed, the language attribute is deprecated, and you need to always specify a generic font family for those users without the specified fonts.