Foros del Web » Programando para Internet » Javascript »

problema con doctype public con funcion javascript en firefox

Estas en el tema de problema con doctype public con funcion javascript en firefox en el foro de Javascript en Foros del Web. buenas señores.. no se si sea raro mi problema pero es la primera vez q me sucede... y tmb la primera vez q me falla ...
  #1 (permalink)  
Antiguo 29/06/2010, 21:03
 
Fecha de Ingreso: mayo-2010
Ubicación: Lima, Peru.
Mensajes: 176
Antigüedad: 13 años, 10 meses
Puntos: 6
problema con doctype public con funcion javascript en firefox

buenas señores.. no se si sea raro mi problema pero es la primera vez q me sucede... y tmb la primera vez q me falla firefox..
no me ejecuta una funcion javascript q busca tours por pais... pero en IE y opera si sale normal... pense q era mi codigo o algo dejado sin cerrar pero noy me di cuenta q si quito el doctype public... si lo ejecuta normal pero me descuadra todoa el css para la pagina, si alguien me pudiera ayudar en mi problema o decirme como puedo encontrar una manera q se ejecute sin malograr el css se lo agradeceria infinitamente..
  #2 (permalink)  
Antiguo 29/06/2010, 21:27
Avatar de zerokilled
Javascripter
 
Fecha de Ingreso: abril-2009
Ubicación: Isla del Encanto, La Borinqueña [+>==]
Mensajes: 8.050
Antigüedad: 15 años
Puntos: 1485
Respuesta: problema con doctype public con funcion javascript en firefox

la verdad no entiendo bien el problema. o sea, entiendo que sin doctype funciona y con doctype no funciona. pero sin ver el código es imposible de decifrar. de lo que me acuerdo y hasta donde me conocimiento ha alcanzado, javascript falla con doctype si intentas obtener las dimensiones del body. en lugar de body, tienes que leer las dimensiones desde el elemento raíz, o sea HTML. quizás sea tu caso como también puede que no, pero sin ver código es simplemente imposible.
__________________
la maldad es una virtud humana,
y la espiritualidad es la lucha del hombre contra su maldad.
  #3 (permalink)  
Antiguo 30/06/2010, 09:07
 
Fecha de Ingreso: mayo-2010
Ubicación: Lima, Peru.
Mensajes: 176
Antigüedad: 13 años, 10 meses
Puntos: 6
Respuesta: problema con doctype public con funcion javascript en firefox

gracias por responder... aca les dejo el codigo, no me anime a ponerloo por q era demasiado pero ahi les va...

Código Javascript:
Ver original
  1. function mandapais()
  2.     {
  3.         var valorid;
  4.         valorid=document.all.grupo1.value;
  5.  
  6.         if (valorid=="TOURS ESPECIAL")
  7.         {
  8.  
  9.             document.getElementById("tourstailor").style.display="none";
  10.             document.getElementById("nover").style.display="inline";
  11.  
  12.             document.getElementById("ocultadatos1").style.display="none";          
  13.             document.getElementById("ocultadatos2").style.display="none";          
  14.             document.getElementById("ocultadatos3").style.display="none";                                  
  15.  
  16.  
  17.            
  18.             document.all.codTailorMade.value="???"
  19.             document.all.NameTailorTours.value="???"
  20.             document.all.LenghtTaylorMadeTrip.value="???"
  21.  
  22.             document.all.Amount.removeAttribute('readOnly');
  23.  
  24.  
  25.            
  26.             document.all.txt_precioDeposit.value="Amount"
  27.             document.all.txt_finalbalance.value="Amount"
  28.             document.all.txt_preciofullpayment.value="Amount"
  29.            
  30.             doAjax("buscapais.asp","valorid=" + valorid + "&tipocombo=toursfinal" , "cargapais", "get", "0");  
  31.            
  32.         }
  33.         else
  34.         {
  35.             document.getElementById("tourstailor").style.display="none";
  36.             document.getElementById("nover").style.display="inline";
  37.  
  38.             document.getElementById("ocultadatos1").style.display="none";          
  39.             document.getElementById("ocultadatos2").style.display="none";          
  40.             document.getElementById("ocultadatos3").style.display="none";                                  
  41.  
  42.  
  43.            
  44.             document.all.codTailorMade.value="???"
  45.             document.all.NameTailorTours.value="???"
  46.             document.all.LenghtTaylorMadeTrip.value="???"
  47.  
  48.             document.all.Amount.removeAttribute('readOnly');
  49.  
  50.  
  51.            
  52.             document.all.txt_precioDeposit.value="Amount"
  53.             document.all.txt_finalbalance.value="Amount"
  54.             document.all.txt_preciofullpayment.value="Amount"
  55.            
  56.             doAjax("buscapais.asp","valorid=" + valorid + "&tipocombo=toursfinal" , "cargapais", "get", "0");      
  57.         }
  58.        
  59.        
  60.        
  61.  
  62.     }
  63.    
  64.     function cargapais(texto)
  65.     {
  66.         var array,tourspais,contarray,combo;
  67.         tourspais=texto.split("<>-*-<>"); //[0]-->datos // [1]-->tipobusca
  68.         array=tourspais[0].split("<-*->");
  69.         contarray=array.length;
  70.  
  71.         document.all.Tour.value="";
  72.  
  73.         combo=document.all.Tour
  74.         for (var i = combo.options.length;i>=0;i--)
  75.             combo.options[i] = null;
  76.  
  77.         for (var i = combo.options.length;i>=0;i--)
  78.             combo.options[i] = null;
  79.  
  80.         combo.options[0] = new Option("--SEARCH--", 0);    
  81.         for (var i = 1;i<contarray+1;i++)
  82.         {
  83.             var array2;
  84.             array2=array[i-1].split("-");
  85.             combo.options[i] = new Option(array2[1], array2[0]);    
  86.         }
  87.     }
  88.    
  89.  
  90.  
  91.     function pasanombretors()
  92.     {
  93.         //document.all.xtitulo.value=document.all.Tour.options[document.all.Tour.selectedIndex].text
  94.         document.all.xtitulo1.value=document.all.Tour.options[document.all.Tour.selectedIndex].text
  95.         document.all.NameTailorTours.value=document.all.xtitulo1.value
  96.        
  97. /*      var valorid;
  98.         valorid=document.all.Tour.value;
  99.         doAjax("../buscapreciotourscliente.asp","codtours=" + valorid + "&tipomoneda=2" , "cargaprecio", "get", "0");
  100. */     
  101.     }
  #4 (permalink)  
