Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jul 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Need a bit of help with AJAX-loaded content & javascript

    Hi there,

    Hoping somebody here can at least point me toward a solution on this. Feel like I've tried everything and haven't been able to crack it - though it seems to me like it would be a very simple issue for anybody who actually knows what they're doing with javascript/AJAX.

    I'm working on a very simple web page: http://andrewpop.com/2012/ - the side menu loads external .php files containing each categories content into the 'content' div.

    I have this working just fine, but I'm trying to implement this plugin: http://www.appelsiini.net/projects/lazyload onto the images inside each content page so that they don't all load at once (and look much nicer fading in). As soon as I got the AJAX loading working, the javascript stopped working within the loaded page. I've tried using "loadobjs()" to no avail, and I'm certainly not well versed enough in javascript to figure this out. The first link under 'PRINT' still has all of the plugin code set up.


    Any takers? As an aside, I'd also really like to be able to mask the javascript:ajaxpage links from appearing in the status bar of a visitor's browser - though none of the methods I've found thus far seem to be doing the trick.

    Any help would be much appreciated!

  • #2
    Regular Coder
    Join Date
    Mar 2011
    Posts
    148
    Thanks
    0
    Thanked 20 Times in 20 Posts
    Hi,
    If what you want is to run JS script that is in content loaded via Ajax, see this tutorial: Execute JavaScript scripts loaded via AJAX .
    Maybe there is also a technique with jQuery, look on the net for: " jquery executing javascript script loaded ajax " .


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •