B
batham
Hi Gurus,
How can I execute a script during runtime. Here is my code, so how do I
execute the new script during runtime which should be a part of the
'topDiv'.
Thanks Help is appreciated.
- Shailendra
------- CODE ----------------
<html>
<title></title>
<script>
function GetNew() {
document.getElementById('topDiv').innerHTML = '';
var scElement = document.createElement('script');
scElement.id = 'NewScript1';
scElement.language = 'javascript';
scElement.type = 'text/javascript';
scElement.src = 'http://somenewwebpagewhichreturnshtml.com'; //
This web page returns HTML using document.write('somehtml code') or
returns a flash JS code.
document.getElementById('topDiv').appendChild(scElement);
}
</script>
<body>
<div id='topDiv'>
<script id='Script1'
src='http://somewebpagewhichreturnshtml.com'></script>
</div>
<input id="Button1" type="button" value="Get New HTML"
onclick="GetNew();" />
</body>
</html>
How can I execute a script during runtime. Here is my code, so how do I
execute the new script during runtime which should be a part of the
'topDiv'.
Thanks Help is appreciated.
- Shailendra
------- CODE ----------------
<html>
<title></title>
<script>
function GetNew() {
document.getElementById('topDiv').innerHTML = '';
var scElement = document.createElement('script');
scElement.id = 'NewScript1';
scElement.language = 'javascript';
scElement.type = 'text/javascript';
scElement.src = 'http://somenewwebpagewhichreturnshtml.com'; //
This web page returns HTML using document.write('somehtml code') or
returns a flash JS code.
document.getElementById('topDiv').appendChild(scElement);
}
</script>
<body>
<div id='topDiv'>
<script id='Script1'
src='http://somewebpagewhichreturnshtml.com'></script>
</div>
<input id="Button1" type="button" value="Get New HTML"
onclick="GetNew();" />
</body>
</html>