I am trying to call a function to open a lightbox when someone clicks a link that create. I have seen this done before but do not recall how something like:
google.com:javascript(openWindow())
does anyone know how I can do this?
I am trying to call a function to open a lightbox when someone clicks a link that create. I have seen this done before but do not recall how something like:
google.com:javascript(openWindow())
does anyone know how I can do this?
javascript:openWindow()
is a URL that most browsers interpret as invoking the openWindow()
function and treating the result coerced to a string as the result of loading the URL.
See HTML5 6.1.5 The javascript: URL scheme for more detail.
Do you mean
<a href="#" onclick="yourOpenLightboxFunction(); return false;" />
This answer gives more detail.
I think it can be BookMark, you can bookmark to quickly run JavaScript functions from your address bar.
The following code ended up being what helped me to complete the task. I found the answer here
var url = document.location.href;
if(url.search(/\?lightbox/i) !== -1){
//run function here
}