Guest User

Untitled

a guest
Aug 18th, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  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');
Add Comment
Please, Sign In to add comment