Re: [Proto-Scripty] Old 1.6.1 library

40 views
Skip to first unread message

Walter Lee Davis

unread,
Oct 18, 2012, 3:07:09 PM10/18/12
to prototype-s...@googlegroups.com

On Oct 16, 2012, at 5:32 PM, Trik wrote:

> Hi there,
>
> I'm a littlebit confused, i'm not a prototype expert and i would like to solve a problem.
> I have an old library based on 1.6.1 version.
>
> There is a method that make an error when i try to upgrade to 1.7.1 :
>
> function onMousedown(event) {
> var draggable = event.findElement('[ui:draggable="true"]');
>
> if (draggable) {
> event.stop();
> currentDraggable = draggable;
> initPointer = event.pointer();
>
> document.observe("mousemove", onMousemove)
> .observe("mouseup", onMouseup);
> }
> };
>
> Seems the new selector Sizzle don't like the '[ui:draggable="true"]' expression.
>
> --> Syntax error, unrecognized expression: [ui:draggable="true"]
>
> Do you have an idea what could be a good syntax ?

Sizzle (or even other selector engines) base their behavior on CSS selectors. If ui:draggable is an attribute that can be applied in HTML to an element, then they can select it, usually. Can you show the HTML that this is supposed to match? Is that HTML valid according to W3C's validator? That's another very important place to start. While browsers put up with almost any sort of crap HTML, JavaScript DOM is a more unforgiving taskmaster.

Walter

>
> Hope this will be enought as informations to help me.
>
> Thanks in advance guys :)
>
>
>
> --
> You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group.
> To view this discussion on the web visit https://groups.google.com/d/msg/prototype-scriptaculous/-/dOlp2b2JeaEJ.
> To post to this group, send email to prototype-s...@googlegroups.com.
> To unsubscribe from this group, send email to prototype-scripta...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.

Victor

unread,
Nov 9, 2012, 11:54:10 AM11/9/12
to prototype-s...@googlegroups.com
Sizzle may need to escape special chars in CSS selector like this '[ui\:draggable="true"]' or '[ui\\:draggable="true"]' - not sure about count of backslashes, but I've already met similar error in Sizzle.
Reply all
Reply to author
Forward
0 new messages