I have a kind of complicated question here.
Right now I am running a script on my page that, when a user clicks on a link, I use jQuery's .load()
to load an image from a custom attribute called 'imglocation'.
This all works fine; my question is the link the user clicks puts a hash tag in the url which i want to then use to match with a link on the page and run the same function as if the user clicked on it. The idea being that when you send someone a link when they open it in their browser the function will run and show the image that someone has sent to them.
What I was trying to do is:
var hashedLink = location.hash;
var findLink = $(".photothumb a").attr("href");
if(hashedLink == findLink){
// In here set some variable to flag the link
// then load the image based on the attr imgLocation of the same link.
}
If this is possible please let me know.