views:

205

answers:

1

i have a page on my site (let's call it list_page.html) with js functions that allow you to click a link and see a list of multimedia objects. clicking another link (on the same page) will hide the div with the multimedia list and reveal a list of video objects. another link will hide whatever list is visible and reveal a list of audio objects, and so on...

$("#multibtn").click(function(){
    $(".menuslab").hide();
    $(".menuslab > *").hide();
    $("#multi_div").fadeIn("slow");
    $("#multi_div > *").fadeIn("slow");
});

if on my main page (mainpage.html) i have a link named "multimedia", is there a way i can get it to navigate to list_page.html AND execute the function that calls the list of multimedia objects?

+3  A: 

Closest way perhaps would be to append a query string to the URI, parse location.hash and see if it's a certain value, and if so trigger that click.

meder
What soulscratch said - though he means a fragment identifier (text after '#'), not a query string (text after '?'). ;-) This is, for instance, how picasaweb works.
Eamon Nerbonne
Ack! Yes, thanks for the correction.
meder