Skip to content
Browse files

Always load a default.js if it exists.

  • Loading branch information...
1 parent d12cd0d commit 81a0ce2c2f90ea439f6fce12ca2e1cb88d7d71d6 @dpiddy dpiddy committed with defunkt
Showing with 10 additions and 8 deletions.
  1. +10 −8 ext/dotjs.js
View
18 ext/dotjs.js
@@ -1,9 +1,11 @@
-$.ajax({
- url: 'http://localhost:3131/'+window.location.host.replace('www.','')+'.js',
- success: function(d){
- $(function(){ eval(d) })
- },
- error: function(){
- console.log('no dotjs server found at localhost:3131')
- }
+$.each(['default', window.location.host.replace('www.','')], function(index, name) {
+ $.ajax({
+ url: 'http://localhost:3131/'+name+'.js',
+ success: function(d){
+ $(function(){ eval(d) })
+ },
+ error: function(){
+ console.log('no dotjs server found at localhost:3131')
+ }
+ })
})

0 comments on commit 81a0ce2

Please sign in to comment.
Something went wrong with that request. Please try again.