jquery.js from CDN sources I hope use a CDN source as default, which doesn't load the local jquery.js while the CDN is OK. If the CDN doesn't reply, load the local jquery.js.

I have writted this in my template.php.

&lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"&gt;&lt;/script&gt;
&lt;script&gt;!window.jQuery &amp;&amp; document.write('&lt;script src="&lt;?php echo base_path().path_to_theme(); ?&gt;/js/jquery.min.js"&gt;&lt;\/script&gt;');&lt;/script&gt;


It worked well until I used the Flag module, which loads the flag.js file. I think this file just work with the version of jQuery that comes with Drupa, as it doesn't work with the jQuery library from Google CDN.

Did Drupal developers rewrite the whole jquery.js? I cant believe that.

What should I do to solve this problem? Can I fix it by rewriting flag.js?
If it's possible I really don't want use other module such as the jQuery Update module; it is too huge.
No, Drupal devs didn't rewrite jQuery, a standard version is included (1.3.2). I can vouch for flag.js working fine with that version of jQuery.

It's not compatible with the version of jQuery that you're including though. You're probably also introducing a conflict between the two versions of the library that are included in the page.

jquery_update isn't a huge module at all, and it gives you several versions of jQuery plus the CDN option out of the box. It was written specifically to solve the problem you're trying to get round.

There's no good reason not to install it; if you don't, you'll just be reproducing functionality it already provides, which is time you could spend doing something productive.