Login  Register

Learning JavaScript

Posted by David Webster on Aug 10, 2010; 7:07pm
URL: http://imagej.273.s1.nabble.com/Learning-JavaScript-tp3687295.html

I have been trying to teach myself JavaScript by writing code embedded in
html and then loading that in Moszilla Firefox 3.6.8. But, I can't get it to
understand importPackage(java.awt). I just get an error message that says
"Error: importPackage is not defined". Does anyone know what the problem
coud be? The html is included below.

David Webster

<html>
 <head>
  <title>Run JavaScript File</title>
 </head>
 <body>
  <h1>Javascript File Test Begin</h1>
  <script language="JavaScript" type="text/JavaScript">
   importPackage(java.awt);
  </script>
  <h2>Javascript File Test End</h2>
 </body>
</html>