zeroclipboard
zeroclipboard copied to clipboard
Unable to get value of the property 'style'
Hi I am getting following error in IE9
SCRIPT5007: Unable to get value of the property 'style': object is null or undefined ZeroClipboard.js, line 350 character 5
Some more info.. I am using 1.2.3 version.
Please share your JS setup code and Flash Player version info (from IE, specifically).
following is my js Setup and flash player version is 11,9,900,170. the code is working on all other browsers but not working on IE 9. I have checked your demo on IE that also is not working on IE 9.
<script src="js/ZeroClipboard.js"></script>
<script type="text/jscript">
$(function () {
var clip = new ZeroClipboard(
document.getElementsByClassName('copyCodeButton'),
{ moviePath: "ZeroClipboard.swf" }
);
clip.on('complete', function(){
$('.promoCode').hide();
$('.message').show();
});
});
</script>
When you say that the demo page isn't working, can you describe the behavior it is exhibiting? Is it failing to load, throwing/logging errors, or just not copying to your clipboard?
Are you certain that your moviePath
is correct? Looks like your JS file is in a "js" folder but your SWF is in the same folder as the HTML page. Is that correct?
it not copying to clipboard.. and moviePath is correct.. JS file is in js folder and SWF is with HTML page.
Ah, as far as the demo page goes, this looks like an IE-specific script execution order issue. :-1: I'll get that fixed.
As to your particular issue, I'm unsure.
I have upgraded IE version to 11 but still it's ZC working on IE. your given link "IE-specific script execution order" is not working too.
Hi I have downloaded the Flash Player Version 12 for IE and installed it. Code is working fine now.
link for Flash player: http://get.adobe.com/flashplayer/otherversions/
Hmm, very curious.
Demo page is hopefully fixed by zeroclipboard/zeroclipboard.org@547ce769f71c7350e9600ac837afbb855d262e77.
Nope. :anger:
Try-try-again: zeroclipboard/zeroclipboard.org@f29dd2994d44ed52dd87532349f332884fc340a6
This seems to make it work for me in IE7, IE9, IE10, and IE11... but IE8 only works intermittently.
I can confirm this on IE9 and IE10. It works on IE11.
Now, it's also the case that my IE9 and IE10 are running on modern.ie Win7/IE VMs, and thus are not in the domain. My IE11 is running in the domain. I had to adjust security settings to get my AJAX services to work from that environment, so I don't rule out some security issue, though there's nothing in the F12 console.
It's probably obvious, but the movie doesn't appear to be loading in IE9 or 10. It's not showing up in the Network tab of the F12 tools. It does show up in IE11. Maybe that's implied by htmlBridge==null?
@JohnWSaundersIII: Any chance you can test with the new v1.3.0-beta.1 beta release?
Or reproduce this using the demo page for that beta release? http://zeroclipboard.org/?release=beta&type=traditional
I have just tried this with v1.3.1. I got it to work ok with Firefox 26 and IE 11, but it doesn't work for IE9.
Now, it doesn't crash with IE9 like it used to - it just doesn't actually clip the movie to the element.
Briefly, here are the changes I had to make to get it to work with FF26:
-
Change
ZeroClipboard.setDefaults
toZeroClipboard.config
-
Change
client.glue
toclient.clip
-
Change
client.unglue
toclient.unclip
-
Change my
dataRequested
handler fromzeroClipboardClient.on('dataRequested', function (client) { if (client.options == null || client.options.text == null) { client.setText($(this).text()); }
to
zeroClipboardClient.on('dataRequested', function (client) { var text = $(this).attr("data-clipboard-text"); if (text) { client.setText(text); } else { client.setText($(this).text()); } });
And, of course, I updated the two .js files and the .swf file.
Changes 1-3 aren't required but are recommended (if you just want to suppress the console
warnings, you can just set the debug
option to false
).
Change 4 isn't a big surprise as client.options.text
was never an official/intentional part of the API, and thus I paid no heed in removing it. However, you should be able to shorten it slightly to the following:
zeroClipboardClient.on('dataRequested', function (client) {
var $this = $(this);
if (!$this.attr("data-clipboard-text")) {
client.setText($this.text());
}
});
Is there anything else I can do to help you find and fix this problem? There is talk of shipping without copy to clipboard functionality as opposed to shipping with a release note saying "it doesn't work on IE9/10", and "you have to click in the first half of the text" (issue #330).
@JohnWSaundersIII You never explicitly answered: does the demo page work in IE9/10?
Interesting results playing around with the demo page on Windows. It works for me in IE11 and IE11-as-IE10/9/8. Doesn't seem to work in IE11-as-IE7. Only works intermittently in IE10 and IE10-as-IE9/8/7. Perhaps this is the wiley Issue #236 back to haunt me...?
Note to self: Should retry this with the latest v2.x
release.