Created
September 11, 2009 18:22
-
-
Save cgravolet/185473 to your computer and use it in GitHub Desktop.
Data bind
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
| dataBind: function(data, ctrl){ | |
| var regexp = null; | |
| for (var key in data) { | |
| regexp = new RegExp("{" + key + "}","gi"); | |
| ctrl = ctrl.replace(regexp, data[key]); | |
| } | |
| return ctrl; | |
| } // dataBind() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment