tags:

views:

19

answers:

1

I am patching JQuery to work against svgweb. svgweb implements the SVG DOM in Flash for IE, and marshal's Flash calls via fake DOM nodes. Needless to say, JQuery doesn't work with svgweb. So, I'm patching select methods in JQuery, like (attr, hasClass, css, etc...) to work with svgweb.

Is there a way to test JQuery method calls against a list of supported methods, and throw an error if the method isn't supported?

Something like this, injected at a magic spot in JQuery:

function magicFilterMethod(methodName) {
   if ($.inArray(methodName, ['hasClass', 'attr', 'find',...]) {
      return true;
   }
   throw "Method not supported in svgweb: " + methodName;
}
A: 

svgweb aside, jQuery does not currently work with SVG documents:

The SVG DOM extension of the jQuery SVG library aims to work around this, so it might be worth looking at or directly reusing for your project: http://keith-wood.name/svg.html#dom

Be warned that I've found certain methods of the SVG DOM extension to cause Chrome to crash.

If you do have good success using jQuery SVG with svgweb, you should definitely report on it, as I'm sure the svgweb developers would be very interested in the use of these two libraries together.

echo-flow