[Dojo-interest] How to remove the added feature by has.add

Dylan Schiemann dylan at dojotoolkit.org
Wed Jun 11 07:51:20 EDT 2014


I guess I don't get the request, because if you are including that third
party code, then presumably it needs that feature test to work?

Does the test name conflict with your code? Do you not like the approach
taken by that feature test?

The most common case is to replace an existing test with your own, and
this is done with setting the force parameter to true. See
https://github.com/dojo/dojo/blob/master/has.js#L50

So, for example, if you want any check for that feature to always be
true, you could do something like:

has.add("some-test-name", function(){ return true; }, true, true);

Regards,
-Dylan

on 6/11/14, 3:30 (GMT-07:00) joe.wang said the following:
> All, I am trying to remove a specified feature which already added by
> has.add().
> 
> In my web application, I include a 3rd-party js file which added a feature
> like below.
> has.add("some-test-name", true);
> 
> now I need remove it in my application. but I can't edit the js file from
> 3rd-party. So I was thinking if I can to remove/overwrite this feature in my
> javascript code.
> 
> I tried the below code. but doesn't work.
> 
> has.add("some-test-name",false);
> 
> Could someone please help me out there ? thanks in advance.
> 
> 
> 
> 
> --
> View this message in context: http://dojo-toolkit.33424.n3.nabble.com/How-to-remove-the-added-feature-by-has-add-tp4002656.html
> Sent from the Dojo Toolkit mailing list archive at Nabble.com.

-- 
Dylan Schiemann
SitePen, Inc.
2014 Workshop schedule in the US, Canada, England and Switzerland:
http://www.sitepen.com/workshops/
SitePen Insider: http://sitepen.com/insider/
http://www.sitepen.com/


More information about the Dojo-interest mailing list