Jump to content

Combining two different JQuery functions


charl9cfc

Recommended Posts

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.