Last active
August 29, 2015 14:06
-
-
Save azat-co/d70592aa5f537395330d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Executed through a self-invoking anonymous function | |
(function(){ | |
//declare the variables that we will need | |
var imgName = "10584590_588581994607732_199003263_n.jpg"; | |
var uriA = "http://photos-e.ak.instagram.com/hphotos-ak-xfa1/10584590_588581994607732_199003263_n.jpg"; | |
var uri1 = "http://instagram.com/p/sLLSiTCXB5/?modal=true"; | |
var uri2 = "http://instagram.com/p/sLLSiTCXB5/"; | |
//build the logic | |
if (document.URL === uri1) { | |
window.open(uriA, "_self"); | |
} else if | |
(document.URL === uri2) { | |
window.open(uriA, "_self"); | |
} else { | |
alert ("Sorry The image isn't here!"); | |
} | |
})(); | |
// I didn't know how to add logic to traverse the DOM and make the Image clickable. | |
// Started to look at that, but got lost in a spiral of Stackoverflow threads. | |
// document.getElementsByName(imgName===uriA); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment