Fix JS error in IE. fixes #2089

git-svn-id: https://develop.svn.wordpress.org/trunk@3323 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2005-12-18 15:50:53 +00:00
parent 9822179cea
commit 131a432b29

View File

@ -163,7 +163,7 @@ addLoadEvent(newCatAddIn);
function getResponseElement() { function getResponseElement() {
var p = document.getElementById('ajaxcatresponse'); var p = document.getElementById('ajaxcatresponse');
if (!p) { if (!p) {
p = document.createElement('p'); p = document.createElement('span');
document.getElementById('jaxcat').appendChild(p); document.getElementById('jaxcat').appendChild(p);
p.id = 'ajaxcatresponse'; p.id = 'ajaxcatresponse';
} }
@ -187,7 +187,6 @@ function newCatInteractive() {
function newCatCompletion() { function newCatCompletion() {
var p = getResponseElement(); var p = getResponseElement();
// alert(ajaxCat.response);
var id = 0; var id = 0;
var ids = new Array(); var ids = new Array();
var names = new Array(); var names = new Array();
@ -195,8 +194,7 @@ function newCatCompletion() {
ids = myPload( ajaxCat.response ); ids = myPload( ajaxCat.response );
names = myPload( newcat.value ); names = myPload( newcat.value );
for ( i = 0; i < ids.length; i++ ) { for ( i = 0; i < ids.length; i++ ) {
id = ids[i]; id = ids[i].replace(/[\n\r\l]+/g, "");
// alert(id);
if ( id == '-1' ) { if ( id == '-1' ) {
p.innerHTML = "<?php echo addslashes(__("You don't have permission to do that.")); ?>"; p.innerHTML = "<?php echo addslashes(__("You don't have permission to do that.")); ?>";
return; return;