Now Listening…

PhotoLegal Podcast No. 5 – US Special (Update: Fixed Audio)” performed by PhotoLegal

AJAX W'Hey!

ajaxbars

All fixed now! :-D


In addition to comments and my other tests, all the side items apart from Author now use the script.aculo.us' Ajax.Updater to import a file dynamically and display it when you click on the + to expand. Sadly this doesnt seem to be consistent. In my tests on my PowerBook last night, it worked in Safari but not in Firefox, whereas now on my work G5 its working in Firefox :? (and its stopped again)


In other tests on the Mac this morning its not working in Opera, OmniWeb or Camino (Err, now it works). In my Windows test, it doesnt work in Internet Explorer (no biggie as I stopped supporting IE ages ago despite 59% of my visitors using it according to google) or Firefox.


To be clear about what is and isnt working, the divs (or ols actually) show and hide, but it doesnt seem to load the page. This is very odd as Ive even saved the source from the rendered page, tested that and it works fine.


Actually, Im tempted to just going back to showing and hiding the ols. My reasons for dynamically loading the ols where that firstly it would save bandwidth as you only have to load what you want to see and secondly so that your seeing the latest state of the site, but to be honest, I dont think I get enough hits for that to be a valid reason.


Still, i would like to get it to work as itll be a useful ability Im sure.


So, any ideas?

Ah, got it! DOH! because Ive hardcoded the url as www.somefoolwitha.com into the page, it will only work if youre on that domain. Sans the www or sflwa.com wont work. Right stage 2.


Next stage, draggable boxes


I fixed it

by changing the hardcoded URL to
new Ajax.Updater({success:'div_id'}, 'http:// ?php echo $_SERVER['HTTP_HOST'] ?>/path/to/page.php',{asynchronous:true}); I think it should work in all browsers now (watch out for the space there in ?php). 4 hours (!) I spent yesterday trying to debug that, then I guess it today within 30 minutes!


17 Responses to AJAX W'Hey!

  1. 9336 kristin 2005-11-22 04:19:30

    Very cool. It works smoothly in FF on windows. The coding is way over my head but i like the way it looks!

  2. 9337 Laundro 2005-11-22 14:03:29

    This is incredible... You should totally make this in to a plugin...

  3. 9338 Matthew 2005-11-22 14:06:08

    heh, cheers but I dont see how it could be a plugin really.

  4. 9353 Brendan 2005-11-29 01:38:12

    .. very nice work. :)

    Ajax is pretty darn funky - is there anything it can't do?

  5. 9355 Theron Parlin 2005-11-30 01:13:41

    Wow, great job! Your site looks fantastic, and I'm loving the functionality!

  6. 9356 Matthew 2005-11-30 01:18:42

    Cheers Man. Still needs some work .. when I can get round to it.

  7. 9364 h0bbel 2005-12-01 23:02:18

    Ok, now I know who to ask when I fail miserably trying to use script.aculo.us libraries in my new Gallery 2 theme... :-)

  8. 9365 Barry 2005-12-02 16:08:06

    All i get is "loading..."

    :s

  9. 9366 Matthew 2005-12-02 16:10:22

    I think thats down to wp-cache, Im having a look.

  10. 9367 Barry 2005-12-02 16:17:05

    w00t!

    Working now. :)

  11. 9368 Matthew 2005-12-02 16:21:00

    Yup, its really annoying, wp-cache caches the page for a while, so if youre using the url sans-www. or using sflwa.com but with www. is cached then it wont work.

    Im not hugely bothered though.

  12. 9369 Barry 2005-12-02 16:26:25

    Ah, yep. Just noticed it there.

    If I view your site with the www. it loads ok. if I don't use all the w's, it doesn't. Meh.

    new Ajax.Updater({success:'div_id'}, 'http://www./path/to/page.php',{asynchronous:true});

    ?

  13. 9370 Matthew 2005-12-02 16:28:59

    it works fine without wp-cache though, it wont load pages from the domain without the www. if you have www. in the browser. I also tried doing the direct /path/to/file.php but that wont work.

  14. 9383 Barry 2005-12-14 16:28:16

    Hello Matt.

    Any idea if it's possible to get the Effect.BlindUp/Down to work through one link?

    I'm using it for some stuff, but using two links is a bit of a pain. Just checking with you first, as I'm guessing you've been using it longer than I have.

  15. 9384 Matthew 2005-12-14 16:31:05

    I believe so, but Ive not actually tried it, I quite like having the 2 buttons atm.

  16. 9385 Theron Parlin 2005-12-14 16:35:48

    Barry,

    Yes, it's possible. I did it at www.matthewgood.org on the permalink pages with the
    tags/options feature. Feel free to copy the javascript code...

    -Theron

  17. 9386 Barry 2005-12-14 16:38:22

    Cheers mate. :)