PDA

View Full Version : Script conflict, please help



newbornjavababy
10-15-2007, 12:39 AM
Hi, and congratulations for this forum.

In the following html thread I have 4 scripts:

Script 1: Recommend a friend (email box).
Script 2: Menu sidebar (highlighted in red)
Script 3: BackBox image viewer (highlighted in green)
Script 4: Photo slideshow.

Scripts 2 and 3 do not work together. There must be a script conflict. I guess it is the onload/onclick handlers causing the trouble.

Can you guys help me out with a straight forward solution. Please bare in mind that my technical skills in Javascript are quite limited. Thanks in advance.

URL: Click Here (http://www.comercium.com/index0.html)


<html>


<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">


<TITLE>COMERCiUM 91.657.03.80</TITLE>


<link rel="stylesheet" href="site.css">
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
var initialsubj="Esta Web te puede gustar"
var initialmsg="Hola:\n\n Mira está Web: "+window.location
var good;
function checkEmailAddress(field) {
var goodEmail = field.value.match(/\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org)|(\.info)|(\.sex)|(\.biz)|(\.aero)|(\.coop)|(\.museum)|(\.name)|(\.pro)|(\..{2,2}))$)\b/gi);
if (goodEmail) {good = true;}
else {alert('Por favor introduce una dirección valida.');field.focus();field.select();good = false;}}
u = window.location;
function mailThisUrl() {good = falsecheckEmailAddress(document.eMailer.email);
if (good) {//window.location = "mailto:"+document.eMailer.email.value+"?subject="+initialsubj+"&body="+document.title+" "+u;
window.location = "mailto:"+document.eMailer.email.value+"?subject="+initialsubj+"&body="+initialmsg}}
// End -->
</script>


<link rel="stylesheet" type="text/css" href="sdmenu/sdmenu.css" />
<script type="text/javascript" src="sdmenu/sdmenu.js">
</script>
<script type="text/javascript">
// <![CDATA[
var myMenu;
window.onload = function() {
myMenu = new SDMenu("my_menu");
myMenu.init();
};
// ]]>
</script>


<link rel="stylesheet" href="backbox.css" type="text/css"/>
<script type="text/javascript" src="js/prototype.compressed.js"></script>
<script type="text/javascript" src="js/scriptaculous.js?load=effects"></script>
<script type="text/javascript" src="js/lightbox.js"></script>
<script type="text/javascript" src="js/dhtmlHistory.js"></script>
<script type="text/javascript" src="js/customsignsheader.js"></script>


<script language="JavaScript1.1">
<!--
//specify interval between slide (in mili seconds)
var slidespeed=3000
//specify images
var slideimages=new Array("images/banner/ipod5.jpg","images/banner/ipod1.jpg","images/banner/vanda2.jpg")
//specify corresponding links
var slidelinks=new Array("http://www.dynamicdrive.com","http://javascriptkit.com","http://www.geocities.com")
var newwindow=1 //open links in new window? 1=yes, 0=no
var imageholder=new Array()
var ie=document.all
for (i=0;i<slideimages.length;i++){
imageholder[i]=new Image()
imageholder[i].src=slideimages[i]}
function gotoshow(){
if (newwindow)
window.open(slidelinks[whichlink])
else
window.location=slidelinks[whichlink]}
//-->
</script>


</head>


<body bgcolor="#FFFFFF" link="#000080">


<table border="0" width="100%" bordercolor="#C0C0C0" cellspacing="0" cellpadding="2">


<tr>
<td width="100%" align="center">
<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="business" value="Info@comercium.com">
<input type="image" src="https://www.e-junkie.com/sslpic/1744.932a2b6dd28e4d952681e9315a57500e.jpg" align="right" border="0" name="submit" alt="Realice pagos con PayPal: es rápido, gratis y seguro.">
<input type="hidden" name="display" value="1">
<input type="hidden" name="page_style" value="COMERCiUM">
</form>
<img border="0" src="images/banner.gif" alt="Aceptamos PayPal, el servicio de pagos online #1 en Internet." width="468" height="60">
</td>
</tr>


