I have an interesting problem and did not know of this condition in IE. There is in the site that I got for maintenance, a call like this: document.getElementByID(...)
. Well, what happens is that IE is not getting ID
, but Name
, because there is no ID and yes Name. Well, in Chrome
this does not work (correct). What I did, I changed calls to: document.getElementsByName(...)
. Well, it should work and it does not work. Give this error over jquery-ui.min.js
:
Uncaught TypeError: a.plugins[n].push is not a function
This is my js code. The element is IFConsultaEmpresa_
:
if (pObjAsp != 'X') {
pagina = pTxtDiretorio + pObjAsp + '?pt=' + pTxtNomeFuncao + p_parametros;
var cp = new cpaint();
cp.set_transfer_mode('get');
cp.set_debug(false);
cp.call('../../atc/asp/atc0006c.asp', 'auxHistNavegacao', '', pCodFuncao, pTxtDiretorio, pTxtNomeFuncao, pNumeroIframe);
//torna o iframe invisivel
for (var i = 1; i <= qtd_iframe; i++) {
//eval('document.getElementById(\'IFConsultaEmpresa_' + i + '\').height = \'0%\';');
//Essa alteração para ByName foi necessária para funcionar no Chrome
eval('document.getElementsByName(\'IFConsultaEmpresa_' + i + '\').height = \'0%\';');
eval('document[\'all\'].IFConsultaEmpresa_' + i + '.style.display = \'none\';');
}
eval('boolIFrame = (IFConsultaEmpresa_' + pNumeroIframe + '.location == \'about:blank\')');
form01.ifram_carregado.value = 'IFConsultaEmpresa_' + pNumeroIframe;
if (pCodFuncao == 'ATC84.5.4' || pCodFuncao == 'ATC84.5.5' || pCodFuncao == 'ATC84.5.6' ||
pCodFuncao == 'ATC84.2.2.2' || pCodFuncao == 'ATC84.2.2.3' ||
pCodFuncao == 'ATC84.8.2.1' || pCodFuncao == 'ATC84.8.2.2'
) {
boolIFrame = true;
}
if (!boolIFrame & pNumeroIframe == '1') {
//iframe1 exclusívo para abertura/encerramento de atendimento - alteração novo atendimento
boolIFrame = true;
}
if (boolIFrame) {
eval('document[\'all\'].IFConsultaEmpresa_' + pNumeroIframe + '.src = \'' + pagina + '\';');
}
eval('document[\'all\'].IFConsultaEmpresa_' + pNumeroIframe + '.style.display = \'\';');
//eval('document.getElementById(\'IFConsultaEmpresa_' + pNumeroIframe + '\').height = \'50%\';');
//Colocado para funcionar no Chrome
eval('document.getElementsByName(\'IFConsultaEmpresa_' + pNumeroIframe + '\').height = \'50%\';');
}
}
try {
window.parent['roteiro'].location = '../../ace/ace040a.asp?cod_funcao=' + pCodFuncao;
} catch (e) {}
if (form01.ind_visualiza_roteiro.value == 'S') {
try {
parent.document['all'].td_roteiro.style.display = '';
} catch (e) { }
}
}
Here is my html with this element:
<iframe width="100%" height="0%" scrolling="auto" name="IFConsultaEmpresa_<%Response.write intI%>" id="Iframe2" src="about:blank" frameBorder="no" style="display:" >
</iframe>
See IFConsultaEmpresa_
is the name and not the ID. How do I resolve this?