2
cmd > java -version
Java Version : "1.7.0_11" (Updated)
Java(TM) SE Runtime Environment (build 1.7.0_11-b21)
Java HotSpot(TM) Client VM (build 23.6-b04, mixed mode, sharing)

browsers = IE7,IE8,IE9

(It works perfectly in Google Chrome & FF, But I need it to implement using Internet Explorer as what the company wants.)

I'm currently working on some stuff, but I don't see a way to fix my problem on:

Object doesn't support this property or method

I've already search over the internet, and tried every possible way to fix it, like lowering IE security, custom level of security ,reinstall Java, etc. but still no luck.

    <html>
        <head>
            <title>Clipboard image demo</title>

            <script type="text/javascript">
                function loadApplet() {
                    // Deferred load to display text first
                    document.getElementById("applet").innerHTML = '<object id="paste-image" classid="java:PasteImageApplet.class" type="application/x-java-applet" archive="tst.jar" width="1" height="1" ></object>';
                }
                function getImage() {
                    obj = document.getElementById('paste-image');
                    postTo = "Http://Path/To/File/shoot.php"; // Change this to your URL

                    image = obj.getClipboardImageURL(postTo);

                    if (image) {
                        url = "shots/" + image;
                        document.getElementById("target").src = url;
                        document.getElementById("url").value = document.getElementById("target").src; // to get full path, hack, I know ;)
                        document.getElementById("container").style.display = "";
                    }
                }
            </script>
            <body onLoad="loadApplet();">
                <p>
                    <div id="applet"></div>
                    <input type="button" value="Paste it!" onClick="getImage();">
                </p>
                <div id="container" style="display: none;">
                    <input type="text" id="url" style="width: 700px;"><br />
                    <iframe id="target" width="700" height="400"></iframe>
                </div>
        </body>
    </html>

Any help would be greatly appreciated.

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
  • The error message is pretty generic - basically there's a javascript function you're trying to call that doesn't exist in the browser you're using. Do you know which function it is? – Krease Jan 31 '13 at 06:21
  • 1
    Just trying to figuring it out why it doesn't work in IE. But in another browsers it works perfectly, Im thinking IE9 have some issue regarding Java or something that I can't initialize the Applet in IE, always got an error "Object doesn't support this property or method" – Arvin Verdad Ilustre Jan 31 '13 at 06:24
  • 1
    Step through it in the debugger and find out which function is causing the problem (and add that info to your question). It's likely that IE doesn't support that function. You should then be able to google that function for IE alternatives. Reinstalling things won't change the fact that the function isn't supported. – Krease Jan 31 '13 at 06:30
  • 1) `width="1" height="1"` That is not something I would recommend in this time when [Java applets are typically disabled](http://stackoverflow.com/q/14487698/418556), nor when an applet JS interaction is broken. Change it to 200x200. 2) Make sure the [Java Console](http://www.java.com/en/download/help/javaconsole.xml) is configured to open automatically. 3) I vaguely recall IE in particular required `scriptable='true'`, but that was a time ago & this applet has larger problems. 4) See if it works using `deployJava.js` (linked from [applet info.](http://stackoverflow.com/tags/applet/info)). – Andrew Thompson Jan 31 '13 at 06:31
  • @AndrewThompson - There's nothing wrong in the applet, that's why i put it in width="1" height="1" , and the Java console is "OPEN", and what do you mean in scriptable='true' should i add this in the code? @@Chris I already been surfing the net for 2 days looking for some answers, but even the microsoft suggestion to fix, i didn't help me. That's why I cam here in Stackoverflow might someone help me out. btw, im new at this field, im still a 3rd year student,just learning up, and thanks to you guys for guiding me in the correct way. I'll try all your suggestion regarding this matter. – Arvin Verdad Ilustre Jan 31 '13 at 06:45
  • I think i already know what the cause of it, it might be the IE that didn't support the **getClipboardImageURL**, while google chrome does support the getClipboardImageURL. – Arvin Verdad Ilustre Feb 04 '13 at 08:27

2 Answers2

0

When I have this error, I suggest checking to see if the java plug in is enabled on the browser. Sometimes, I have to toggle this switch in the java console. Turn it off and then on again.

0

I was able to resolve this issue by going into the Java Control Panel and selecting the advanced tab. From here I basically allowed everything and made sure "do not check" was marked. I'm sick and tired of the newer versions of Java.

A Team
  • 1