Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Extracting csrf-token attribute using Ext.core
- <!DOCTYPE html>
- <html>
- <head>
- <title>Sencha on Rails</title>
- <!-- styles, scripts etc. -->
- <meta name="csrf-param" content="authenticity_token" />
- <meta name="csrf-token" content="JzrbB8G0gpcKoWcnL8+AllPSXzUVwqDSp5yjgEGqYwk=" />
- </head>
- <body></body>
- </html>
- var csrfToken = jQuery("meta[name=csrf-token]").attr("content");
- > "JzrbB8G0gpcKoWcnL8+AllPSXzUVwqDSp5yjgEGqYwk="
- var csrfToken = Ext.query('meta[name=csrf-token]')[0].getAttribute('content');
- var csrfToken = Ext.select('meta[name=csrf-token]').elements[0].getAttribute('content');
Add Comment
Please, Sign In to add comment