<tr>
<td width="100%" align="center">
<b><img border="0" src="images/title.jpg" align="left" width="600" height="100">
</br>
<p align="right">Sitio garantizado por:<br>
<img border="0" src="images/paypal_logo.gif" width="109" height="35"></p><br clear="all">
</b>
<hr size="1">
</br>
</td>
</tr>

<tr>
<TD width="100%" align="center">
<table border="1" width="100%" bordercolor="#C0C0C0" cellspacing="0" cellpadding="2">
<tr>
<td width="200" bgcolor="#C0C0C0" align="center" valign="top" height="15"><font color="#FFFFFF"><b>Menú</b></font></td>
<td rowspan="2" valign="top">
<br>


<h1>Bienvenidos</h1>
<h2>Tienda Online</h2>
<table align="center" border="0" cellpadding="2" width="100%" rules=none frame=box>
<tr>
<td>
<center>
<div onload="dhtmlHistory.add('location1',{message: 'backbox'});countdown()">
<a href="images/banner/ipod1.jpg" rel="lightbox[slide]" caption="A Bunch of Grapes">
<img src="images/banner/ipod5.jpg" name="slide" border=0 style="filter:blendTrans(duration=3)"</a>
<script language="JavaScript1.1">
<!--
var whichlink=0
var whichimage=0
var blenddelay=(ie)? document.images.slide.filters[0].duration*1000 : 0
function slideit(){
if (!document.images) return
if (ie) document.images.slide.filters[0].apply()
document.images.slide.src=imageholder[whichimage].src
if (ie) document.images.slide.filters[0].play()
whichlink=whichimage
whichimage=(whichimage<slideimages.length-1)? whichimage+1 : 0
setTimeout("slideit()",slidespeed+blenddelay)}
slideit()
//-->
</script>
</div>
<a href="images/desert.jpg" rel="lightbox[slide]" caption="Sunflower"></a>
<a href="images/beech.jpg" rel="lightbox[slide]" caption="Dolphin"></a>
<a href="images/lime.jpg" rel="lightbox[slide]" caption="Waterfall"></a>
</center>
</td>
</tr>
</table>
</TD>

<td width="200" bgcolor="#C0C0C0" align="center" valign="top" height="15"><b><font color="#FFFFFF">Artículos Destacados</font></b></td>
</TR>
<tr>
<td width="200" align="left" valign="top">
<div style="float: left" id="my_menu" class="sdmenu">
<div>
<span>Artículos</span>
<a href="vanda.html">Orquídeas Vanda</a>
<a href="vandavaso.html">Orquídea Vanda (vaso) </a>
</div>
<div>
<span>Ayuda</span>
<a href="index2.html">Formas de pago</a>
<a href="index3.html">Preguntas más frecuentes</a>
<a href="">¿Abrir una cuenta PayPal?</a>
<a href="">¿Cómo comprar online?</a>
</div>
<div class="collapsed">
<span>Empresa</span>
<a href="index0.html">Quiénes Somos</a>
<a href="index1.html">Nuestro compromiso de venta</a>
</div>
<div>
<span>Contacto</span>
<a href="mailto: Info@comercium.com">Correo electrónico</a>
<a href="index4.html">Teléfono</a>
<a href="index5.html">Ubicacíon</a>
</div>
</div>
</td>
<td width="200" align="center" valign="top"><img border="0" src="images/product.jpg" width="125" height="125"><br>
€45.00 <img border="0" src="images/x-click-but01.gif" hspace="2" vspace="2" width="62" height="31" align="absmiddle">
<p><img border="0" src="images/product1.jpg" width="125" height="125"><br>
€70.00 <img border="0" src="images/x-click-but01.gif" hspace="2" vspace="2" width="62" height="31" align="absmiddle"></td>
</tr>
</table>
</td>
</tr>


