charl9cfc Posted May 27, 2013 Share Posted May 27, 2013 Hi all Am trying to combine two JQuery functions, but without any success. if (querySt("photoid")) { var value = querySt("photoid"); alert(value); } with window.onload = function() {if(window.location.hash) {$(window.location.hash).trigger('click');}}; Have tried the following: if (querySt("photoid")) { var value = querySt("photoid");window.onload = function() {if(window.location.value) {$('#' + window.location.value).trigger('click');}}}; Hash requires to be replaced with the actual '#' symbol.photoid returns the image id value like 415. Any suggestion will be much appreciated. Kind regards,Charl Link to comment https://forums.phpfreaks.com/topic/278418-combining-two-different-jquery-functions/ Share on other sites More sharing options...
charl9cfc Posted May 27, 2013 Author Share Posted May 27, 2013 Solved the issue by using: window.onload = function() { if (querySt("photoid")) { var value = querySt("photoid"); window.location.hash = querySt("photoid"); } if(window.location.hash) { $(window.location.hash).trigger('click'); } }; Regards,Charl Link to comment https://forums.phpfreaks.com/topic/278418-combining-two-different-jquery-functions/#findComment-1432475 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.