Forums

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

Home Forums JavaScript load external div into a page via jquery when the div has script

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #35560
    mrdman
    Member

    Hi I’m trying to load a part of a page (that has script in it) into another page using jquery. However, though the html loads in correctly, none of the script is working.

    I’m using code from https://css-tricks.com/video-screencasts/85-best-practices-dynamic-content/
    ie. the pages all work without java (static pages) and when java is enabled, instead of going to bio.html you get taken to ..#bio.html.

    However if I’ve got any script I would like to be loaded .. ie. lightbox gallery or even a simple jav split and put back together email address hider.

    Any help greatly appreciated. I’m not very clued up about jquery at the moment unfortunately and though I’ve been trying to read and learn, alot is going over my head..

    Not sure how best it is to show you the page as it’s not live yet. Maybe if it helps I can upload a zip of the site. It’s a simple 6 page musician site.
    Though my code is exactly like the css-tricks page, just that I have a lightbox on one page (which loads fine if there’s no hash in the address – but when hash is there, it shows thumbnails, and when you click one, it just takes you to the larger .jpg destination page (no lightboxness etc).)

    Thanks

    #92366
    artjunkie
    Participant

    Wrap whatever js you need for the page being loaded in a function, and then call that function as a callback on successful load. Basically you want the javascript that renders your slideshow or whatever to run (again) after you’ve loaded the page.

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