<tr>
<td width="100%" align="center">
<br>
<table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
<td width="25%" bgcolor="#C0C0C0" align="center"><b><font color="#FFFFFF">Recomendar a un amigo</font></b></td>
<td width="2%" align="center"></td>
<td width="25%" bgcolor="#C0C0C0" align="center"><b><font color="#FFFFFF">Cuenta PayPal Gratis</font></b></td>
<td width="2%" align="center"></td>
<td width="25%" bgcolor="#C0C0C0" align="center"><b><font color="#FFFFFF">Solicitar artículo</font></b></td>
<td width="2%" align="center"></td>
<td width="25%" bgcolor="#C0C0C0" align="center"><b><font color="#FFFFFF">Ayuda</font></b></td>
</tr>
<tr>
<td width="25%" bgcolor="#EEEEEE" valign="top"><p><form name="eMailer">
<br>
<center>
<input type="text" name="email" size="26" value="Correo electrónico" onFocus="this.value=''" onMouseOver="window.status='Enter email address here and tell a friend about this site...'; return true" onMouseOut="window.status='';return true">
<br>
<input type="button" value="Enviar Web" onMouseOver="window.status='Click to send an email (with this page address) to a friend! Enter email address above...'; return true" onMouseOut="window.status='';return true" onClick="mailThisUrl();">
</form>
</center>
</td>

<td width="2%" valign="top"></td>
<td width="25%" bgcolor="#EEEEEE" valign="top" align="middle"><br>¿No tienes una cuenta PayPal? <br>
<a href="https://www.paypal.com/es/cgi-bin/webscr?cmd=_registration-run">Regístrate Hoy, Gratis!</a></td>
<td width="2%" valign="top"></td>
<td width="25%" bgcolor="#EEEEEE" valign="top" align="middle"><br>No encuentras lo que buscabas, tienes dudas sobre cual escoger. <a href="mailto: Info@comercium.com">Envíanos tu consulta</a>.</td>
<td width="2%" valign="top"></td>
<td width="25%" bgcolor="#EEEEEE" valign="top">
<br>
<ul>
<li><a href="http://www.101webtemplate.com/">¿Abrir una cuenta PayPal?</a></li>
<li><a href="http://www.lasvegaswebhosting.com/">¿Cómo comprar online?</a></li>
</ul>
<p>&nbsp;</td>
</tr>
</table>
</td>
</tr>

<tr>
<td align="center"><br><img border="0" src="images/cc.gif" width="150" height="25"><br><br><a href="http://www.comercium.com/">Quienes somos</a> | <a href="http://www.comercium.com/">Contacto</a> | <a href="http://www.comercium.com/">Inicio</a>
</td>
</tr>
</table>

<script type="text/javascript" src="js/customsignsfooter.js"></script>

</body>
</html>

insanemonkey
10-15-2007, 02:48 PM
I qiute dont understand what you are trying to do.. on the menu is it suppose to have a submenu when you hover over a link...?

please give us a better understanding what you are trying to do.

thanks

newbornjavababy
10-15-2007, 10:42 PM
The 4 scripts I am using are:

Script 1: Recommend a friend (email box). (http://simplythebest.net/scripts/DHTML_scripts/javascripts/javascript_119.html)
Script 2: Menu sidebar (highlighted in red). (http://www.dynamicdrive.com/dynamicindex1/slashdot.htm)
Script 3: BackBox image viewer (highlighted in green). (http://www.javascriptkit.com/script/script2/backbox/#)
Script 4: Photo slideshow. (http://www.dynamicdrive.com/dynamicindex14/image4.htm)

I would like to incorporate all of 4 scripts in one page. Script 1 and 4 work fine. The problem is when I add script 2 and 3 to the page. Either scripts 1,2,4 work or 1,3,4 work. It seems scripts 2 and 3 conflict. I guess it has to do with the onload and onclick handlers.

The URL of the page is: Click Here (http://www.comercium.com/index0.html)

I am looking forward to your replies.

newbornjavababy
10-16-2007, 03:49 PM
Can somebody please help.

Thanks a lot.