Antiguo 30/06/2010, 09:10
 
Fecha de Ingreso: mayo-2010
Ubicación: Lima, Peru.
Mensajes: 176
Antigüedad: 13 años, 10 meses
Puntos: 6
Respuesta: problema con doctype public con funcion javascript en firefox

Código ASP:
Ver original
  1. <%
  2. if len(Request("xtour"))>0 and len(Request("xtitulo"))>0 then
  3. %>
  4. <form name="frmverifica" id="frmverifica" action="" method="post">
  5. <input type="hidden" name="xtour" value="<%=Request("xtour")%>" >
  6. <input type="hidden" name="xtitulo" value="<%=Request("xtitulo")%>" >
  7. </form>
  8. <%
  9. end if
  10. %>
  11.             <!--Center Column-->
  12.             <div id="CenterColumn">
  13.             <% reload=false
  14.                 n=1
  15.                 if (""<>request.form("People")) then
  16.                     reload=true
  17.                     n= Cint(request.Form("people"))
  18.                 end if
  19.                 function iif(psdStr, trueStr, falseStr)
  20.                 if psdStr then
  21.                     iif = trueStr
  22.                 else
  23.                     iif = falseStr
  24.                 end if
  25.                 end function%>
  #5 (permalink)  
Antiguo 30/06/2010, 09:11
 
Fecha de Ingreso: mayo-2010
Ubicación: Lima, Peru.
Mensajes: 176
Antigüedad: 13 años, 10 meses
Puntos: 6
Respuesta: problema con doctype public con funcion javascript en firefox

