Skip to content

Commit 26e137a

Browse files
committed
$.getScript(): Use github url for jQuery Color plugin
Fixes jquery#202
1 parent 0f4801b commit 26e137a

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

entries/jQuery.getScript.xml

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,19 @@ $.cachedScript("ajax/test.js").done(function(script, textStatus) {
8585
<example>
8686
<desc>Load the <a href="http://github.com/jquery/jquery-color">official jQuery Color Animation plugin</a> dynamically and bind some color animations to occur once the new functionality is loaded.</desc>
8787
<code><![CDATA[
88-
$.getScript("/scripts/jquery.color.js", function() {
89-
$("#go").click(function(){
90-
$(".block").animate( { backgroundColor: "pink" }, 1000)
91-
.delay(500)
92-
.animate( { backgroundColor: "blue" }, 1000);
88+
(function() {
89+
var url = "https://raw.github.com/jquery/jquery-color/master/jquery.color.js";
90+
$.getScript(url, function() {
91+
$("#go").click(function(){
92+
$(".block")
93+
.animate( { backgroundColor: "rgb(255, 180, 180)" }, 1000 )
94+
.delay(500)
95+
.animate( { backgroundColor: "olive" }, 1000 )
96+
.delay(500)
97+
.animate( { backgroundColor: "#00f" }, 1000 );
98+
});
9399
});
94-
});
100+
})();
95101
]]></code>
96102
<html><![CDATA[
97103
<button id="go">&raquo; Run</button>
@@ -109,4 +115,4 @@ $.getScript("/scripts/jquery.color.js", function() {
109115
<category slug="ajax/shorthand-methods"/>
110116
<category slug="version/1.0"/>
111117
<category slug="version/1.5"/>
112-
</entry>
118+
</entry>

0 commit comments

Comments
 (0)