Created
March 12, 2012 09:13
-
-
Save dhavaln/2020837 to your computer and use it in GitHub Desktop.
Phonegap 1.5/Cordova Lazy Load Test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> | |
<html> | |
<head> | |
<script src="https://raw.github.com/jbrantly/yabble/master/lib/yabble.js"></script> | |
<script src="js/jquery.js"></script> | |
</head> | |
<body> | |
<button id="loadPhonegap">Load Phonegap</button> | |
<button id="checkDevice">Check Device</button> | |
<button id="callPlugin">Call Plugin</button> | |
<div id="console"> | |
</div> | |
<script> | |
require.setModuleRoot("js"); | |
require.useScriptTags(); | |
$("#loadPhonegap").click(function(){ | |
require.ensure([ "cordova-1.5.0" ], function(req) { | |
req.ensure([ "plugin1" ], function() { | |
$("#console").append("Plugin1 loaded<br>"); | |
}); | |
}); | |
}); | |
// Check PhoneGap Device object | |
$("#checkDevice").click(function() { | |
console.log(JSON.stringify(device)); | |
}); | |
// Call PhoneGap Plugin | |
$("#callPlugin").click(function() { | |
window.plugins.plugin1.call(); | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What about lazyloading the java part of the plugin?