Apologies for no code. But I don’t have a starting point for this question.
I have searched jquery and javascript documentation but I must be using the wrong terms because I am not getting anywhere.
I wish to take action within a jquery script dependant on what invoked the script.
i.e. I have the same jquery script in several php files. I don’t want to create a separate script for each php file. I want to know which php file invoked that script and alter it’s behaviour accordingly.
It seems like a perfectly reasonable thing to want to do so I am hoping that it is a really easy question.
Look in the
window.locationobject – it’ll tell you the URL of the containing HTML page.