Last active
August 29, 2015 14:20
-
-
Save miwebguy/228c3e3609cfa149ef4d to your computer and use it in GitHub Desktop.
Uppercase word in Javascript
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
| // | |
| // because I like to Captilize Id's | |
| // <span='Name'><label><input name='name'/></label></span | |
| // | |
| var TSD = {};// my object | |
| TSD.ucword = function(string) { | |
| return string.charAt(0).toUpperCase() + string.slice(1); | |
| } | |
| // usage | |
| fieldId = TSD.ucword(field + workorder); | |
| if($(fieldId)) { | |
| $(fieldId).set('html',field_value); | |
| } else { | |
| (function(){ window.location.href = '/view/' + workorder }).delay(500); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment