Click to See Complete Forum and Search --> : Troubles creanting new function.


xondokan
12-12-2003, 12:03 PM
Hi.

I have this function in the "opener" window:

function Do_Dell_Row(id_row) {
var obj_Row = document.getElementById(id_row);
var obj_TBody = obj_Row.parentElement;
var TBody_Rows = obj_TBody.rows;
var i;
for (i=1; i<TBody_Rows.length; i++)
if (TBody_Rows(i).id == id_row)
obj_TBody.deleteRow(i)
}


And I have this piece of code in a popup window:

obj_Cell = window.opener.document.createElement("TD");
obj_Cell.appendChild(window.opener.document.createTextNode('['));
obj_Font = window.opener.document.createElement("FONT");
obj_Font.color = '#FF0000'
obj_Font.style.cursor = 'hand';
obj_Font.onclick = new Function("Do_Dell_Row('row_ad_" + n + "')");
obj_Text = window.opener.document.createTextNode('eliminar');
obj_Font.appendChild(obj_Text);
obj_Cell.appendChild(obj_Font);
obj_Cell.appendChild(window.opener.document.createTextNode(']'));
obj_Row.appendChild(obj_Cell);

Anyone knows how can i make the red colored font work?!?

olerag
12-12-2003, 12:07 PM
I don't know what your code is doing but I would wrap that
"for" loop with opening/closing braces.

xondokan
12-12-2003, 12:13 PM
well the second piece of code is on a popup window and creates an "font" object on the "opener" window... and it should call a function wich is placed on the opener window on the event onclick of the "font" object.

xondokan
12-12-2003, 12:16 PM
This shoul'd make it simpler:

obj_Font = window.opener.document.createElement("FONT");
obj_Font.style.cursor = 'hand';
obj_Font.onclick = new Function("alert('YO')");
obj_Text = window.opener.document.createTextNode('eliminar');
obj_Font.appendChild(obj_Text);

Anyone knows how can i make the red colored code work?!?