Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Renaming to suggest that method is private
I expect this to change again, but it's a start.
  • Loading branch information
gibson042 committed Apr 4, 2013
commit 081a18febe62c9d00c2e231bcb8db0ccb47cf8e4
2 changes: 1 addition & 1 deletion src/ajax.js
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,7 @@ jQuery.extend({
return jQuery.get( url, undefined, callback, "script" );
},

getScriptSync: function( url ) {
_evalSrc: function( url ) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I said previously and still feel very strongly about: I'd like to avoid creating new API. "_" prefixing doesn't cut it.

return jQuery.ajax({
url: url,
type: "GET",
Expand Down
2 changes: 1 addition & 1 deletion src/manipulation.js
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ jQuery.fn.extend({

if ( node.src ) {
// Hope ajax is available...
jQuery.getScriptSync( node.src );
jQuery._evalSrc( node.src );
} else {
jQuery.globalEval( node.textContent.replace( rcleanScript, "" ) );
}
Expand Down
6 changes: 3 additions & 3 deletions test/unit/ajax.js
Original file line number Diff line number Diff line change
Expand Up @@ -1682,11 +1682,11 @@ module( "ajax", {
});
});

//----------- jQuery.getScriptSync()
//----------- jQuery._evalSrc()

test( "jQuery.getScriptSync()", 2, function() {
test( "jQuery._evalSrc()", 2, function() {
Globals.register("testBar");
jQuery.getScriptSync( url("data/test.js") );
jQuery._evalSrc( url("data/test.js") );
strictEqual( window["testBar"], "bar", "Script was evaluated" );
});

Expand Down