Hallo,
ich hatte schon mal gefragt:
ich habe folgendes Problem. Das Log kopiert den gesamten html-Code aus dem Hauptfenster. Dort ist ein <embed> Tag mit einer Sound Datei intregiert. Nun ist meine Frage wie ich ihn mit einem javascript entfernen kann?
Dann wurde das vorgeschlagen:
Fuer das erste embed-Element (Index 0):
document.getElementsByTagName("body")[0].removeChild(document.getElementsByTagName("embed")[0]);
MfG, Thomas
----------------------------------------------------------
Ich bekomme es nicht hin, das der Sound nicht ertönt. Anbei das Script wo ich es gerne einbauen würde.
Wäre Klasse wenn mir jemand helfen könnte. Vielen Dank.
----------------------------------------------------------
function openLog(width,height)
{
var left = (screen.availWidth-width)/2;
var top = (screen.availHeight-height)/2;
var toDo = "";
if (parent.log)
toDo += parent.log;
if (parent.messages && parent.messages.document && parent.messages.document.body && parent.messages.document.body.innerHTML)
{
var text = parent.messages.document.body.innerHTML;
if (text.indexOf('Wladimir Palant -->'))
text=text.substr(text.indexOf('Wladimir Palant -->')+19);
toDo += text;
}
var html = '{DOFILTER|escape_js}{INCLUDE|log_top}{ENDDO}\n';
var lines = toDo.split("\n");
var isScript = 0;
for (var i=0;i<lines.length;i++)
{
if (!isScript && lines[i].match(/<script>/i))
isScript = 1;
else if (isScript && lines[i].match(/</script>/i))
isScript = 0;
else if (!isScript)
{
lines[i]=lines[i].replace(/ onclick="[^"]*"/ig,"").replace(/ href="javascript:[^"]*"/ig," href="javascript:void(0)"");
html += lines[i]+'\n';
}
}
html += '{DOFILTER|escape_js}{INCLUDE|log_bottom}{ENDDO}';
var wnd = window.open('','log','resizable=yes,scrollbars=yes,width='+width+',height='+height+',left='+left+',top='+top);
wnd.document.open('text/html; charset={GET_JS|$current_language.charset}');
wnd.document.writeln(html);
wnd.document.close();
wnd.htmlcode = html;
wnd.focus();
}
---------------------------------------------------------------
Die Sound Datei wird wie folgt aufgerufen.
{IF|$current_user.welcome}
<embed src="http://www.domain.de/STChat/chat.wav";autostart="true" hidden="true" volume="80%"></embed>
{ENDIF}