This file contains hidden or 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
| def writer = new FileWriter(".classpath") | |
| groovy.xml.XmlUtil.serialize( classpath,writer ) |
This file contains hidden or 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
| def classpath = new XmlParser().parse('.classpath') | |
| classpath.each { | |
| println "${it.@kind} ${it.@path}" | |
| } | |
| def newEntry = new Node(classpath, 'classpathentry', [kind:'lib', path:'libs/abc.jar']) | |
| println "after adding a new entry:" | |
| classpath.each { | |
| println "${it.@kind} ${it.@path}" |
This file contains hidden or 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
| <classpathentry kind="lib" path="libs/abc.jar"/> |
This file contains hidden or 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
| public boolean onJsPrompt(WebView view, String url, String message, String defaultValue, JsPromptResult result) { | |
| ... | |
| String r = pluginManager.exec(service, action, callbackId, message, async); | |
| ... | |
| } |
This file contains hidden or 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
| PhoneGap.exec = function(success, fail, service, action, args) { | |
| ... | |
| var r = prompt(JSON.stringify(args), "gap:"+JSON.stringify([service, action, callbackId, true])); | |
| ... | |
| }; |
This file contains hidden or 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
| // Get acceleration | |
| PhoneGap.exec(successCallback, errorCallback, "Accelerometer", "getAcceleration", []); |
This file contains hidden or 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
| var myObject = { | |
| value: 0, | |
| increment: function() { | |
| value +=1; | |
| return value; | |
| } | |
| } | |
| myObject.increment(); // => ERROR |
This file contains hidden or 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
| var myObject = { | |
| value: 0, | |
| increment: function() { | |
| value +=1; | |
| return value; | |
| } | |
| } | |
| myObject.increment(); // => ERROR |
This file contains hidden or 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
| var myObject = { | |
| value: 0, | |
| increment: function() { | |
| this.value +=1; | |
| return this.value; | |
| } | |
| } | |
| myObject.increment(); // => 1 |
This file contains hidden or 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
| //call before function foo is defined | |
| foo(); // will fail, because foo() is not defined. | |
| var foo = function () { | |
| alert("foo"); | |
| } | |
| //call after function foo is defined | |
| foo(); //=> alert("foo"); |