SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Thread: kyank

  1. #1
    SitePoint Member
    Join Date
    Dec 2000
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi.

    Sorry I'm having to do this, but the forum wont let me reply to my other post. I sent an email from the feedback page but haven't recieved a reply yet so as you replied a while ago, I thought I'd post this flag message.

    Anyway, I was just so say thanks, for the reply. I would need something that works in most browsers. What I wondered is if you can do something like,

    <head>
    <script>
    <!--

    var myVar = <applet...>

    //-->
    </script>
    </head>

    where the applet returns a value which should go into the variable myVar. Or would that not work right?

    Thanks again,

    jb.

  2. #2
    SitePoint Author Kevin Yank's Avatar
    Join Date
    Apr 2000
    Location
    Melbourne, Australia
    Posts
    2,571
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    That would not work right. Instead, the code should look something like this:

    Code:
    <applet name="myapplet" ...>
    <script language="JavaScript">
    <!--
    var value = document.applets['myapplet'].methodName();
    //-->
    </script>
    That calls the method called methodName in the applet and stores the value in the JavaScript variable value. Note that while I've called Java methods from JavaScript before, I've never tried storing the return value in a variable so I can't guarantee this works as advertised. Do let me know!
    Kevin Yank
    CTO, sitepoint.com
    I wrote: Simply JavaScript | BYO PHP/MySQL | Tech Times | Editize
    Baby’s got back—a hard back, that is: The Ultimate CSS Reference


Bookmarks

Posting Permissions

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