I have following scenario: User clicks on a link with parameter like this
www.abc.com/page1?xxx.
On page1 I would like to have script that detects parameter xxx and runs a link with a class asap (no need to wait for dom to finish, it can be in background)(running a link opens modal window with some text). I use jquery 1.8.
Edit: I am using following code: based on this question Conditionally open popup video based on URL query string
(function($){
Drupal.behaviors.zzz = {
attach: function (context) {
$(document).ready(function(){
function getURLParameter(name) {
return decodeURI(
(RegExp(name + '=' + '(.+?)(&|$)').exec(location.search)||[,null])[1]
);
}
if(getURLParameter('param')==1){
$(".colorbox-node").trigger('click');
}
});
}
};
})(jQuery);
However, there seems to be some loop jquery that prevents the page to finish loading. I suppose that is caused by colorbox plugin trying to set top value and looking at the console I can see "setting top" message constantly working until browser crashes. How to avoid this? Thank you