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 3 of 3

Thread: Ajax help

  1. #1
    New to the CF scene
    Join Date
    Dec 2002
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Ajax help

    Here's my working js:

    var xmlHttp

    function showMainCat(str)
    {
    var url="ajax_subCat.asp?sid=" + Math.random() + "&q=" + str
    xmlHttp=GetXmlHttpObject(stateChanged)
    xmlHttp.open("GET", url , true)
    xmlHttp.send(null)
    }

    function stateChanged()
    {
    if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
    {
    document.getElementById("txtHint").innerHTML=xmlHttp.responseText
    }
    }


    What I need to do is when showMainCat(str) is triggered, it sends 2 different html files to 2 different divs in the document.

  • #2
    Regular Coder
    Join Date
    Aug 2005
    Location
    Toronto, ON, Canada
    Posts
    231
    Thanks
    0
    Thanked 0 Times in 0 Posts
    xmlHttp => xmlHttp1 & xmlHttp2
    stateChanged => stateChanged1 & stateChanged2

    and so on
    rm -f /

  • #3
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*


  •  

    Posting Permissions

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