Jump to content

michael1991j

Members
  • Posts

    5
  • Joined

  • Last visited

Everything posted by michael1991j

  1. i am a newb i just got this script in the ajax section in www3 it is possible if you can put the code in one functionlike one big function for getheader and getlist
  2. thank you for the answer i fix all those problem i have thougholy check everything cleared all full page elements cleared all external javascript but i am sorry but the data is still not going in the stated divid what if it somthing to do with the functions i dont know i am stumped i have just moded everything not move it around so feel free to look at my code to see if i did something wrong sorry and thank you have been a big help personaly i have nobody in my local city oxford alabama to help me find my bug , teach me , and i am to young to take a course on this but you have helped me somewhat in telling me these bugs i am almost positive that i have cleared them thank you michael roberts
  3. --------------------------------------------------------------------------------hi i am trying to build a ajax based flash funny movie viewerthe goal in making this viewer was to make it so the user would never need to refresh his or her page sorry it is hard to explain the problem without showing the code firsthere is the link to see it http://www.licut.com/movie/index.phphere is the ajax code Quote:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><script language="javascript"> var xmlHttp;function getlist(){ xmlHttp=GetXmlHttpObject();if (xmlHttp==null){alert ("Your browser does not support AJAX!");return;} var url="./list.php";url=url+"?sid="+Math.random();xmlHttp.onreadystatechange=stateChanged;xmlHttp.open("GET",url,true);xmlHttp.send(null);}function stateChanged() { if (xmlHttp.readyState==4){ document.getElementById("main").innerHTML=xmlHttp.responseText;}}function GetXmlHttpObject(){var xmlHttp=null;try{// Firefox, Opera 8.0+, SafarixmlHttp=new XMLHttpRequest();}catch (e){// Internet Explorertry{xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");}catch (e){xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");}}return xmlHttp;}// JavaScript Documentvar xmlHttp;function getheader(movieid, user){ xmlHttp=GetXmlHttpObject();if (xmlHttp==null){alert ("Your browser does not support AJAX!");return;} var url="./header.php";url=url+"?movieid="+ movieid;url=url+"&user="+ user;url=url+"&sid="+Math.random();xmlHttp.onreadystatechange=stateChanged;xmlHttp.open("GET",url,true);xmlHttp.send(null);}function stateChanged() { if (xmlHttp.readyState==4){ document.getElementById("topmenu").innerHTML=xmlHttp.responseText;}}function GetXmlHttpObject(){var xmlHttp=null;try{// Firefox, Opera 8.0+, SafarixmlHttp=new XMLHttpRequest();}catch (e){// Internet Explorertry{xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");}catch (e){xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");}}return xmlHttp;}</script><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><title>Untitled Document</title><script language="javascript">function onload2(){getheader(1,"michael");getlist();}</script></head><body onload="onload2()"><div id="targetDiv">l</div><div id="topmenu">.loading...</div><div id="sidebar">loading..</div><div id="main">loading....</div> -</body></html><link href="/movie/movie.css" rel="stylesheet" type="text/css" /> now i can state at my problem if you look at the body it state an onload="" where it calls the function onload2 onload2 call the two ajax function the first one is a header that get the date from a php file same thing as getlist know in each of these ajax function after the data is retrieved it goes into these div here is the code that put the retrieved info into these div idsfor getheader()Quote: document.getElementById("topmenu").innerHTML=xmlHttp.responseText; for getlist() document.getElementById("main").innerHTML=xmlHttp.responseText; if you see these div id are stated correctly but if you look at the link example on top of the source code you would see that getlist() has loaded right in topmenu instead of div id mianthat is my problem i do not understand why this is occuring i am a newb to ajaxsorry for the spellingand i have tried to state my question the best as i can if you need any info just reply thank you in advance
×
×
  • Create New...