• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Passing Info Out of an Applet

 
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is it possible to pass out info, maybe just a numeric code, out of an applet to the calling web page so the code may be interrogated by Javascript?
 
Ranch Hand
Posts: 1873
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
yeah
sure there is. look(on google) for JSObject which is a netscape.javascript package part and u'd find it in java40.jar file...
u've to just get a window object in the applet code that will refer to the page that has the applet and then u can invoke methods written in that page's javascript and that way u can pass the code...
e.g. if u'd the object jsObject in ur applet and u want to invoke javascript method x() in the applet's html page then u've to do,
JSObject window = JSObject.getWindow( this );
window.call("x",new Object[]{"arg1", "arg2"});
probably u'd find getMemeber() and all other functions reference in examples u'd find but i found it not working appropriately instead this getting window object and just call a method worked better for me...
regards
maulin
 
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
its even easier
in jscript
var myValue = document.myApplet.getMyCode();
its that easy and the same for setters
just create properties in the applet
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic