Skip to content

Instantly share code, notes, and snippets.

@demux
Created June 8, 2015 17:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save demux/4d4ce440d7c379305a9a to your computer and use it in GitHub Desktop.
Save demux/4d4ce440d7c379305a9a to your computer and use it in GitHub Desktop.
$(function(){
var url = $("script[src$='findfilehosttest.js']").attr('src')
var matches = url.match(/^https?\:\/\/([^\/?#]+)(?:[\/?#]|$)/i)
var domain = matches && matches[1]
alert(domain)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment