Skip to main content
Stack Overflow
  1. About
  2. For Teams

Return to Revisions

1 of 2
user3117628
  • 786
  • 2
  • 15
  • 36

Javascript using external function

https://docs.google.com/file/d/0BzVXz9FRg0DWV3R0WUR2cTd5U00/edit

I need to call the function from the javascript linked above in my userscript. My code where I need the function looks like this:

 jQuery(document).ready(function($) {
 $('.color1').colorPicker();
 });

I tried:

 var decolorpicker = '<script type="text/javascript" scr="www.drive.google.com/file/d/0BzVXz9FRg0DWV3R0WUR2cTd5U00/edit?usp=sharing"></script>'
 $("script[src*='merged/game']").after(decolorpicker);

And then:

 window.colorPicker(); 

Wich gives the error:

Uncaught exception: TypeError: 'window.colorPicker' is not a function

How can I do this correctly?

user3117628
  • 786
  • 2
  • 15
  • 36
lang-js

AltStyle によって変換されたページ (->オリジナル) /