Page 1 of 1

Internet Explorer 6/7 Bug

PostPosted: Sun Apr 12, 2009 3:15 am
by blockquote
DESCRIPTION
Using the latest Uploadify distro, I receive a JavaScript error when calling the fileUpload() method to instantiate an upload button. While the script works as expected in Firefox et al, both IE6 and IE7 on Windows XP display:
Line: 26
Char: 1206
Error: Object doesn't support this property or method

If I use the non-minified library, the error is reported in Line 68 Char 7, which is:
Code: Select all
settings = $.extend({

DIAGNOSIS
After a great deal of troubleshooting/consternation, I found that the issue can be traced back to the presence of a <div> whose ID is "settings". If I change said property to any value other than "settings", the error disappears.

REPRO STEPS
1. Download and extract the latest Uploadify distro.
2. In the source directory, create a new HTML document and paste the following:

Code: Select all
<html>
<head>
<script type="text/javascript" src="jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="jquery.uploadify.js"></script>
<script type="text/javascript">
<!--
$(document).ready(function() {
   $('#someID').fileUpload({
      'uploader':  'uploader.swf',
      'script':    'upload.php',
      'folder':    'uploads-folder',
      'cancelImg': 'cancel.png'
   });
});
-->
</script>
</head>
<body>
   <div id="someID"></div>
   <div id="settings"></div>
</body>
</html>

3. View the page in IE6 or 7 on Windows XP (and, likely, any other version of Windows); the aforementioned error will occur.
4. Change id="settings" to id="notsettings" and save the document.
5. Reload the page; no error will occur.

EXPECTED BEHAVIOR
There should be no interaction/conflict between internal Uploadify variable names and object IDs found in the HTML. This may explain a number of nebulous IE issues people have reported in these forums.

Re: Internet Explorer 6/7 Bug

PostPosted: Sun Apr 12, 2009 4:21 pm
by Barbossa
blockquote wrote:DESCRIPTION
Using the latest Uploadify distro, I receive a JavaScript error when calling the fileUpload() method to instantiate an upload button. While the script works as expected in Firefox et al, both IE6 and IE7 on Windows XP display:
Line: 26
Char: 1206
Error: Object doesn't support this property or method

If I use the non-minified library, the error is reported in Line 68 Char 7, which is:
Code: Select all
settings = $.extend({



Line 68 should probably read:

Code: Select all
var settings = $.extend({


and the variable "settings" should be called "options" as that's more in keeping with most other jQuery plug-ins.