Skip to content

Instantly share code, notes, and snippets.

@luv2code
Last active December 15, 2015 14:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save luv2code/5274902 to your computer and use it in GitHub Desktop.
Save luv2code/5274902 to your computer and use it in GitHub Desktop.
var ko = window.ko;
if( !ko){
if(typeof window.require === 'function') {
try{
ko = require('ko');
} catch { /*ingore */ }
try{
ko = require('knockout');
} catch { /*ingore */ }
}
if(!ko) {
return {error:"knockout.js is not used in the page (ko is undefined). Maybe u are using iFrames, if so, browse to the url of the frame and try again."};
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment