daily pastebin goal
39%
SHARE
TWEET

Untitled

a guest Aug 18th, 2018 57 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Extracting csrf-token attribute using Ext.core
  2. <!DOCTYPE html>
  3. <html>
  4. <head>
  5.   <title>Sencha on Rails</title>
  6.   <!-- styles, scripts etc. -->
  7.   <meta name="csrf-param" content="authenticity_token" />
  8.   <meta name="csrf-token" content="JzrbB8G0gpcKoWcnL8+AllPSXzUVwqDSp5yjgEGqYwk=" />
  9. </head>
  10. <body></body>
  11. </html>
  12.    
  13. var csrfToken = jQuery("meta[name=csrf-token]").attr("content");
  14. > "JzrbB8G0gpcKoWcnL8+AllPSXzUVwqDSp5yjgEGqYwk="
  15.    
  16. var csrfToken = Ext.query('meta[name=csrf-token]')[0].getAttribute('content');
  17.    
  18. var csrfToken = Ext.select('meta[name=csrf-token]').elements[0].getAttribute('content');
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