CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2004
    Posts
    1

    Angry embed java within javascript

    Here is my problem.

    On my jsp, I have some java code.
    When I get a certain exception in java, I want to display a confirm box to the user (currently using javascript). Based on what is returned from the user I want to perform an action using java.

    I am thinking the code should look something like this:

    <script type="text/javascript">
    <!--
    var answer = confirm ("Are you having fun?")
    if (answer)
    ***PERFORM SOME JAVA CODE***
    else
    ***PERFORM SOME JAVA CODE***
    // -->
    </script>

    Is something like this possible? Can someone provide me with the correct syntax?
    Thanks in advance

  2. #2
    Join Date
    May 2004
    Posts
    45

    Re: embed java within javascript

    You'll need to write an applet (you can choose to write a 1-pixel applet, just for using its public methods), and learn about LiveConnect in devedge.netscape.com site. (Maybe you'll need to check the "legacy" part of the site)
    Although LiveConnect is a Netscape 4.X technology, it's partially implemented in Internet Explorer and it's almost fully implemented in Netscape 7 / Mozilla.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured