As3: Capture the HREF, Pathname, Host, userAgent


/ Published in: ActionScript 3
Save to your folder(s)

Here's how I was able to capture the HREF of a page using actionscript


Copy this code and paste it in your HTML
  1. //Here's a list of helpful items to capture
  2. var pageURL:String = ExternalInterface.call('window.location.href.toString');
  3. var pageHost:String = ExternalInterface.call('window.location.hostname.toString');
  4. var pagePath:String = ExternalInterface.call('window.location.pathname.toString');
  5. var pageProtocol:String = ExternalInterface.call('window.location.protocol.toString');
  6. var userAgent:String = ExternalInterface.call('window.navigator.userAgent.toString');
  7. var platform:String = ExternalInterface.call('window.navigator.platform.toString');
  8.  
  9.  
  10. private function getQueryString():String
  11. {
  12. var query:String = ExternalInterface.call("window.location.pathname.toString");
  13. //ExternalInterface.call("window.location.href.toString");
  14. return query;
  15. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.