function add(a,b){ alert("Our second function is called") return a+b; }
function addTwoThings(a,b){
alert("First function is called")
return add(a,b);
}
function add(a,b){ alert("Our second function is called") return a+b; }
function addTwoThings(a,b){
alert("First function is called")
return add(a,b);
}
| <form> | |
| <input type="text" value="HEllo"> | |
| </form> | |
| <ul class="results"> | |
| </ul> |
| <script> | |
| function doSomething(){ | |
| var todo = $.Deferred(); | |
| $.when("") | |
| .then(function(){ | |
| setTimeout(function(){ | |
| alert("Our First Thing is Done!!") | |
| }, 500) |
| // This is a manifest file that'll be compiled into application.js, which will include all the files | |
| // listed below. | |
| // | |
| // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, | |
| // or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path. | |
| // | |
| // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the | |
| // the compiled file. | |
| // | |
| // WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD |
| // 1. We are going to make an ajax request. | |
| // 2. We are going to GET some response TEXT. | |
| // 3. We are going to append the TEXT to the DOM. | |
| // Callback to wait for DOM load event | |
| $(function(){ |