Results 1 to 10 of 10

Thread: problem using ajax to load multiple galleries

  1. #1
    Join Date
    Feb 2008
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default problem using ajax to load multiple galleries

    1) Script Title: Dynamic Ajax Content

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...jaxcontent.htm

    3) Describe problem: Hi everyone

    I want to be able to load a gallery from a link using ajax. I have never dealt with ajax before but after messing around with the demo script it seemed simple enough until i tried to load a PVII image gallery...it loads the gallery but the gallery doesn't work

    i've uploaded an example of the basic modded demo script here http://groupserver.co.uk/ajax.htm
    as you can see if you click the gallery link it doesn't work correctly. You can see the gallery working correctly if you visit the linked page directly http://groupserver.co.uk/external.htm

    any help would be much appreciated

    Jase

  2. #2
    Join Date
    Dec 2007
    Location
    Ankara, Turkey
    Posts
    160
    Thanks
    2
    Thanked 2 Times in 2 Posts

    Default

    You should call the "P7_HGSinit(1,1,1,1,1,1,0,0)" function AFTER the gallery is loaded dynamically

  3. #3
    Join Date
    Feb 2008
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by BYK View Post
    You should call the "P7_HGSinit(1,1,1,1,1,1,0,0)" function AFTER the gallery is loaded dynamically
    thanks for the quick response

    on the external page the function is called from a body.onload
    how would i call the function after the gallery has loaded? by a window.onload?

  4. #4
    Join Date
    Dec 2007
    Location
    Ankara, Turkey
    Posts
    160
    Thanks
    2
    Thanked 2 Times in 2 Posts

    Default

    No, definitely not

    First of all the external page should NOT contain any html, head or body tags, keep this in mind

    You should place this function call at the end of the loadpage function.

  5. #5
    Join Date
    Feb 2008
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by BYK View Post
    No, definitely not

    First of all the external page should NOT contain any html, head or body tags, keep this in mind

    You should place this function call at the end of the loadpage function.
    ok, i removed the html, head and body tags from the external page but i don't know how to call the fucntion from within the loadpage function of the ajax code? my head hurts

  6. #6
    Join Date
    Dec 2007
    Location
    Ankara, Turkey
    Posts
    160
    Thanks
    2
    Thanked 2 Times in 2 Posts

    Default

    You should just write P7_HGSinit(1,1,1,1,1,1,0,0) before the end "}" of the loadpage function

    Nothing that hard

    By the way make sure you have included the gallery script in the main page(the one which has html, head etc. )

  7. #7
    Join Date
    Feb 2008
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    BYK you're a star!

    it seems to be working fine now apart from a null error in the ajax script being reported by IE??

  8. #8
    Join Date
    Dec 2007
    Location
    Ankara, Turkey
    Posts
    160
    Thanks
    2
    Thanked 2 Times in 2 Posts

    Default

    Everyone knows that I'm nothing but a simple coder but thank you

    The P7_HGSinit(1,1,1,1,1,1,0,0) function is called EVERYTIME you load a dynamic content. This might be the reason of the null error. If you have some JS knowledge, you may modify the part I told you to change but my insticnts tell me that you do not know very much JS

  9. #9
    Join Date
    Feb 2008
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    i'm not 'too bad' with JS so should be able to sort it out but i certainly wouldn't call myself a JS programmer

    thanks again for all your help

  10. #10
    Join Date
    Dec 2007
    Location
    Ankara, Turkey
    Posts
    160
    Thanks
    2
    Thanked 2 Times in 2 Posts

    Default

    I was not saying you are too bad, but you first acted like yo do know very little JS

    Then you are welcome and if you have any problems do not hesitate to ask

Bookmarks

Posting Permissions

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