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
| glow.events.addListener(theForm, 'submit', function() { | |
| // do your ajax stuff here | |
| // prevent the form submitting | |
| return false; | |
| }); |
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
| glow.events.addListener(theForm, 'submit', function() { | |
| // do your ajax stuff here | |
| // prevent the form submitting | |
| return false; | |
| }); |
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
| <div id="panel1"> | |
| <p>This is my first Panel</p> | |
| </div> | |
| <div id="panel2"> | |
| <p>This is my second Panel</p> | |
| </div> | |
| <p><a href="#" id="showFirstPanel">Show first panel</a></p> | |
| <p><a href="#" id="showSecondPanel">Show second panel</a></p> |
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
| glow.ready(function() { | |
| // create your panel, this will take it off the page | |
| // the form must have id="form" for the below to work | |
| var myPanel = new glow.widgets.Panel("#form"); | |
| // listen for clicks on the "Enquire Now!" button | |
| // The "Enquire Now!" button must have id="enquireNow" | |
| glow.events.addListener('#enquireNow', 'click', function() { | |
| // show the panel | |
| myPanel.show(); |
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
| glow.ready(function() { | |
| var myPanel = new glow.widgets.Panel("#formPanel"); | |
| //display panel | |
| myPanel.show(); | |
| }) |
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 MyClass; | |
| (function() { | |
| MyClass = function() { | |
| this.val = 2; | |
| } | |
| MyClass.prototype.publicFunction = function() { | |
| return privateFunction.call(this); |
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 functions = [], | |
| functionsLen = 0; | |
| function buildMassiveString() { | |
| // build a ~1mb string | |
| return new Array(1024*1024).join('#'); | |
| } | |
| function addListener() { | |
| var massiveString = buildMassiveString(); |
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 functions = [], | |
| functionsLen = 0; | |
| function buildMassiveString() { | |
| return new Array(1024*1024).join('#'); | |
| } | |
| function addFunction() { | |
| var massiveString = buildMassiveString(); | |
| functions[ functionsLen++ ] = function() {}; |
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
| glow.events.addListener("#yourForm", "submit", function() { | |
| glow.net.post( | |
| // make a request to the place the form posts to | |
| this.action, | |
| // get the data from the form to send to the server | |
| glow.dom.get(this).val(), | |
| { | |
| onLoad: function(response) { | |
| // response.text() is the response from the server | |
| } |
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
| function trimFormField(selector, on) { | |
| var field = glow.dom.get(selector); | |
| return ["custom", { | |
| on: on, | |
| arg: function(values, opts, callback, formData) { | |
| field.val( glow.lang.trim(values[0]) ); | |
| callback(glow.forms.PASS, ""); | |
| } | |
| }]; | |
| } |