Código HTML:
Ver original
  1. <div class="containerTitContinent"><div class="containerdesctit">AMAZING VOYAGES - BOOK ONLINE</div></div>
  2.                        
  3.                         <div class="containerDescPais">
  4.                             Before booking, it is important to have read and understood the <a href="conditions_of_sale.asp" class="leermas"><u><b>Conditions of sale</b></u></a> and <a href="booking_conditions.asp" class="leermas"><b><u>Booking conditions</u></b></a>. Please bear in mind that significant price reductions are available for groups.
  5.                         </div>
  6.                         <div class="imagesecurity">
  7.                             <div class="imagessl">
  8. </div>
  9.                         </div>
  10.                         <div class="programcontainer">
  11.                             <div class="subtituloform">
  12.                                 <div class="descsubtituloform">Choice of tour / itinerary </div>
  13.                             </div>
  14.                         <FORM action="" method="post" name="fmbookx" target="_self" id="fmbookx">
  15.                             <div class="Parametro">Number of people</div>
  16.                             <div class="value">
  17.                                 <select name="People"   onChange="document.fmbookx.submit()">
  18.                                     <option value="1" <&#37;=iif(n=1,"Selected","")%>>1</option>
  19.                                     <option value="2" <%=iif(n=2,"Selected","")%>>2</option>
  20.                                     <option value="3" <%=iif(n=3,"Selected","")%>>3</option>
  21.                                     <option value="4" <%=iif(n=4,"Selected","")%>>4</option>
  22.                                     <option value="5" <%=iif(n=5,"Selected","")%>>5</option>
  23.                                     <option value="6" <%=iif(n=6,"Selected","")%>>6</option>
  24.                                     <option value="7" <%=iif(n=7,"Selected","")%>>7</option>
  25.                                     <option value="8" <%=iif(n=8,"Selected","")%>>8</option>
  26.                                     <option value="9" <%=iif(n=9,"Selected","")%>>9</option>
  27.                                     <option value="10" <%=iif(n=10,"Selected","")%>>10</option>
  28.                                 </select>
  29.                                 <input name="Paisweb" type="hidden"  value="Blank" size="15">  
  30.                             </div>
  31.                             <div class="Parametro1">Choice of tour / itinerary</div>
  32.                             <div class="value1">
  33.                                 <select name="grupo1" id="grupo1"  onchange="mandapais(); " style="width:200px">
  34.                                 <option value="0">--Search--</option>
  35.                                 <option value="TOURS ESPECIAL">Tailor Made Tours</option>  
  36.                                 <%
  37.                                     sql="select * from  pais order by nombrepais asc "
  38.                                     Set objRS1 = conn1.Execute(sql)  
  39.                                     While not objRS1.EOF %>
  40.                                 <option value='<%=objRS1("idpais")%>'>
  41.                                     <% =objRS1("nombrepais")%>
  42.                                 </option>
  43.                                     <%objRS1.movenext%>
  44.                                     <%wend%>
  45.                                 </select>
  46.                                 <div id="nover">
  47.                                     <select name="Tour" id="Tour" onChange="pasanombretors();"  style="width:200px" >
  48.                                         <option value="0">--Search--</option>
  49.                                     </select>
  50.                                 </div><br /><br />
  51.                                                     <table width="100%" border="0" cellpadding="0" cellspacing="0" id="tourstailor" style="display:none;">
  52.                                                     <tr>
  53.                                                       <td class="textopais">Tour Code</td>
  54.                                                       <td>&nbsp;</td>
  55.                                                       <td ><input name="codTailorMade" type="text" id="codTailorMade" size="20" >
  56.                                                       <input type="button" onClick="javascript:verdetalletailormade()" value="Find"></td>
  57.                                                     </tr>
  58.                                                     <tr>
  59.                                                       <td class="textopais"> Name of your Tailor-made Trip </td>
  60.                                                       <td width="5">:</td>
  61.                                                       <td ><input name="NameTailorTours" type="text" id="NameTailorTours" size="30">                                                      </td>
  62.                                                     </tr>
  63.                                                     <tr>
  64.                                                       <td class="textopais"> Length of your Tailor-made Trip </td>
  65.                                                       <td width="5">:</td>
  66.                                                       <td ><input name="LenghtTaylorMadeTrip" type="text" id="LenghtTaylorMadeTrip" size="10">                                                      </td>
  67.                                                     </tr>
  68.                                                   </table>
  69.                             </div>
  70.                             <input name="xtitulo1" type="hidden" id="xtitulo1" value="0">

Última edición por TheDark03; 30/06/2010 a las 09:18
  #6 (permalink)  
Antiguo 30/06/2010, 09:12
 
Fecha de Ingreso: mayo-2010
Ubicación: Lima, Peru.
Mensajes: 176
Antigüedad: 13 años, 10 meses
Puntos: 6
Respuesta: problema con doctype public con funcion javascript en firefox

