Ir para conteúdo
Fórum Script Brasil
  • 0

Olá Uma Ajuda Em Um Editor .


Kevin

Pergunta

Bom galera eu consegui esse editor aki o htmlarea , mas ele está com um erro quando vo enserir tabelas e talss gostaria se vo6 q sabem de Javascript pudesem dar uma força ae para mim bom deem uma olhada no erro e o arquivo

O erro é o seguinte

Linha 14

caractere 1

error 'opener.document.all[...].config' é nulo ou não é um objeto

codigo 0

e o arquivo q da o erro

isso quando eu clicko para abrir a pagina de inserir tabela

se alguém puder me dar uma força valeu

<script>

// if we pass the "window" object as a argument and then set opener to

// equal that we can refer to dialogWindows and popupWindows the same way

opener = window.dialogArguments;

var _editor_url = opener._editor_url;

var objname    = location.search.substring(1,location.search.length);

var config      = opener.document.all[objname].config;

var editor_obj  = opener.document.all["_" +objname+  "_editor];

var editdoc    = editor_obj.contentWindow.document;

function _CloseOnEsc() {

  if (event.keyCode == 27) { window.close(); return; }

}

window.onerror = HandleError

function HandleError(message, url, line) {

  var str = "An error has occurred in this dialog." + "\n\n"

  + "Error: " + line + "\n" + message;

  alert(str);

//  window.close();

  return true;

}

function Init() {

  document.body.onkeypress = _CloseOnEsc;

}

function _isValidNumber(txtBox) {

  var val = parseInt(txtBox);

  if (isNaN(val) || val < 0 || val > 9999) { return false; }

  return true;

}

function btnOKClick() {

  var curRange = editdoc.selection.createRange();

  // error checking

  var checkList = ['rows','cols','border','cellspacing','cellpadding'];

  for (var idx in checkList) {

    var fieldname = checkList[idx];

    if (document.all[fieldname].value == "") {

      alert("You must specify a value for the '" +fieldname+ "' field!");

      document.all[fieldname].focus();

      return;

    }

    else if (!_isValidNumber(document.all[fieldname].value)) {

      alert("You must specify a number between 0 and 9999 for '" +fieldname+ "'!");

      document.all[fieldname].focus();

      return;

    }

  }

  // delete selected content (if applicable)

  if (editdoc.selection.type == "Control" || curRange.htmlText) {

    if (!confirm("Overwrite selected content?")) { return; }

    curRange.execCommand('Delete');

    curRange = editdoc.selection.createRange();

  }

  // create table

  var table = '<table border="' +document.all.border.value+ '"'

            + ' cellspacing="' +document.all.cellspacing.value+ '"'

            + ' cellpadding="' +document.all.cellpadding.value+ '"'

            + ' width="' +document.all.width.value + document.all.widthExt.value+ '"'

            + ' align="' +document.all.alignment.value+ '">\n';

  for (var x=0; x<document.all.rows.value; x++) {

    table += " <tr>\n";

    for (var y=0; y<document.all.cols.value; y++) {

      table += "  <td></td>\n";

    }

    table += " </tr>\n";

  }

  table += "</table>\n";

  // insert table

  opener.editor_insertHTML(objname, table);

  // close popup window

  window.close();

}

</SCRIPT>

Link para o comentário
Compartilhar em outros sites

2 respostass a esta questão

Posts Recomendados

Participe da discussão

Você pode postar agora e se registrar depois. Se você já tem uma conta, acesse agora para postar com sua conta.

Visitante
Responder esta pergunta...

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emoticons são permitidos.

×   Seu link foi incorporado automaticamente.   Exibir como um link em vez disso

×   Seu conteúdo anterior foi restaurado.   Limpar Editor

×   Você não pode colar imagens diretamente. Carregar ou inserir imagens do URL.



  • Estatísticas dos Fóruns

    • Tópicos
      152,2k
    • Posts
      651,9k
×
×
  • Criar Novo...