google-code-export / minimalist

Automatically exported from code.google.com/p/minimalist
0 stars 0 forks source link

Using JavaScript libs in Modules #297

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I'm trying to make some changes in GMail module, but I don't find if there's a 
way for using jQuery in modules. I know I can load an external library, but it 
would be nice to automatically include this as an option. Could be that posible?

Original issue reported on code.google.com by p2km...@gmail.com on 4 Feb 2013 at 10:05

GoogleCodeExporter commented 9 years ago
Hi p2k, this used to be an option but Chrome has sandboxed all user scripts 
which makes this much more difficult. You can add the following to your script 
to pull jQuery down:

var s=document.createElement('script');
    s.setAttribute('src','//ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js');
document.body.appendChild(s);

I will consider adding this as an option.

Original comment by anst...@gmail.com on 4 Feb 2013 at 10:14

GoogleCodeExporter commented 9 years ago
Ok, thanks for answering so quickly ^^

Original comment by p2km...@gmail.com on 5 Feb 2013 at 11:41

GoogleCodeExporter commented 9 years ago
Apologies, I'm not that familiar with js.  Where exactly should we add the 
code? Which file and in which function?

Original comment by eason.m...@gmail.com on 10 Oct 2013 at 4:13