daily pastebin goal
19%
SHARE
TWEET

Untitled

a guest May 16th, 2018 102 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var ta1 = Titanium.UI.createTextArea({
  2.    id:'idOfADOMElement',
  3.    value: 'Here\'s a new #tweet @joeschmoe',
  4.    keyboardType:Titanium.UI.KEYBOARD_ASCII,
  5.    autocorrect:false,
  6.    textAlign:'left',
  7.    height:100,
  8.    width:255
  9. });
  10.  
  11. //recalculate on every change
  12. ta1.addEventListener("change", function(e) {
  13.   var text = e.value;
  14.   var tweetLimitStatus = 140 - text.length;
  15.   // tweetLimitStatus is now how many characters remaining in a tweet, can be negative
  16.   // if the tweet were too long
  17. });
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top