error message

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

error message

ncosco
Hi, i'm new in javascript programming, this is my first working code
<HTML>
<HEAD>
<TITLE>Test Input</TITLE>
<SCRIPT LANGUAGE="JavaScript">
<!--
function testResults (form) {
    var TestVar = form.inputbox.value;
    alert ("You typed: " + TestVar);

  var frame = new java.awt.Frame("FrameDemo");
        frame.setSize(200,300);
        frame.setVisible(true);

}
// -->
</SCRIPT>
</HEAD>
<BODY>
<FORM NAME="myform" ACTION="" METHOD="GET">Enter something in the box:
<BR>
<INPUT TYPE="text" NAME="inputbox" VALUE=""><P>
<INPUT TYPE="button" NAME="button" Value="Click" onClick="testResults
(this.form)">
</FORM>
</BODY>
</HTML>

if i try to use javax.swing.JFrame instead a simple Frame, i get an
error from debugger "javax is not defined".

Can anyone help me? thanks
_______________________________________________
dev-apps-js-debugger mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-apps-js-debugger
Reply | Threaded
Open this post in threaded view
|

Re: error message

John J Barton
ncosco wrote:

> Hi, i'm new in javascript programming, this is my first working code
> <HTML>
> <HEAD>
> <TITLE>Test Input</TITLE>
> <SCRIPT LANGUAGE="JavaScript">
> <!--
> function testResults (form) {
>     var TestVar = form.inputbox.value;
>     alert ("You typed: " + TestVar);
>
>   var frame = new java.awt.Frame("FrameDemo");
> frame.setSize(200,300);
> frame.setVisible(true);
>
> }
> // -->
> </SCRIPT>
> </HEAD>
> <BODY>
> <FORM NAME="myform" ACTION="" METHOD="GET">Enter something in the box:
> <BR>
> <INPUT TYPE="text" NAME="inputbox" VALUE=""><P>
> <INPUT TYPE="button" NAME="button" Value="Click" onClick="testResults
> (this.form)">
> </FORM>
> </BODY>
> </HTML>
>
> if i try to use javax.swing.JFrame instead a simple Frame, i get an
> error from debugger "javax is not defined".
>
> Can anyone help me? thanks

Probably not. I doubt many readers here try to mix Java and Javascript,
not a great combination. If you are new to Javascript, use it. Forget
about Java.

jjb
_______________________________________________
dev-apps-js-debugger mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-apps-js-debugger
Reply | Threaded
Open this post in threaded view
|

Re: error message

ncosco
On 13 Nov, 23:01, John J Barton <[hidden email]> wrote:

> ncosco wrote:
> > Hi, i'm new in javascript programming, this is my first working code
> > <HTML>
> > <HEAD>
> > <TITLE>Test Input</TITLE>
> > <SCRIPT LANGUAGE="JavaScript">
> > <!--
> > function testResults (form) {
> >     var TestVar = form.inputbox.value;
> >     alert ("You typed: " + TestVar);
>
> >    var frame = new java.awt.Frame("FrameDemo");
> >    frame.setSize(200,300);
> >    frame.setVisible(true);
>
> > }
> > // -->
> > </SCRIPT>
> > </HEAD>
> > <BODY>
> > <FORM NAME="myform" ACTION="" METHOD="GET">Enter something in the box:
> > <BR>
> > <INPUT TYPE="text" NAME="inputbox" VALUE=""><P>
> > <INPUT TYPE="button" NAME="button" Value="Click" onClick="testResults
> > (this.form)">
> > </FORM>
> > </BODY>
> > </HTML>
>
> > if i try to use javax.swing.JFrame instead a simple Frame, i get an
> > error from debugger "javax is not defined".
>
> > Can anyone help me? thanks
>
> Probably not. I doubt many readers here try to mix Java and Javascript,
> not a great combination. If you are new to Javascript, use it. Forget
> about Java.
>
> jjb

I'm developing an application, I would like to use different
interfaces, like mozilla extension, web page or normal gui. In order
to use mozilla extension I need to call java from javascript, the
previous code was an attempt to understand how it works.
_______________________________________________
dev-apps-js-debugger mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-apps-js-debugger
Reply | Threaded
Open this post in threaded view
|

Re: error message

Colby Russell
ncosco wrote:
> I'm developing an application, I would like to use different
> interfaces, like mozilla extension, web page or normal gui. In order
> to use mozilla extension I need to call java from javascript, the
> previous code was an attempt to understand how it works.

If you're writing an extension, consider doing it without Java.

To answer your question though, |Packages.javax| would be correct, since
the top-level |java| object is just shorthand for |Packages.java| and
there's no similar shorthand for javax. This is a remnant of
LiveConnect,  and its future in Mozilla is shaky from the last
discussion I'm aware of on the issue, and just poorly understood and
nearly unsupported at best.

--
Colby Russell
_______________________________________________
dev-apps-js-debugger mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-apps-js-debugger