AKB Forums

Go Back   AKB Forums > Technical sections > Languages, Compilers and Interpreters > Web Development
Home Register Blogs FAQ Members List Calendar Downloads Arcade Mark Forums Read

Web Development Java/PHP/Perl/ASP and more

Troubles when posting message? Click here! :: Проблемы с отправлением сообщения? Нажмите сюда!

Reply
 
LinkBack Thread Tools Display Modes
Old Aug 12, 2004, 14:36   #1
Administrator
 
greka's Avatar
 
Join Date: Sep 2001
Location: @work
Posts: 5,347
Rep Power: 10
Reputation: 23
Send a message via ICQ to greka
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>
__________________
И повешенные могут качаться в неположенную сторону. /С.Е.Лец/
greka is offline   Reply With Quote Quote selected
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[java] Read return value of JavaScript greka Web Development 0 Jun 18, 2004 13:49
Generating Random values from JavaScript x.ice Web Development 2 Feb 17, 2004 13:03
JavaScript: working with forms Aram Ghazanchyan Web Development 1 Feb 12, 2004 10:17
JavaScript: Link with confirmation in frame Aram Ghazanchyan Web Development 1 Nov 24, 2003 05:07
Kak spryatat Javascript Mono Web Development 18 Jun 9, 2002 01:53


All times are GMT. The time now is 09:41.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
This board was founded on September 29, 2001
Powered by Viper Internet

Affordable Web Hosting | ParevNet

Buy text link