Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I keep getting errors that the function (renamed) does not exist for the given object. Is there a release or setting or something to make it work?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
212 views
Welcome To Ask or Share your Answers For Others

1 Answer

You must use an externs file for jQuery when using Closure Compiler Advanced Mode with jQuery. Extern file will tell compiler these are reserved methods and accept these argument and argument data types should be like that, so do not minify method names and check argument data types in that way.

You can get externs file which is created by Google Developers here. This file generated for jQuery-1.4.3. But currently probably will work any version of jQuery. Newly added methods may not include in that file, so you should add it to externs file, syntax and synonyms are so simple.

Also you can say location of externs file to compiler by using an extra compier flag. Syntax should be like this

--compiler_flags= "--externs=path/to/jquery.externs.js"

Also you can use this tool which is an online externs extractor for Closure Library.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...