Man my poor blog hasn’t been updated in quite some time. What on earth could I do to remedy that situation? Wait, I GOT IT! I’ll add a new post! 🙂
Here are two really simple but really useful JavaScript tricks.
#1
document.getElementById(x).click();
The above is handy when you want to programmatically click a button for the user based on whatever logic you write. I used it to fire some ATLAS (now called ASP.Net AJAX) animations after I validated some fields.
#2
Add the following to your JavaScript library to trim the white space from the beginning and end of your strings.
String.prototype.trim=function() { return this.replace(/^\s*|\s*$/g,''); }
The above allows you to do this: xString = xString.trim();
Check out this Wikipedia article on ‘trim’. There are examples on how to trim a string for numerous programming languages.
nice new intro. you are dusty reagan and you <3 computers!
FACT! Dusty <3s Computers! It's as true as 1+1 = math. 😉