473,396 Members | 2,102 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

dynamically generating javascript statements

Hi!
I'm new to javascript and I'd like to know whether javascript can
process javascript-code entered by the user or read from a file.

We've got an application that uses ActiveX as main customization
means and we'd like to write a javascript control which listens
to a socket, reads a javascript statement accessing some ActiveX classes
and then executes that statement. The applicatoin doesn't know beforehand
which classes are there.

Lots of Greetings!
Volker
Jul 20 '05 #1
3 2093


Volker Hetzer wrote:
I'm new to javascript and I'd like to know whether javascript can
process javascript-code entered by the user or read from a file.


Yes, the function
eval
takes a string with JavaScript source code as its arguments and
evaluates the code.

--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 20 '05 #2

"Martin Honnen" <ma*******@yahoo.de> schrieb im Newsbeitrag news:3f********@olaf.komtel.net...


Volker Hetzer wrote:
I'm new to javascript and I'd like to know whether javascript can
process javascript-code entered by the user or read from a file.


Yes, the function
eval
takes a string with JavaScript source code as its arguments and
evaluates the code.

Perfect!
Thanks a lot!
Volker
Jul 20 '05 #3
JRS: In article <3f********@olaf.komtel.net>, seen in
news:comp.lang.javascript, Martin Honnen <ma*******@yahoo.de> posted at
Wed, 29 Oct 2003 16:36:10 :-

Volker Hetzer wrote:
I'm new to javascript and I'd like to know whether javascript can
process javascript-code entered by the user or read from a file.


Yes, the function
eval
takes a string with JavaScript source code as its arguments and
evaluates the code.


And <URL:http://www.merlyn.demon.co.uk/js-quick.htm> does just the
former that, when the Eval button is pressed.

H'mmm - it can read from a file, too, if one enters something like
<script type="text/javascript" src="include1.js">
</script>
<script type="text/javascript">
document.write(LZ(3))
</script>

and presses HTML. Function LZ is supplied by include1.js.

--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 IE 4 ©
<URL:http://jibbering.com/faq/> Jim Ley's FAQ for news:comp.lang.javascript
<URL:http://www.merlyn.demon.co.uk/js-index.htm> JS maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/JS/&c., FAQ topics, links.
Jul 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: natkhatbandar | last post by:
Hi, I am generating an XML document dynamically using DOM. I am creating an element using IXMLDOMDocument::createElement() and then calling IXMLDOMElement::appendChild() for the parent element....
5
by: mikeyjudkins | last post by:
Ive been banging my head on the wall for hours with this one, hopefully someone will know what Im doing wrong here :\ The Goal: I have an xml file that is generated on the fly via JSP which I...
1
by: Jon | last post by:
I need to generate an XML File dynamically using ASP and a SQL Database. I don't have time to learn php or any other programing language. I need a ASP page to either append information to an XML...
27
by: ted benedict | last post by:
hi everybody, i hope this is the right place to discuss this weird behaviour. i am getting dynamically generated text or xml from the server side using xmlhttprequest. if the server side data is...
2
by: James Black | last post by:
I am dynamically generating a table in IE to display some information. I will probably change it to divs later, but I just want to get it working properly first. In my div I have the following...
4
by: somaskarthic | last post by:
Hi I posted query about dynamically generating php code. Sorry for the inconvenience . I didn't given you the php code. Its just javascript code which dynamically create rows on button click event....
2
by: aric.bills | last post by:
Hello all, I'm a novice Javascript programmer, and I'm having browser compatability issues regarding dynamic generation of tables. The following content generates "hello" in Firefox 1.5, but...
1
by: jeffejohnson | last post by:
I'm looking to see if anyone has experienced this... I've got a dropdown that I'm populating dynamically and the items include HTML special characters (like &Ocirc;). If I load them from an...
11
by: Faisal Vali | last post by:
Are there any guidelines people use that help them decide when it is better to dynamically generate all html elements using javascript versus actually writing some html and using it as scaffolding?...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.