Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7704179
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T23:37:40+00:00 2026-05-31T23:37:40+00:00

I have a problem when call applet method from javascript.. I used this function

  • 0

I have a problem when call applet method from javascript..

I used this function to load applet

$("body").append('<applet id="asra" name="asra" code="akorbulsoundrecorder/recorder.class" archive="http://localhost/.../java/akorbulSoundRecorder.jar" width="300" height="400" MAYSCRIPT></applet>');

and I can call applet function javascript there is no problem;

but

alert(1);
document.asra.stopCapture();
alert(2);

alert(1) and document.asra.stopCapture(); is working but alert(2) doesn’t work?

stopCapture function

public void stopCapture() {

    AccessController.doPrivileged(new PrivilegedAction() {
        public Object run() {



            if(!test)
            jso.call("__appletRecord", new String[] {"stop"});

            targetDataLine.stop();
            targetDataLine.close();


            String filename = audioFile.getAbsolutePath();
            try {
                final ArrayList < String > cmd = getCommand(filename);
                if(!test)
                jso.call("__appletRecord", new String[] {"convertMp3"});
                Main.main(cmd.toArray(new String[cmd.size()]));
                if(!test)
                jso.call("__appletRecord", new String[] {"deleteWav"});
                //audioFile.delete();
            } catch (IOException e1) {
                System.err.println(e1.getMessage());
            }


            try {
                // Establish a connection
                if(!test)
                jso.call("__appletRecord", new String[] {"upload"});
                httpUrlConnection = (HttpURLConnection) new URL("http://localhost/.../java/upload.php").openConnection();
                httpUrlConnection.setDoOutput(true);
                httpUrlConnection.setRequestMethod("POST");
                outputStream = httpUrlConnection.getOutputStream();
                // Buffered input stream
                fileInputStream = new BufferedInputStream(new FileInputStream("c:\\junk.mp3"));
                // Get the size of the image
                totalBytes = fileInputStream.available();
                // Loop through the files data
                for (int i = 0; i < totalBytes; i++) {
                    // Write the data to the output stream
                    outputStream.write(fileInputStream.read());
                    bytesTrasferred = i + 1;
                }
                // Close the output stream
                outputStream.close();
                if(!test)
                jso.call("__appletRecord", new String[] {"success"});
                // New reader to get server response
                serverReader = new BufferedReader(new InputStreamReader(httpUrlConnection.getInputStream()));
                // Read the servers response
                serverResponse = "";
                while ((response = serverReader.readLine()) != null) {
                    serverResponse = serverResponse + response;
                }
                if(!test)
                jso.call("__appletPHPResponse", new String[] {response});
                // Close the buffered reader
                serverReader.close();
                // Close the file input stream
                fileInputStream.close();
            } catch (IOException ex) {
                jLabel1.setText(ex.getMessage());
            }

            return null; // nothing to return
        }
    });

}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T23:37:41+00:00Added an answer on May 31, 2026 at 11:37 pm

    Reason

    The reason Java is not working in IE9 is because the Java applet has been blocked by ActiveX Filtering; it is a new feature in IE9. The solution is to temporarily turn off ActiveX Filtering.

    1) How to Enable Activex filtering -> Go to Tools in IE9 and Click on Activex Filtering, then the tick in front of the option will disappear. (It means the option is disabled.) If it is not there the option is already disabled.

    If you enabled the Java loading in IE9, you may encounter a problem that the Java causes the web page to crash. We can stop this problem also, by enabling the compatibility view option in IE9. If you enabled Compatibility option then add which address you need to option that contained java applet.

    2) How to Enable Compatibility view in IE9 -> Go to Tools and click on Compatibility view settings option, then click add button and add the web site.
    To remove a website from Compatibility view, just go back to Compatibility View Settings and remove the site from the Compatibility View list.

    You can follow: http://chuyenhang24.com
    or http://raovat2424.com

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a problem with the function call: [self dismissModalViewControllerAnimated:YES]; In MainViewController, I can
The problem is the following. We have lots of ajax call via $.ajax function.
This is my problem: I have a partition on my Ubuntu system, let's call
My problem is this so right now i have 2 different applet classes one
I have a problem when I call operator<< on a pointer. I have searched
I have a problem refreshing a ListView. I call my ListView Activity , I
I have a problem with WCF. My testing code is pretty simple. I call
Problem: I have a WCF service setup to be an endpoint for a call
I have narrowed down my problem to the mysql_connect call I am doing in
I have problems filling a temporary table with the resultset from a procedure call

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.