I’m running a click trigger when the page loads to show an iframe of prettyPhoto. However the trigger does not run unless i use the developer tools for IE 9.
It runs fine in Google.
Basically it searches the url string for a target text after #. If the text is there, then it will trigger the handler. Any ideas? My url # is – http://www.nvcc.edu/home/ssuh/wall3/#nessie-vanta
<script>
var $ = jQuery.noConflict();
jQuery(window).load(function(){
$('#wall1').wallmasonry({});
$("a[rel^='test']").prettyPhoto({deeplinking:false,
iframe_markup: '<iframe src ="{path}" width="{width}" height="{height}" frameborder="no" scrolling="no"></iframe>'}
);
var target = window.location.href.split('#')[1];
if (target == 'nessie-vanta') {
console.log("tester hit");
$('a#nessie-vanta').trigger('click');
alert("nessie");
};
})
</script>
It is because of
console.logwhich is not supported by IE. In IE it throws error at that line and breaks the further javascript execution.Try something like this