Replace all tokens in document


/ Published in: JavaScript
Save to your folder(s)

This will replace every token in document that is 32 digits in length. Written for mootools.


Copy this code and paste it in your HTML
  1. function replaceTokens(n)
  2. {
  3. $(document).getElements('input').each(function(e){
  4. if (e.getProperty('name') && e.getProperty('name').length == 32 && e.getProperty('value') == '1' && e.getProperty('type') == 'hidden') {
  5. e.setProperty('name', n);
  6. }
  7. });
  8. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.