Código HTML:
Ver original
  1. <div class="Parametro">Arrival date</div>
  2.                             <div class="value">
  3.                                 <&#37;tmp=iif(reload,request("startdate"),"1")%>
  4.                                                         <select name="Startdate" size=1>
  5.                                                           <option value="1" <% =iif(reload and tmp="1","Selected","x")%>>1 </option>
  6.                                                           <option value="2" <% =iif(reload and tmp="2","Selected","x")%>>2 </option>
  7.                                                           <option value="3" <% =iif(reload and tmp="3","Selected","x")%>>3 </option>
  8.                                                           <option value="4" <% =iif(reload and tmp="4","Selected","x")%>>4 </option>
  9.                                                           <option value="5" <% =iif(reload and tmp="5","Selected","x")%>>5 </option>
  10.                                                           <option value="6" <% =iif(reload and tmp="6","Selected","x")%>>6 </option>
  11.                                                           <option value="7" <% =iif(reload and tmp="7","Selected","x")%>>7 </option>
  12.                                                           <option value="8" <% =iif(reload and tmp="8","Selected","x")%>>8 </option>
  13.                                                           <option value="9" <% =iif(reload and tmp="9","Selected","x")%>>9 </option>
  14.                                                           <option value="10" <% =iif(reload and tmp="10","Selected","x")%>>10 </option>
  15.                                                           <option value="11" <% =iif(reload and tmp="11","Selected","x")%>>11 </option>
  16.                                                           <option value="12" <% =iif(reload and tmp="12","Selected","x")%>>12 </option>
  17.                                                           <option value="13" <% =iif(reload and tmp="13","Selected","x")%>>13 </option>
  18.                                                           <option value="14" <% =iif(reload and tmp="14","Selected","x")%>>14 </option>
  19.                                                           <option value="15" <% =iif(reload and tmp="15","Selected","x")%>>15 </option>
  20.                                                           <option value="16" <% =iif(reload and tmp="16","Selected","x")%>>16 </option>
  21.                                                           <option value="17" <% =iif(reload and tmp="17","Selected","x")%>>17 </option>
  22.                                                           <option value="18" <% =iif(reload and tmp="18","Selected","x")%>>18 </option>
  23.                                                           <option value="19" <% =iif(reload and tmp="19","Selected","x")%>>19 </option>
  24.                                                           <option value="20" <% =iif(reload and tmp="20","Selected","x")%>>20 </option>
  25.                                                           <option value="21" <% =iif(reload and tmp="21","Selected","x")%>>21 </option>
  26.                                                           <option value="22" <% =iif(reload and tmp="22","Selected","x")%>>22 </option>
  27.                                                           <option value="23" <% =iif(reload and tmp="23","Selected","x")%>>23 </option>
  28.                                                           <option value="24" <% =iif(reload and tmp="24","Selected","x")%>>24 </option>
  29.                                                           <option value="25" <% =iif(reload and tmp="25","Selected","x")%>>25 </option>
  30.                                                           <option value="26" <% =iif(reload and tmp="26","Selected","x")%>>26 </option>
  31.                                                           <option value="27" <% =iif(reload and tmp="27","Selected","x")%>>27 </option>
  32.                                                           <option value="28" <% =iif(reload and tmp="28","Selected","x")%>>28 </option>
  33.                                                           <option value="29" <% =iif(reload and tmp="29","Selected","x")%>>29 </option>
  34.                                                           <option value="30" <% =iif(reload and tmp="30","Selected","x")%>>30 </option>
  35.                                                           <option value="31" <% =iif(reload and tmp="31","Selected","x")%>>31 </option>
  36.                                                         </select>
  37.                                                         <%tmp=iif(reload,request("startmonth"),"1")%>
  38.                                                         <select name="Startmonth" size=1>
  39.                                                           <option value="1" <% =iif(reload and tmp="1","Selected","")%>>January </option>
  40.                                                           <option value="2" <% =iif(reload and tmp="2","Selected","")%>>February </option>
  41.                                                           <option value="3" <% =iif(reload and tmp="3","Selected","")%>>March</option>
  42.                                                           <option value="4" <% =iif(reload and tmp="4","Selected","")%>>April </option>
  43.                                                           <option value="5" <% =iif(reload and tmp="5","Selected","")%>>May </option>
  44.                                                           <option value="6" <% =iif(reload and tmp="6","Selected","")%>>June </option>
  45.                                                           <option value="7" <% =iif(reload and tmp="7","Selected","")%>>July </option>
  46.                                                           <option value="8" <% =iif(reload and tmp="8","Selected","")%>>August </option>
  47.                                                           <option value="9" <% =iif(reload and tmp="9","Selected","")%>>September </option>
  48.                                                           <option value="10" <% =iif(reload and tmp="10","Selected","")%>>October </option>
  49.                                                           <option value="11" <% =iif(reload and tmp="11","Selected","")%>>November </option>
  50.                                                           <option value="12" <% =iif(reload and tmp="12","Selected","")%>>December</option>
  51.                                                         </select>
  52.                                                         <%tmp=iif(reload,request.form("startyear"),"2005")%>
  53.                                                         <select name="Startyear" size=1 id="select11">
  54.                                                           <option value="2009" <% =iif(reload and tmp="2009","Selected","")%>>2009 </option>
  55.                                                           <option value="2010" <% =iif(reload and tmp="2010","Selected","")%>>2010</option>
  56.                                                           <option value="2011" <% =iif(reload and tmp="2011","Selected","")%>>2011</option>
  57.                                                           <option value="2012" <% =iif(reload and tmp="2012","Selected","")%>>2012</option>
  58.                                                     </select>      
  59.                             </div>
  #7 (permalink)  
Antiguo 30/06/2010, 09:14
 
Fecha de Ingreso: mayo-2010
Ubicación: Lima, Peru.
Mensajes: 176
Antigüedad: 13 años, 10 meses
Puntos: 6
Respuesta: problema con doctype public con funcion javascript en firefox

Código HTML:
Ver original
  1. <div class="subtituloform">
  2.                                 <div class="descsubtituloform">Who's travelling?</div>
  3.                             </div>
  4.                             <&#37; for k=1 to n %>
  5.                             <div class="containerdata">
  6.                             <table width="498px" border=0 cellpadding=0 cellspacing=1 style="margin:4px">
  7.                                                   <tr>
  8.                                                     <td colspan=4></td>
  9.                                                     <td width="129"></td>
  10.                                                     <td width="130"></td>
  11.                                                   </tr>
  12.                                                   <tr>
  13.                                                     <td colspan="2"><div align="left" class="linktours"><b><u>Passenger <%=k%></u></b></div></td>
  14.                                                     <td width="102"></td>
  15.                                                     <td width="7"></td>
  16.                                                     <td width="129"></td>
  17.                                                     <td width="130"></td>
  18.                                                   </tr>
  19.                                                   <tr>
  20.                                                     <td width="100"></td>
  21.                                                     <td width="115"></td>
  22.                                                     <td width="102"></td>
  23.                                                     <td width="7"></td>
  24.                                                     <td width="129"></td>
  25.                                                     <td width="130"></td>
  26.                                                   </tr>
  27.                                                   <tr>
  28.                                                     <td width="90"><div>Title</div></td>
  29.                                                     <td width="115"><div>First name</div></td>
  30.                                                     <td width="102" class="textopais"><div>Surname</div></td>
  31.                                                     <td width="7" class="textopais"></td>
  32.                                                     <td width="129" class="textopais"><div>Nationality</div></td>
  33.                                                     <td width="10" class="textopais"><div>Date of birth</div></td>
  34.                                                   </tr>
  35.                                                   <tr>
  36.                                                     <td width="90"><div>
  37.                                                       <select name=Title<%=k%> size=1>
  38.                                                           <option value="Dr." selected>Dr.</option>
  39.                                                           <option value="Mr.">Mr. </option>
  40.                                                           <option value="Mrs.">Mrs. </option>
  41.                                                           <option value="Miss.">Miss.</option>
  42.                                                           <option value="Ms.">Ms.</option>
  43.                                                       </select>
  44.                                                     </div></td>
  45.                                                     <td width="115"><div align="left">
  46.                                                       <input name=Firstname<%=k%> size="14">
  47.                                                     </div></td>
  48.                                                     <td width="102"><div align="left"> <input name=Surname<%=k%> size="14"> </div></td>
  49.                                                     <td width="7"></td>
  50.                                                     <td width="129"><div align="left">                                                       <input name=Nationality<%=k%> size="15">
  51.                                                     </div></td>
  52.                                                     <td width="100"><div align="left">  <input name=DateofBirth<%=k%> id="DateofBirth<%=k%>" size="10"> </div></td>
  53.                                                   </tr>
  54.                                                   <tr>
  55.                                                     <td width="100" align=left class="textopais">                                                    </td>
  56.                                                     <td width="115" align=left class="textopais"><div>Passport Number</div></td>
  57.                                                     <td width="102" align=left class="textopais"><div>Expiry date</div></td>
  58.                                                     <td width="7" align=left class="textopais">                                                    </td>
  59.                                                     <td width="129" align=left class="textopais"><div>Place and date of Issue</div></td>
  60.                                                     <td width="130" align=left class="textopais"></td>
  61.                                                   </tr>
  62.                                                   <tr>
  63.                                                     <td width="100">
  64.                                                         <div align="left"> </div></td>
  65.                                                     <td width="115"><div align="left">
  66.                                                       <input name=Passport<%=k%> size="14">
  67. </div></td>
  68.                                                     <td width="102"><div align="left">
  69.                                                       <input name=Expirydate<%=k%> size="14">
  70.                                                     </div></td>
  71.                                                     <td width="7"> </td>
  72.                                                     <td width="129"><div align="left"> <input name=Placedateissue<%=k%> size="15">                                                    </div></td>
  73.                                                     <td width="130"></td>
  74.                                                   </tr>
  75.                                                   <tr>
  76.                                                     <td width="100"></td>
  77.                                                     <td colspan=5><font color="#666666">Please ensure that the Passport Number you have written  above is correct.</font></td>
  78.                                                   </tr>
  79.                                                 </table>
  80.                                                 </div>
  81.                                                 <% next %>
  #8 (permalink)  
Antiguo 30/06/2010, 09:17
 
