Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Triggering jQuery after page has loaded

  • This topic is empty.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #40954
    CameronDuthie
    Participant

    Hey there,

    I’ve been trying to figure this out for a while but with no luck.

    I’ve got an [html file](http://orchidaberdeen.com/ “”) that loads an [external html](http://orchidaberdeen.com/6_toggle/1.html “”) file and within that external html file is some jQuery that i need to work.

    The problem appears to be that my original file loads the jQuery but when the external page gets loaded it doesn’t trigger the jQuery from the original file, thus not working.

    I’ve tried the [get.Script](http://api.jquery.com/jQuery.getScript/ “”) but that doesn’t seem to work.

    Hoping someone would have some pointers?

    #115248
    JohnMotylJr
    Participant

    @CameronDuthie : I think an example would be best in this situation for people to see what you are working with.

    Is the JS that you are trying to have run wrapped in an anonymous function?
    why cant you just use the JS from the external in your main page, or both?
    Why not make that JS external and call it in from both?

    This is why an example would help you possibly get some narrower answers.

    #115249
    Paulie_D
    Member

    @JohnMotylJr He did give links!

    #115250
    JohnMotylJr
    Participant

    @CameronDuthie : I take it you are referring to t_close_menu( )?

    #115251
    CameronDuthie
    Participant

    @JohnMotylJr im actually meaning the gallery section on the main site, when you click on the circles the page expands open to reveal thumb nails. The thumb nail page is an external html file that is stored in a folder called **6_toggle** and is getting loaded into the index.html file by this,

    t_slide.load(“6_toggle/”+page+”.html”);

    But this function doesn’t seem to like to load the jQuery from its external page.

    So i’m just trying to find a workaround that will re-trigger the jQuery so the thumbnails display a lightbox effect that i’ve got set up.

    #115257
    JohnMotylJr
    Participant

    @CameronDuthie : If you’r loading another html page inside your first one then try to target it with js from the second, im not really sure if the secondary js will pick up on the DOM. Have you tried just putting that code from your second html file into an anonymous function on your main page?

    Hmm, actually, are you referring to the light box script?

    Try loading all that into your main html page.

    #115284
    CameronDuthie
    Participant

    @JohnMotylJr Thank you for you help man, but i’ve actually tried all those suggestions. Yeah you got it, it’s the lightbox script i’m trying to implement.

    No matter where i put the reference the jquery just doesn’t seem to want to load/trigger from the second html file.

Viewing 7 posts - 1 through 7 (of 7 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.