how to pass JavaScript function and its variables to an applet

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dansh
    New Member
    • Apr 2012
    • 1

    how to pass JavaScript function and its variables to an applet

    i want to create an applet which will call javascript function which is -
    Code:
    function printreceipt(tax,subtotal,total)
    {
     
    subtotalElem=document.getElementById("total");
    
    
    var taxElem=document.getElementById("tax");
    
    productElem=document.getElementById("product-name");
    
    alert("here are my products" + taxElem.innerHTML + subtotalElem.innerHTML);
    i want to retrieve the contents of variables like tax,discount and such like things
    please help.
    regards dansh
    Last edited by Dormilich; Apr 12 '12, 07:03 AM. Reason: Please use [CODE] [/CODE] tags when posting code.
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    See if this helps:
    Real's HowTo : Useful code snippets for Java, JS, PB and more

    Passing the variables should be straightforward . You can create functions to access them and then call these functions from your applet code.

    Comment

    Working...