Fecha de Ingreso: mayo-2010
Ubicación: Lima, Peru.
Mensajes: 176
Antigüedad: 13 años, 10 meses
Puntos: 6
Respuesta: problema con doctype public con funcion javascript en firefox

Código HTML:
Ver original
  1. <div class="subtituloform"><div class="descsubtituloform">Payment details</div></div>
  2.                               <div class="containerdata">
  3.                                     <table width="498px" border="0" align="left" cellpadding="0" cellspacing="0" style="margin:4px">
  4.                                                 <tr>
  5.                                                   <td width="182"><div align="left" ></div></td>
  6.                                                   <td width="12"></td>
  7.                                                   <td width="106"><div>Currency&nbsp;</div></td>
  8.                                                   <td width="245"><div>Amount&nbsp;&nbsp;</div></td>
  9.                                                 </tr>
  10.                                                 <tr>
  11.                                                   <td width="182"><div align="left"> <strong><font size="1">
  12.                                                     <script language="JavaScript" type="text/JavaScript">
  13.                                              var p;
  14.                                              function showURL(cmb)
  15.                                              {
  16.                                                
  17.                                                 if ( document.getElementById( 'grupo1' ).value == "TOURS ESPECIAL"  )
  18.                                                 {
  19.                                                     if(cmb.value=="Credit Card Last Minute"){
  20.                                                         p=window.open("/card.asp", "", "top=0, height=600, width=475, toolbar=no, status=yes, scrollbars=yes, menubar=no, resizable=no");
  21.                                                     }
  22.                                                     else if(cmb.value=="Credit Card with Money Bookers") {
  23.                                                         var tourchoosed = document.getElementById( "Tour" );
  24.                                                         if( tourchoosed.value != 0 ) {
  25.                                                             p=window.open("/mb_card.asp", "", "top=0, height=600, width=475, toolbar=no, status=yes, scrollbars=yes, menubar=no, resizable=no");
  26.                                                         }
  27.                                                         else {
  28.                                                             alert( "You have to choose a tour" );
  29.                                                             tourchoosed.focus();
  30.                                                         }
  31.                                                     }
  32.                                                     else if(cmb.value=="Credit Card with Secure Trading") {
  33.                                                         var tourchoosed = document.getElementById( "Tour" );
  34.                                                         if( tourchoosed.value != 0 ) {
  35.                                                             p=window.open("/stp_card.asp", "", "top=0, height=600, width=475, toolbar=no, status=yes, scrollbars=yes, menubar=no, resizable=no");
  36.                                                         }
  37.                                                         else {
  38.                                                             alert( "You have to choose a tour" );
  39.                                                             tourchoosed.focus();
  40.                                                         }
  41.                                                     }
  42.                                                 }
  43.                                                 else
  44.                                                 {
  45.                                                     if(cmb.value=="Credit Card Last Minute")
  46.                                                     {
  47.                                                         p=window.open("/card.asp", "", "top=0, height=600, width=475, toolbar=no, status=yes, scrollbars=yes, menubar=no, resizable=no");
  48.                                                     }
  49.                                                     else if(cmb.value=="Credit Card with Money Bookers") {
  50.                                                         var tourchoosed = document.getElementById( "Tour" );
  51.                                                         if( tourchoosed.value != 0 ) {
  52.                                                             p=window.open("/mb_card.asp", "", "top=0, height=600, width=475, toolbar=no, status=yes, scrollbars=yes, menubar=no, resizable=no");
  53.                                                         }
  54.                                                         else {
  55.                                                             alert( "You have to choose a tour" );
  56.                                                             tourchoosed.focus();
  57.                                                         }
  58.                                                     }
  59.                                                     else if(cmb.value=="Credit Card with Secure Trading") {
  60.                                                         var tourchoosed = document.getElementById( "Tour" );
  61.                                                         if( tourchoosed.value != 0 ) {
  62.                                                             p=window.open("/stp_card.asp", "", "top=0, height=600, width=475, toolbar=no, status=yes, scrollbars=yes, menubar=no, resizable=no");
  63.                                                         }
  64.                                                         else {
  65.                                                             alert( "You have to choose a tour" );
  66.                                                             tourchoosed.focus();
  67.                                                         }
  68.                                                     }
  69.                                                 }
  70.                                              } 
  71.                                                                                                                                                                                 </script>
  72.                                                   </font></strong> </div></td>
  73.                                                   <td width="12"></td>
  74.                                                   <td width="106"><font
  75.                   size="1">
  76.                                                     <select size="1" name="Currency">
  77.                                                       <option value="">&lt;&lt; Select Currency &gt;&gt;</option>
  78.                                                       <option value="USA" >US$</option>
  79.                                                       <option value="EURO">EU&euro;</option>
  80.                                                       <option value="GBP">GBP&pound;</option>
  81.                                                     </select>
  82.                                                   </font></td>
  83.                                                   <td width="245"><font size="1" >
  84.                                                     &nbsp;<input size="14" name="Amount" >
  85.                                                   </font></td>
  86.                                                 </tr>
  87.                                                 <tr>
  88.                                                   <td>&nbsp;</td>
  89.                                                   <td></td>
  90.                                                   <td>&nbsp;</td>
  91.                                                   <td>&nbsp;</td>
  92.                                                 </tr>
  93.                                                 <tr id="ocultadatos1" style="display:none" >
  94.                                                   <td colspan="3"><SPAN lang="ES">Deposit</SPAN></td>
  95.                                                   <td><input name="txt_precioDeposit" type="text" class="formu" id="txt_precioDeposit"  />
  96.                                                     <input type="radio" name="checkprecio" value="1" ></td>
  97.                                                 </tr>
  98.                                                 <tr id="ocultadatos2" style="display:none">
  99.                                                   <td colspan="3"><SPAN lang="ES">Final Balance Due</SPAN></td>
  100.                                                   <td><input name="txt_finalbalance" type="text" id="txt_finalbalance" class="formu"  />
  101.                                                   <input type="radio"  name="checkprecio" value="2" ></td>
  102.                                                 </tr>
  103.                                                 <tr id="ocultadatos3" style="display:none">
  104.                                                   <td colspan="3"><SPAN lang="ES">Full Payment</SPAN></td>
  105.                                                   <td><input name="txt_preciofullpayment" type="text" id="txt_preciofullpayment" class="formu"   />
  106.                                                     <input name="checkprecio" type="radio" value="3" ></td>
  107.                                                 </tr>
  108.                                                 <tr>
  109.                                                   <td>Form
  110.                                                   of payment</td>
  111.                                                   <td></td>
  112.                                                   <td colspan="2"><strong><font size="1">
  113.                                                     <select name=TypePayment size=1 id="TypePayment"  onChange="showURL(this)">
  114.                                                       <option value="" selected>&lt;&lt; Choose
  115.                                                         &gt;&gt;</option>
  116.                                                       <!---<option value="Credit Card Last Minute">Credit  -->
  117.                                                       <!--- Card Last Minute</option> -->
  118.                                                       <!---<option value="Credit Card with Money Bookers">Credit  -->
  119.                                                       <!--- Card with Money Bookers</option> -->
  120.                                                       <option value="Credit Card with Secure Trading">Credit
  121.                                                         Card with Secure Trading</option>
  122.                                                       <option value="Personal cheque">Personal
  123.                                                         cheque</option>
  124.                                                       <option value="Banker's draft/cheque">Banker's
  125.                                                         draft/cheque</option>
  126.                                                       <option value="Direct Bank Transfer">Direct
  127.                                                         Bank Transfer</option>
  128.                                                     </select>
  129.                                                   </font></strong></td>
  130.                                                 </tr>
  131.                                                 <tr>
  132.                                                   <td>&nbsp;</td>
  133.                                                   <td></td>
  134.                                                   <td>&nbsp;</td>
  135.                                                   <td>&nbsp;</td>
  136.                                                 </tr>
  137.                                             </table>
  138.                               </div>
  #9 (permalink)  
