Forums

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

Home Forums JavaScript All Ajax Theme – Js into pages problem

  • This topic is empty.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #35118
    ChristopheZF
    Member

    Hi Everybody ;)

    I’ve watched the How to AJAXing a WP Theme screencast , and downloaded the updated theme.

    I’ve extracted and copied the scripts in order to use them into a WP theme that I’m working on, and everything is allright. However, I’ve got an issue (yep, it won’t be great otherwise…) with some template pages using Js inside.

    I registered all my scripts in the functions.php, and they load well, but nothing happens when pages are loaded through the AJAX methods. I mean, the scripts are well loaded in the header, but it’s like template pages are just loading without using them.

    To be more accurate: I’m using jPlayer, and jQuery form plugin for example. Any of those work when the page is loaded through AJAX.

    Is there any AJAX/Js tricks I forgot?

    #97584
    Rics
    Member

    +1
    I’ve this problem using jCarousel. I’m trying to solve this problem in a someway by searching on the web.

    #97604
    Kermet
    Member

    Probably they rely on document.ready function, or something like that.
    If they load into the #content’s ajax-ed area you probably have to change that logic a bit…just a guess.

    #97605
    Rics
    Member

    I was using Sorgalla’s jCarousel and I’ve solved in a way, but i’m not sure that’s nice and clean as i’m not an ajax master…i was inspired from a stackoverflow thread…
    I’ve put a delayed ajax request in the footer that request a js file that contain the jCarousel call:

    slide-start.js is simply the jquery call for the jCarousel script:

    Probably this could be done in a nice or different way, i’m sure.
    BTW including the call inside the #content don’t work.

    #97610
    Rics
    Member

    Well, i’ve also to admit that the solution works only on the homepage load, then when going to a menu item to another one the ajax call isn’t done.

    #99265
    Rics
    Member

    Ok, i didn’t had so much time in the last month to investigate the problem, but this evening i’ve decide to spend a bit of time into it and that’s a shame for me, the solution was so damn simple:
    put the jQuery calls inside the “$variablename.load(base + event.value + ‘ #inside’, function() { //jQuery calls here });”

    I don’t know if i’m allowed to report portions of the “allajax.js” code, so i’ve wrote just a small chunk.
    If you have the template you can find that code portion inside the script.

    Now it’s working flawlessy!

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