2011-05-29 6 views
5

Probé mi sitio con el nuevo IE 9 y me aparece el error que me dice INVALID_CHARACTER_ERR (5). En IE 9, las herramientas de desarrollador destacan esta línea. ¿Alguien puede ayudarme con este error?Javascript: DOM Excepción: INVALID_CHARACTER_ERR (5)

error Línea

this.iframe = document.createElement('<IFRAME src="' + myCurrentUrl + '" frameborder=0>'); 


Function Code 
__createDivs : function() 
{ 
this.divs_transparentDiv = document.createElement('DIV'); 
this.divs_transparentDiv.className='modalDialog_transparentDivs'; 
this.divs_transparentDiv.style.left = '0px'; 
this.divs_transparentDiv.style.top = '0px'; 
document.body.appendChild(this.divs_transparentDiv); 
this.divs_content = document.createElement('DIV'); 
this.divs_content.className = 'modalDialog_contentDiv'; 
this.divs_content.id = 'DHTMLSuite_modalBox_contentDiv'; 
this.divs_content.style.zIndex = 100000; 
if(this.MSIE){ 
var myCurrentUrl = GlobPanelCurrentBaseUrl + 'images/spacer.gif'; 
this.iframe = document.createElement('<IFRAME src="' + myCurrentUrl + '" frameborder=0>'); 
this.iframe.style.zIndex = 90000; 
this.iframe.style.position = 'absolute'; 
document.body.appendChild(this.iframe); 
} 
document.body.appendChild(this.divs_content); 
this.divs_shadow = document.createElement('DIV'); 
this.divs_shadow.className = 'modalDialog_contentDiv_shadow'; 
this.divs_shadow.style.zIndex = 95000; 
document.body.appendChild(this.divs_shadow); 
window.refToModMessage = this; 
this.addEvent(window,'scroll',function(e){ window.refToModMessage.__repositionTransparentDiv() }); 
this.addEvent(window,'resize',function(e){ window.refToModMessage.__repositionTransparentDiv() }); 
} 
+2

FYI, versiones antiguas de IE permitió le permite pasar HTML arbitrario a createElement, pero eso es una violación de la especificación. – Neil

Respuesta

10

propiedades Sí, se supone que sólo le dan el nombre del elemento, y luego puesto en ello de esta manera:

this.iframe = document.createElement('iframe'); 
this.iframe.src = myCurrentUrl; 
this.iframe.frameBorder = 0; 
+0

Gracias, solo pude solucionarlo usando el siguiente this.iframe = document.createElement ("iframe"); this.iframe.setAttribute ("src", myCurrentUrl); this.iframe.setAttribute ("estilo", "posición: absoluta; índice z: 90000;"); this.iframe.frameBorder = 0; –

Cuestiones relacionadas