php - Ajax request with Javascript -


i have page on want show couple of mysql tables.
there 1 table on right may change when different person selected.
de second table main table in center. have dropdown box contains every person. results selected person showed in middle table. there multiple results each person there second dropdown box choose of these results want show. al done ajax xmlhttp request.

the problem right table uses javascript. know not possible ajax in combination xmlhttp-request. without javascript can't make want. there way, show right table after javascript finished doing work?

i use frames. not nice. because have style both pages nice together, , that's not easy said. way doing want be.

so searched internet (a long time) , few minutes before wanted give found piece of code (coming http://www.javascriptkit.com/dhtmltutors/ajaxincludes.shtml):

function httprequest(url){  var pagerequest = false //variable hold ajax object     /*@cc_on       @if (@_jscript_version >= 5)          try {          pagerequest = new activexobject("msxml2.xmlhttp")          }          catch (e){             try {             pagerequest = new activexobject("microsoft.xmlhttp")             }             catch (e2){             pagerequest = false             }          }       @end    @*/     if (!pagerequest && typeof xmlhttprequest != 'undefined')       pagerequest = new xmlhttprequest()     if (pagerequest){ //if pagerequest not false       pagerequest.open('get', url, false) //get page synchronously       pagerequest.send(null)       embedpage(pagerequest)    }  }   function embedpage(request){     //if viewing page offline or document retrieved online (status code=2000)    if (window.location.href.indexof("http")==-1 || request.status==200)       document.write(request.responsetext)    } }  httprequest("external.htm") //include "external.htm" onto current page    

this code works perfectly... first time. change person whole page disappears , table shows , firefox keeps "loading" page (you see circle going round). know how edit code above fit needs have no understanding of ajax or how fix problem. can me , give me solution! , tell me why code above isn't working properly?

thanks in advance!

milaan

it´s been long time since i´ve seen code this, 1 problem can see, don´t include kind of variable in xmlhttprequest; no user id or anything. supposed load static page?

and there reason can´t use library jquery? it´s no magic bullet make life , ajax requests lot easier.


Comments

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -