Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Something Wrong? IE works but Firefox ...

Reply
Thread Tools

Something Wrong? IE works but Firefox ...

 
 
alvarojaviervera@gmail.com
Guest
Posts: n/a
 
      05-06-2007
Allways I think Firefox was strong, enough ... and so far THE BEST Web-
browser (That what I Think) but, now Im fighting with it, may be Im
doing something wrong (of course that is what happend to me)

....
<script LANGUAGE="JavaScript">
<!--
var msg1="";
var msg2="";
function Mostrar(valor)
{
var
msg1=window.document.formulario2.seccionA.options[formulario2.seccionA.selectedIndex].value;
var
msg2=window.document.formulario2.proveedorA.option s[formulario2.proveedorA.selectedIndex].value;
var seccion='&seccion=' + msg1;
var proveedor='&proveedor=' + msg2;
location.replace(valor + seccion + proveedor);
}
//-->
</script>
<tr>
<td bgcolor="#cedfea"><div style="position:relative;top:8px;left:
35px; float:left;z-index:2;" class="titulos1">Detalle</div>
<div style="position:relative;top:0px;left:-30px;z-index:
1;float:left"><img src="../global/img/fondo_titulo2.gif" alt=""
border="0"></div>
<div style="position:relative;top:3px;left:30px;z-index:
1;float:left">
<form action="nada" method="GET" name="formulario2"
id="formulario2">
<select name="seccionA" style="width:150px;padding:
2px;height:17px;">
<!-- BEGIN option1 -->
<option value={valopt1}>{opt1}</option>
<!-- END option1 -->
</select>
</div>
<div style="position:relative;top:3px;left:50px;z-index:
1;float:left">
<select name="proveedorA" style="width:150px;padding:2px;height:
17px;">
<!-- BEGIN option2 -->
<option value={valopt2}>{opt2}</option>
<!-- END option2 -->
</select>
</form>
</div>
<div style="float:right; margin-top:4px;"><A
href="javascript:Mostrar('{additem}');"><img src="../global/img/
agregar.jpg" alt="" width="26" height="20" border="0" style="margin-
right:4px;"></a><A href="{delitem}"><img src="../global/img/
eliminar.jpg" alt="" width="26" height="20" border="0" style="margin-
right:4px;"></A><A href="{refresh}"><img src="../global/img/ok.jpg"
alt="" width="26" height="20" border="0" style="margin-right:4px;"></
A></div></td>
</tr>

Ok, IŽll try to explain what does do that. (My english is very WEAK)
now Im using some TPL - Pear functions. My idea is take a pair of html
- select - options to send a selection of this to a PHP (for update
old info). (Nothing AJAX yet I hope soon implement something about
this if you know some easy and good manual tell me - I was googling
for everywhere but I just sink)
Between <BEGIN option1> and <END option1> (the same with option2) I
load a pair of value.
With var {refresh}I send my PHP file catcher. Is where data will sent.

So, I just use JScript to click in A Href to call a JScript function
for make a redirect to my PHP. with this two parameters.
This Kind of code work in IExplorer 6 and 7, but in my Dear Firefox
didnŽt, do you know why? Thanks for your support!
Alvaro J. Vera.-

 
Reply With Quote
 
 
 
 
David Dorward
Guest
Posts: n/a
 
      05-06-2007
On May 6, 1:00 am, "(E-Mail Removed)"
<(E-Mail Removed)> wrote:
> Allways I think Firefox was strong, enough ... and so far THE BEST Web-
> browser (That what I Think) but, now Im fighting with it, may be Im
> doing something wrong (of course that is what happend to me)


> <script LANGUAGE="JavaScript">


Unless you are working with HTML 3.2, which would be a very odd
choice, your HTML is invalid. Broken HTML is a shaky foundation to
build JavaScript on.

> <!--


These comments are worthless today, they're there to hide the JS from
Netscape 2 era browsers.

> var msg1="";
> var msg2="";
> function Mostrar(valor)
> {
> var msg1


You have a variable called msg1 in the global scope (an empty string)
and now you create another one scoped to this function. Are you sure
you want to do that?

> =window.document.formulario2.seccionA.options[


Most people leave the "window" off that. I'd also suggest using:

document.forms['forumulario2'].elements['seccionA'].options for
clarity.

> formulario2.seccionA.selectedIndex].value;


formulario2 is undefined here... but the JavaScript console (or
Firebug) on Firefox should have told you that.

> </script>
> <tr>


I take it back. You aren't writing HTML 3.2, that is just plain
invalid. Use a validator.
http://validator.w3.org/

 
Reply With Quote
 
 
 
Reply

Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Something works in Python but not in cgi. atalucas@gmail.com Python 1 10-14-2011 01:37 PM
Re: same DLL (ASP.NET), but include only works for aspx but not fo David Wang ASP .Net 0 12-01-2006 01:42 AM
When I turn on my PC, it works, works, works. Problem! Fogar Computer Information 1 01-17-2006 12:57 AM
[py2exe.i18n] English works, German works, but not French. What do I miss? F. GEIGER Python 3 08-06-2004 10:01 AM
After rebooting my PC works, works, works! Antivirus problem? Adriano Computer Information 1 12-15-2003 05:30 AM



Advertisments