Removing a part using innerHtml='' ?

  • Thread starter Thread starter Edwin Knoppert
  • Start date Start date
E

Edwin Knoppert

Can this be done?
I want to avoid the alert comming back on back and forwards navigation.
Hmm, maybe a var (boolean)?

(Don't mention the js execution-flow itself, it is presented odd )


<div id="div_msgbox_onloadalertmb">
<script language=javascript>
function msgbox_onloadalertmb(){
alert('hello2');
document.getElementById('div_msgbox_onloadalertmb').innerHTML='';
}
</script>

</div>

<script language=javascript>
msgbox_onloadalertmb();
</script>
 
once parsed, the script is part of the scripts collection, not a child of
the div. just replace the function def with a nop.

<script language=javascript>
function msgbox_onloadalertmb(){
alert('hello2');
window.msgbox_onloadalertmb = new function() {};
}

this of course will not do what you want though. the original rendered page
is stored in the cache, not the results after the script runs.

-- bruce (sqlwork.com)
 
Thanks, i'll abandon this :)


Bruce Barker said:
once parsed, the script is part of the scripts collection, not a child of
the div. just replace the function def with a nop.

<script language=javascript>
function msgbox_onloadalertmb(){
alert('hello2');
window.msgbox_onloadalertmb = new function() {};
}

this of course will not do what you want though. the original rendered
page is stored in the cache, not the results after the script runs.

-- bruce (sqlwork.com)
 
Back
Top