Antiguo 30/06/2010, 09:43
 
Fecha de Ingreso: mayo-2010
Ubicación: Lima, Peru.
Mensajes: 176
Antigüedad: 13 años, 10 meses
Puntos: 6
Respuesta: problema con doctype public con funcion javascript en firefox

mejor no me podrias dar tu correo para pasrtelo por q falta mas y mas XD... seria mejor o no??
  #10 (permalink)  
Antiguo 30/06/2010, 11:48
Avatar de Tecna  
Fecha de Ingreso: enero-2010
Mensajes: 291
Antigüedad: 14 años, 3 meses
Puntos: 45
Respuesta: problema con doctype public con funcion javascript en firefox

Buenas,

yo diría que el problema lo causa document.all que no es estandar y sólo lo soportan IE y Opera. Firefox lo tolera pero sólo para discriminar si tiene que ejecutar o no el código, que es para lo que se solía usar (aunque no era muy buena técnica).

Por otro lado yo empezaría por limpiar un poco el código, por ejemplo en el javascript en la función mandapais ejecutas exactamente el mismo código en el if que en el else, en ese caso el if está de más, pero si lo necesitaras, el código que se deba ejecutar en ambos casos debería ir fuera del if. También podría simplificarse haciendo funciones auxiliares que son muy útiles cuando hay que repetir código. Por ejemplo:

