views:

62

answers:

0

My markup:

<script src="http://somecdn.com/jquery-1.4.2.min.js"&gt;&lt;/script&gt;
<script src="/js/mycode.closure_compiled.js"></script>

My code:

goog.provide("mycode");

mycode.foo = function () {
    jQuery("#ajaxSpinner").show();
    jQuery.get("/ajax/foo", function () { /* ... */ });
}

I want to compile my code with advanced optimizations using the Google Closure Compiler.

How do I achieve the following?

  1. The compiler should not rename "jQuery" and "jQuery.get".
  2. The compiler should not throw Errors or Warnings (eg. "unknown type 'jQuery'").