In IE6 and IE7 with "Add JavaScript to all pages" option enabled the following error is generated (pages with and without flash) :

Line: 38
Char: 3
Error: Expected identifier, string or number
Code: 0
URL:

Disabling "Add JavaScript to all pages" option gets rid of the error notice but breaks playback.

Any ideas how to solve this?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

RedTop’s picture

correction:

disabling does not break playback and removes error only from pages without flash (which makes sense).

Interestingly, disabling also removes the error from pages using flowplayer.

Stuart Greenfield’s picture

I'm going to have to find a machine with IE7 on it to test this!

RedTop’s picture

I use this:
http://finalbuilds.edskes.net/iecollection.htm

It allows you to install almost ALL (except 1.0) IE versions on the same machine. :)

[edit]
This may also be an option:
http://spoon.net/browsers/

I'll test to see whether the latest dev version also has this issue. Perhaps I can save you the trouble. :)

[edit2]
I can confirm that the latest dev 2010 (2010-May-12) also has this issue.

bratsun’s picture

I can confirm the same. IE6 & 7 throws out an error. In my case it says the bug is in wordpress player and onepixelout JS integration files. The same happens with direct embedding and sfwtools emdedding options. Patch is highly appreciated!

Stuart Greenfield’s picture

Possibly related to #801666: Optimize JavaScript files breaks SWFtools in IE6 and IE7http://drupal.org/node/801666

Fixing now on DRUPAL-6--3. Try the dev package when it next generates and see if it clears the error.

Stuart Greenfield’s picture

Status: Active » Needs review
RedTop’s picture

Downloaded new dev and tested in IE7 (IE6 crashes, but that may have to do with the hacky IE collection. Will test tomorrow)

Above error does not appear on IE7 anymore.

[edit]
Tested it on a 'proper' IE6 install and can confirm this error does not appear anymore.

mandclu’s picture

For some reason IE has a hard time with Javascript arrays that end with an empty element, which is what you get when the last proper element has a comma after it. I've had this error thrown twice: once from swftools_wpaudio.js (line 36) and also in swftools_onepixelout.js (line 34). For some reason when IE throws the error it reports a line number two more than where it appears in the file. That's quality software for you.

Please remove the unnecessary commas in the JS files, since so many people continue to insist on using substandard browsers.

RedTop’s picture

The IE6 hurting never stops, does it? :P

They still use IE6 at my work which is ridiculous. Much to my joy they have started rolling out IE8 to selected staff as a 'test'. As soon as we're all over to IE8 I'm going to add the IEupgrade module to our sites. I don't want to annoy the hand that feeds me but I do want to annoy IE6 users in general (heck, IE6 has annoyed me for long enough). :P

altrugon’s picture

FileSize
285 bytes

Here goes the patch to remove that extra comma.

I know it is an standard in Drupal to use the extra comma in the arrays when we are coding php, but we probably should avoid this for javascript.

mandclu’s picture

I know there are at least two files that have that problem, possibly more. Shouldn't we aim for a single patch that fixes everything?

A Romka’s picture

same thing happens in swftools_wpaudio.js (sites\all\modules\swftools\wpaudio\swftools_wpaudio.js) - I'm too lazy to create a patch, but once you remove comma on line 36 the error goes away in IE7

Rob_Feature’s picture

Status: Needs review » Needs work

Agreed with #11. This error occurs in a number of files (swftools_onepixelout.js in my case). I dont know enough to do a full patch but that would sure be appreciated :)

Marking as 'needs work' to get a proper fix across the whole module.

Rob_Feature’s picture

Status: Needs work » Needs review
FileSize
1.08 KB

Ok, I went thru the module and tried to find any instances of this. I only found them in swftools_wpaudio.js and swftools_onepixelout.js

Here's my first attempt at a patch (as in, first attempt ever :) Let me know if this works or if there are additional cases.

bcobin’s picture

Thank you so much for this! (Sorry - I didn't try the patch - just did it manually...) Good detective work!