Replying to myself here but found a fix:
On line 37 in jquery.fancybox-1.3.4.pack.js there is the part
else{o=b("a[rel="+c+"], area[rel="+c+"]")
the variable c needs to be escaped with single quotes to prevent
square brackets messing it up:
else{o=b("a[rel='"+c+"'], area[rel='"+c+"']")
Note the single quotes after rel= and before the closing ]
My test page on
http://demo.4visions.nl/easy-fancybox-sandbox/escaping-youtube/
is using this patched js now...
The patched part in the packed js corresponds with line 815 in
jquery.fancybox-1.3.4.js:
selectedArray = $("a[rel=" + rel + "], area[rel=" + rel + "]");
which should be (I suppose, but not tested)
selectedArray = $("a[rel='" + rel + "'], area[rel='" + rel + "']");
Hope this (or something to the same effect) makes it into the next
release :)
> FancyBox 1.3.4 in conjunction with jQuery 1.6.1, when using
> rel="square[brackets]" (for example, anything with [ and ] really) on
> links other than normal image image content type like swf, html or
> iframe content, cause the following Uncaught exception error.
>
> Uncaught exception: Syntax error, unrecognized expression:
> [rel=square[brackets]]
>
> Error thrown at line 17, column 23918 in <anonymous function:
> k.error>(a) inhttp://
ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js:
> throw"Syntax error, unrecognized expression: "+a
> called from line 17, column 23281 in <anonymous function: k.filter>(a,
> c, d, e) inhttp://
ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js:
> k.error(a);
> called from line 17, column 19667 in <anonymous function>(b, d, f, g)
> inhttp://
ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js:
> q=g?
> {expr:x.pop(),set:p(g)}:k.find(x.pop(),x.length===1&&(x[0]==="~"||
> x[0]==="+")&&d.parentNode?d.parentNode:d,w),j=q.expr?
> k.filter(q.expr,q.set):q.set,x.length>0?n=p(j):u=!1;
> called from line 17, column 42832 in <anonymous function: k>(b, e, f,
> g) inhttp://
ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js:
> return a(b,e,f,g)
> called from line 17, column 47555 in <anonymous function: find>(a) inhttp://
ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js:
> g=e.length,f.find(a,this[c],e);
> called from line 16, column 15667 in <anonymous function: init>(a, d,
> f) inhttp://
ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js:
> return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)
> called from line 16, column 13598 in <anonymous function>(a, b) inhttp://
ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js:
> return new e.fn.init(a,b,h)
> called from line 37, column 472 in <anonymous function:
> b.fn.fancybox>(c) inhttp://
demo.4visions.nl/wp-content/plugins/easy-fancybox/fancybox/jqu...
> o=b("a[rel="+c+"], area[rel="+c+"]");
> called from line 17, column 1708 in <anonymous function: handle>(c) inhttp://
ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js:
> var k=j.handler.apply(this,g);
> called via Function.prototype.apply() from line 16, column 60224 in
> <anonymous function: k>(a) inhttp://
ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js:
> return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?
> f.event.handle.apply(k.elem,arguments):b
>
> When using only the opening square bracket [ or with jQuery 1.4, the
> error changes to
>
> Uncaught exception: TypeError: Cannot convert 'a' to object
> ...
>
> An live example can be seen onhttp://
demo.4visions.nl/easy-fancybox-sandbox/escaping-youtube/