Skip to content

Instantly share code, notes, and snippets.

@miwebguy
Last active August 29, 2015 14:20
Show Gist options
  • Select an option

  • Save miwebguy/228c3e3609cfa149ef4d to your computer and use it in GitHub Desktop.

Select an option

Save miwebguy/228c3e3609cfa149ef4d to your computer and use it in GitHub Desktop.
Uppercase word in Javascript
//
// 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