Funcao javascript

0 respostas
R

Tenho essa função ai emabixo ela funciona no IE, mas não no firefox alguém sabe o que eu poderia fazer pra funcionar no firefox?

function updateHistory() {

var frameContainer = document.getElementById(frameContent);

if (frameContainer == null){

return false;

} // if

if (frameContainer.src == ‘’){

return false;

}
// título e caminho da página atual
      var documentTitle    = frameContainer.contentDocument.title;
      var documentLocation = frameContainer.contentDocument.location.href;

      //var oOption = null;
      var history = null;
      try{
        // se é uma Exceção ou não tem título...dispara
        if ((documentTitle == "Exceção") || (documentTitle == ""))
          return false;
        // nossa lista de navegação
        history = document.getElementById('history');
        // se não achamos a lista de navegação...dispara
        if (history == null)
          return false;
        // procura pelo item na lista
        for (var i=0; i<history.options.length; i++) {
          // se  existe na lista...
          if (history.options[i].text == documentTitle) {
            // seleciona-o
            history.selectedIndex = i;
            // dispara
            return false;
          } // if
        } // for
        // se chegou até aqui...não encontramos a página na lista
        history.options[history.options.length] = new Option(documentTitle, documentLocation, true, true);
        // se  tem mais de 10 itens...remove o primeiro
        if (history.options.length > 10)
          history.options.remove(0);
        return true;
      } catch (e) {
        alert (e);
        return false;
      }
    }
Criado 10 de junho de 2010
Respostas 0
Participantes 1