Código Javascript:
Ver original
  1. function ocultarUno(elem)
  2. {
  3.   document.getElementById(elem).style.display = 'none';
  4. }
  5.  
  6. function ocultarVarios(elemS)
  7. {
  8.   for (var i=0; i<elemS.length; ++i) ocultarUno(elemS[i]);
  9. }
  10.  
  11. function mandapais()
  12. {
  13.   // en lugar de usar esto
  14.   // document.getElementById("tourstailor").style.display="none";
  15.   // usar eso
  16.   ocultarUno('tourstailor');
  17.  
  18.   // o por ejemplo si son varios  
  19.   // document.getElementById("ocultadatos1").style.display="none";          
  20.   // document.getElementById("ocultadatos2").style.display="none";          
  21.   // document.getElementById("ocultadatos3").style.display="none";  
  22.   // podemos hacer esto
  23.   var elementos = ['ocultadatos1', 'ocultadatos2', ' ocultadatos3'];
  24.   ocultarVarios(elementos);  
  25.   // incluso generalizarlo más pasando un 2º parámetro con el valor
  26.   // de la propiedad display para que sirva para mostrar también.
  27.   // o incluso pasar un tercer parámetro para el nombre de la propiedad
  28.   // y que sirva también para visibility por ejemplo                
  29.  
  30. }

En la misma función usas el método get pero luego en el ASP y en el HTML usas el método post, no se si eso pueda darte problemas...

También utilizas algunas etiquetas y atributos relacionados con estilos como <font> <u> o align, color, width que estan desaconsejados, es mejor separar los estilos en ficheros .css independientes, queda más claro, es más fácil de modificar o de incluir en otras páginas por ejemplo. En general esto se puede aplicar también al resto de código y separar el html del js...

Ya que te preocupaba la accesibilidad ten en cuenta que los formularios necesitan un action y un submit para cuando no esté disponible ajax ni javascript
  #11 (permalink)  
Antiguo 30/06/2010, 12:22
 
Fecha de Ingreso: mayo-2010
Ubicación: Lima, Peru.
Mensajes: 176
Antigüedad: 13 años, 10 meses
Puntos: 6
Respuesta: problema con doctype public con funcion javascript en firefox

Hola Tecna gracias x responder.. pero en vez de usar document.all q sugieres q ponga o un window.document.all o q como hago para q firefox lo soporte
gracias
  #12 (permalink)  
Antiguo 30/06/2010, 14:15
Avatar de zerokilled
Javascripter
 
Fecha de Ingreso: abril-2009
Ubicación: Isla del Encanto, La Borinqueña [+>==]
Mensajes: 8.050
Antigüedad: 15 años
Puntos: 1485
Respuesta: problema con doctype public con funcion javascript en firefox

: la proxima vez indicanos la URL si es demasiado codigo. solo vi el código de tu primer mensaje, el resto casi lo ignore cuando me fije que hay mucho más. y no, no te puedo atender por correo privado ya que va en contra de las política a menos que fuera un trabajo remunerado. por lo pronto, me fije lo mismo que Tecna, document.all. la solución depende, tienes que cambiarlo por document.getElementById() si el elemento contiene atributo ID. y si tiene atributo name, también depende si el elemento esta dentro de un formulario que a su vez tiene name o id. o lo más fácil, asígnale a cada elemento un ID pero ninguno se puede repetir.
__________________
la maldad es una virtud humana,
y la espiritualidad es la lucha del hombre contra su maldad.
  #13 (permalink)  
Antiguo 30/06/2010, 18:12
 
Fecha de Ingreso: mayo-2010
Ubicación: Lima, Peru.
Mensajes: 176
Antigüedad: 13 años, 10 meses
Puntos: 6
Respuesta: problema con doctype public con funcion javascript en firefox

Bueno gracias a todos por responder... les escribo q ya solucione mi problema de javascript hice algo ingenioso y digamos q algo vago XD :P.. por q mi problema era es q si se ejecutaba bien en Firefox y en el resto de browser pero en el IE era un desmadre total con el css.. pero el detalle se soluciono x cortesia de Chik_pink

aca les dejo su solucion algo ingenioso

<!--[if lte IE 6]>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<![endif]-->
<!--[if lte IE 7]>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<![endif]-->

PD: La chik Pink ta rebuena :P

pero es una solucion momentanea... mientras tanto q me keda

Última edición por TheDark03; 30/06/2010 a las 18:32
  #14 (permalink)  
Antiguo 30/06/2010, 18:20
 
Fecha de Ingreso: mayo-2010
Ubicación: Lima, Peru.
Mensajes: 176
Antigüedad: 13 años, 10 meses
Puntos: 6
Respuesta: problema con doctype public con funcion javascript en firefox

ahh y gracias desde ahora trabajare con document.getElementById()..

Saludos

Etiquetas: doctype, firefox, funcion, public
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 23:27.