Armenian Knowledge Base  

Go Back   Armenian Knowledge Base > Technical sections > Webmaster Zone > Web Development
Register

Reply
 
LinkBack Thread Tools
Old 12.08.2004, 15:36   #1
Академик
 
greka's Avatar
 
Join Date: 09 2001
Location: inside myself
Posts: 5,369
Downloads: 0
Uploads: 0
Reputation: 18 | 5
Default add Javascript code at runtime

How to add some Javascript code at runtime and run it?

Say, the code that should be appended is:

Code:
<script language=JAVASCRIPT>
var ttt = 'nnnn';
function tryme(){ ttt = 'ASDASD'; }
</script>

"AppendCode()" should add that javascript code.

Say, HTML code is:
Code:
<html>
<head>
<title>test document.write</title>
<script language="JavaScript">
function AppendCode()
{
text='_this part somehow should add a new function and execute it_';
document.write(test);
}
</script>

</head>
<body><form>

<input type=button value="click me" onclick="AppendCode()">
</form></body></html>
Reply With Quote
Reply

Thread Tools


На правах рекламы:
реклама

All times are GMT. The time now is 01:00.


Powered by vBulletin® Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.