I am developing an application and want to be able to grab only the resource from the URL so I have written a regular expression, but it doesn't seem to be working and I get an uncaught type error. Can anyone help with this?
var link = document.location;
var res = link.match(/\/.*php/g);
document.locationisn't a string. It's aLocationobject.