Foros del Web » Programando para Internet » Javascript »

problema con javascript no funciona en Firefox

Estas en el tema de problema con javascript no funciona en Firefox en el foro de Javascript en Foros del Web. hola amigos, veran tengo el siguiente codigo que uso para redimencionar un iframe con relacion al alto del contenido. @import url("http://static.forosdelweb.com/clientscript/vbulletin_css/geshi.css"); Código Javascript : Ver ...
  #1 (permalink)  
Antiguo 23/09/2010, 16:56
Avatar de kalvinman  
Fecha de Ingreso: octubre-2006
Ubicación: Bogota Colombia
Mensajes: 849
Antigüedad: 17 años, 6 meses
Puntos: 22
Pregunta problema con javascript no funciona en Firefox

hola amigos, veran tengo el siguiente codigo que uso para redimencionar un iframe con relacion al alto del contenido.

Código Javascript:
Ver original
  1. <script type="text/javascript">
  2. // Dynamic Iframe loader
  3. function loadIframe(theURL) {
  4.     document.getElementById("mainContent").src=theURL;
  5. }
  6.  
  7. // resizes Iframe according to content
  8. function resizeMe(obj){
  9. docHeight = mainContent.document.body.scrollHeight
  10.  obj.style.height = docHeight + 'px'
  11.  }
  12. </script>

el problema es que funciona perfecto en explorer, en chrome, y mejor dicho en todos, menos en firefox????
  #2 (permalink)  
Antiguo 04/10/2010, 09:27
 
Fecha de Ingreso: octubre-2010
Mensajes: 2
Antigüedad: 13 años, 7 meses
Puntos: 0
Respuesta: problema con javascript no funciona en Firefox

Cita:
Iniciado por kalvinman Ver Mensaje
hola amigos, veran tengo el siguiente codigo que uso para redimencionar un iframe con relacion al alto del contenido.

Código Javascript:
Ver original
  1. <script type="text/javascript">
  2. // Dynamic Iframe loader
  3. function loadIframe(theURL) {
  4.     document.getElementById("mainContent").src=theURL;
  5. }
  6.  
  7. // resizes Iframe according to content
  8. function resizeMe(obj){
  9. docHeight = mainContent.document.body.scrollHeight
  10.  obj.style.height = docHeight + 'px'
  11.  }
  12. </script>

el problema es que funciona perfecto en explorer, en chrome, y mejor dicho en todos, menos en firefox????




Hola si no me equivoco te funcionara asi si modificas estas lineas de codigo

function resizeMe(obj){
docHeight = mainContent.document.body.scrollHeight
/*aqui cambia*/
var obj=document.getElementById(obj);
obj.style.height = docHeight + 'px'
}
  #3 (permalink)  
Antiguo 04/10/2010, 09:41
 
Fecha de Ingreso: octubre-2010
Mensajes: 2
Antigüedad: 13 años, 7 meses
Puntos: 0
Respuesta: problema con javascript no funciona en Firefox

yo tengo otro problema con java scripts chicos
q el codigo de java scripts referenciado en un archivo no funciona,
es algo curioso porque antes de formatear mi maquina me funcionaba en ambos navegadores pero ahora solo en IE y en Firefox ya no

les dejo el codigo:


utilizo:

seon.js,pjava.php,dentro de un servidor local,q se instalo con el appserver
funciona bien en IE y Google Clrome pero no sucede nada en Firefox
------------------------------------------------------------------
Me da la impresion q en Firefox no reconoce esta linea
por eso no se ejecuta

<script type="text/javascript" src="seon.js" charset="utf-8"></script>
------------------------------------------------------------------

----------------
seon.js
----------------

///////////////////////////////PROBANDO//////////////////////////
function seo(obj1,obj2,obj3){
alert("entro");
var contenido=document.getElementById(obj1);
var mascara=document.getElementById(obj2);
var dialogo=document.getElementById(obj3);

dialogo.className='prueva-dialog';//lo q esta arriba
dialogo.style.visibility='visible';
////////////////////////////////////////POSICIONAMIENTO DEL MENSAJE EN AL PAGUINA///////////////////////////////
var width = pageWidth();
var height = pageHeight();
var left = leftPosition();
var top = topPosition();
var dialogwidth = dialogo.offsetWidth;
var dialogheight = dialogo.offsetHeight;
var topposition = top + (height / 3) - (dialogheight / 2);
var leftposition = left + (width / 2) - (dialogwidth / 2);
dialogo.style.top = (50+topposition) + "px";
dialogo.style.left = leftposition + "px";

////////////////////////////////////////
contenido.className='prueva-content'; //lo q esta abajo
//contenido.style.overflow='hidden';
mascara.className='prueva-mask'; //capa de opacidad
mascara.style.visibility='visible';
//permite sacar la altura de otro control q ya posee

//var altura=(contenido.offsetHeight+document.getElement ById(obj4).offsetHeight);
//mascara.style.height =altura+ 'px';
/////////pruevas/////////

var altura=(document.getElementById('seos').offsetHeig ht+document.getElementById('seos2').offsetHeight);
mascara.style.height =altura+ 'px';
}

function seocerrar(obj1,obj2)
{
var mascara=document.getElementById(obj1);
var dialogo=document.getElementById(obj2);
mascara.style.visibility='hidden';
dialogo.className='prueva-close';//cerramos
dialogo.style.visibility='hidden';
document.getElementById('msgValidate').style.visib ility='hidden';//mas directo
//pruevas
var contect=document.getElementById('contenido');
//contect.style.height='auto';
contect.style.overflow='hidden';
contect.style.background='#FFFFFF';
}

//estados de la ventana////////////

// calculate the current window width //
function pageWidth() {
return window.innerWidth != null ? window.innerWidth : document.documentElement && document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body != null ? document.body.clientWidth : null;
}

// calculate the current window height //
function pageHeight() {
return window.innerHeight != null? window.innerHeight : document.documentElement && document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body != null? document.body.clientHeight : null;
}

// calculate the current window vertical offset //
function topPosition() {
return typeof window.pageYOffset != 'undefined' ? window.pageYOffset : document.documentElement && document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop ? document.body.scrollTop : 0;
}

// calculate the position starting at the left of the window //
function leftPosition() {
return typeof window.pageXOffset != 'undefined' ? window.pageXOffset : document.documentElement && document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft ? document.body.scrollLeft : 0;
}
----------------------------------------------------
Aqui empieza el php (pjava.php)
----------------------------------------------------
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />

<title>Actualizar Perfil</title>
<script type="text/javascript" src="seon.js"></script>

</head>

<body>
<div id="maskBlog" name="maskBlog">
</div>



<div id="seos2" class="content_wrapper" style="">
<div style=" "id="contenido">





</div>


<button type="submit" style=" float: right; background: #3399FF; border: 1px #000000; width: 165px; font-family: 'Arial Narrow'; font-size:16px; color: #FFFFFF; cursor:pointer;"
onclick="seo('content_frame','maskBlog','PerfilDia logComentario');">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Actualizar Perfil
</button>

<div id="PerfilDialogComentario" style="padding: 10px 10px 10px 20px; position:absolute; visibility: hidden; width: 470px; border:1px black; height: auto; left: 199px; top: 502px;">
<div style=" display: inline; ">
<div style=" float:left; padding: 0px 0px 10px 0px;width: 380px;color: #006699;">aqui va el commentario</div>
<div style=" float:right; height: 24px; font-family:Arial; font-size:20px; font-weight:bold;border:1px black; color:#0181E9; width: 14px; cursor:pointer; "
onclick="seocerrar('maskBlog','PerfilDialogComenta rio');" class="" >
x
</div>
</div>
<div id="comentando" style="width: 463px">
<form action="" method="post" style="width: 443px">
<label>para</label>
<input class="small" type="text" name="txtname" onfocus="sifocustext('txtname');" onBlur="nofocustext('txtname');"/>
<label>Motivo</label>
<input class="small" type="text" name="txtmotivo" onfocus="sifocustext('txtmotivo');" onBlur="nofocustext('txtmotivo');"/>
<label>Contenido</label>
<textarea class="area_large" name="txtcontenido" onfocus="sifocustextarea('txtcontenido');" onBlur="nofocustextarea('txtcontenido');" style="width: 461px; height: 120px;"></textarea>
<div id="msgValidate" style="; position:absolute;visibility: hidden;padding:10px 10px 10px 10px; left:343px; top:64px; width:119px; height:79px; bottom: 25px; " >
<div id="msgContentValidate" class="" style=" font-family:Arial Narrow; font-size: 16px;" >Falta ingresar algunos datos</div>

</div>
<input class="" type="hidden" name="txttitulo" value="<? echo $titulo;?>" style=" height:1px;" />
<input class="" type="hidden" name="txtid" value="<? echo $id;?>" style="height:1px;" />

</form>
</div>

<div style="float: right; height: 30px; padding: 10px 10px 0px 10px;">
<button type="submit" style=" float: right; background: #3399FF; border: 1px #000000; width: 141px; font-family: 'Arial Narrow'; font-size:16px; color: #FFFFFF; cursor:pointer;"
onclick="javascript:grabarBlogComentario('txtid',' txtname','txtmotivo','txttitulo','txtcontenido','m sgValidate');">
&nbsp;&nbsp;&nbsp; Enviar Comentario
</button>
</div>
</div>
</div>

</body>

</html>

-------------------------------------
Gracias por su apoyo
-------------------------------------

Etiquetas: firefox
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 19:44.