var url = 'http://domain.com/file.php?id=1';
or
var url = 'https://domain.us/file.php?id=1'
or
var url = 'domain.de/file.php?id=1';
or
var url = 'subdomain.domain.com/file.php?id=1'
from either one of these urls I want to get only the path, in the case above:
var path = '/file.php?id=1';