Skip to content

Commit

Permalink
Fix to use rpc_global object consistently
Browse files Browse the repository at this point in the history
  • Loading branch information
John Luxford committed Oct 13, 2009
1 parent ae8f01e commit 81236d1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion js/rpc-compressed.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion js/rpc.js
Expand Up @@ -131,13 +131,16 @@ function rpc_decode (txt) {
* process() method. For this reason, it is advisable to create a single
* global rpc object for your entire web application.
*/
var rpc_global;
var rpc_global = null;

/**
* This function creates a new rpc object, which provides an abstraction
* over the JavaScript XMLHttpRequest object.
*/
function rpc () {
if (rpc_global !== null) {
return rpc_global;
}
scripts = document.getElementsByTagName ('script');
for (var i = 0; i < scripts.length; i++) {
if (scripts[i].src.match (/rpc(-compressed)?.js$/)) {
Expand Down

0 comments on commit 81236d1

Please sign in to comment.