How can I envoke the lightbox 2.04 pop up and load it with my AJAX reponse once the user clicks, calling my AJAX script?
This after the page has already been loaded.
Javascript ajaxFunction calls Websphere Servlet via AJAXCode:<td rel="lightbox" class="sized2" onClick="ajaxFunction('594512','2009-07-27','XYZ','1','011');"
Code:function ajaxFunction(_id, _timestamp, _srcProgId, _tableSeries, _pstAcctNum) { if(xmlhttp) { xmlhttp.open("POST","ajaxServlet",true); xmlhttp.onreadystatechange = handleServerResponse; xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); xmlhttp.send("ajaxCommand=" + "ajaxDetails" + "&id=" + _id + "×tamp=" + _timestamp +....); } }
To which I get back from the AJAX call some beautiful HTML (sorry no Image - boring I know..)
Which I was setting in a div tag "dog". I am in need of presenting this xmlhttp.responseText as a pop up in the lightbox that has not yet been invoked and the entire page has been previously loaded.Code:function handleServerResponse() { if (xmlhttp.readyState == 4) { if(xmlhttp.status == 200) { document.getElementById("dog").innerHTML=xmlhttp.responseText; .
I have everything installed, js, css and the like and I have the demo pasted into this very page and it works fine - with that demo image, but that image was there when the page loads.
How can I envoke the lightbox to pop up and be loaded with the AJAX response once the user OnClick() calls my AJAX script?
There has to be a way to do this with lightBox 2.04
I appreciate any insight and I have searched this forum, there are two similar topics but the tie in is not really illustrated. Thanks in advance



Reply With Quote
Bookmarks