Login | Register   
RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX

Tip of the Day
Language: Dynamic Content
Expertise: Beginner
Mar 19, 1997

How can I create JavaScript enhanced web pages?

I've been poking around the net and have seen several development environments for creating Java applets/applications. What software do I need to create JavaScripts that I can use on my web pages?

There are currently no development environments for working with JavaScript code. There are no debuggers and no graphical interfaces for writing your scripts.

JavaScript code should be written with a text editor, most likely you'll choose the same one that you write your HTML in. I prefer to work in WordPad on Windows, and SimpleText or something similar when I'm on a Macintosh. (Yes, that's right, I've yet to see an HTML editor that makes me more productive.) To give you a quick glimspe of how the language could be structered with a text editor, here's a simple script embedded in an HTML page:

<HTML> <HEAD> <meta name="WT.qs_dlk" content="WZ4qTwrIZ7kAADjDmWAAAAAE"/> <meta name="WT.qs_shmv" content="hv20150423-statler.sf.quinstreet.net"/> <meta name="inject_params" content="WT.qs_dlk=WZ4qTwrIZ7kAADjDmWAAAAAE&"/> <meta http-equiv="Set-Cookie" content="inject_params=WT.qs_dlk=WZ4qTwrIZ7kAADjDmWAAAAAE&; path=/; domain=devx.com;"/> <meta http-equiv="Set-Cookie" content="WMUUID=WZ4qTwrIZ7kAADjDmWAAAAAE; path=/; domain=devx.com;"/> <TITLE>This is a test</title> <SCRIPT LANGUAGE=&quot;JavaScript&quot;> <!-- This comment code keeps old browsers from displaying scripts. var myMessage = &quot;Hello!&quot; // Stop hiding this script --> </script> <script> window.webtrendsAsyncInit=function(){ var dcs=new Webtrends.dcs().init({ dcsid:"dcsetaek200000gcgxfcx07g4_2p3u", domain:"www.qsstats.com", timezone:-8, i18n:true, onsitedoms:"devx.com", fpcdom:".devx.com", plugins:{ //hm:{src:"//s.webtrends.com/js/webtrends.hm.js"} } }).track(); }; (function(){ var s=document.createElement("script"); s.async=true; s.src="/imageserver/common/v10/webtrends.min.js"; var s2=document.getElementsByTagName("script")[0]; s2.parentNode.insertBefore(s,s2); }()); </script> <noscript><img alt="dcsimg" id="dcsimg" width="1" height="1" src="//www.qsstats.com/dcsetaek200000gcgxfcx07g4_2p3u/njs.gif?dcsuri=/index.php/tips/Tip/23182&amp;WT.js=No&amp;WT.tv=10.4.1&amp;dcssip=www.devx.com&amp;WT.qs_dlk=WZ4qTwrIZ7kAADjDmWAAAAAE&"/></noscript> </head> <BODY> This is a test: <SCRIPT LANGUAGE=&quot;JavaScript&quot;> document.write(myMessage) </script> </body> </html>

You might not be familiar enough with the syntax of JavaScript to understand what's going on in this example, but you should be able to see how JavaScript appears to be just an extention of HTML. Like HTML, JavaScript relies on the visitor's browser to parse the code and execute it. You simply write the code as part of your web page and enclose it within tags. There is no compiling, and therefor no 'bytecode' or 'executable' that needs to be created. These are several reasons why it is so easy to create JavaScripts without the use of a 'development environment'.

DevX Pro
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date