User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 402,805 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,019 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 373 | Replies: 3 | Solved
Reply
Join Date: Jul 2008
Posts: 8
Reputation: zappan is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
zappan zappan is offline Offline
Newbie Poster

object expected??

  #1  
32 Days Ago
hi it me again.
right now i had a problem with this code. when i open with ie6, it worked but if i use ie7,safari and firefox, the result didn't show up.here i provide the code. the error is where i mark it with the red color. please someone help me?

php code.....
<BODY onLoad="init_table();" style=" background-repeat:repeat; background-image:url('images/bg_b.gif');">



javascript code..
<script type="text\javascript" >
   function requestUrl(url,id,redirectPage) {      
		var temp=new Array();
			http.open("GET", url, true);
			http.onreadystatechange = function() {
				if (http.readyState == 4) {
				  if(http.status==200) {
			  		var results=http.responseText;
					if(redirectPage=="" || results!="1") {
						
						var temp=id.split("~"); // To display on multiple div 
						//alert(temp.length);
						var r=results.split("~"); // To display multiple data into the div 
						//alert(temp.length);
						if(temp.length>1) {
							for(i=0;i<temp.length;i++) {	
								//alert(temp[i]);
								document.getElementById(temp[i]).innerHTML=r[i];
							}
						} else {
							document.getElementById(id).innerHTML = results;
						}	
					} else {
						//alert(results);
						window.location.href=redirectPage;			
					}
				  } 
  				}
			};
			http.send(null);
       }

	   function init_table() {
		requestUrl('showTable.php?mode=list','showTable','');
	}


   </script>
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Feb 2008
Location: Gurgaon India
Posts: 103
Reputation: nikesh.yadav is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 10
nikesh.yadav's Avatar
nikesh.yadav nikesh.yadav is offline Offline
Junior Poster

Re: object expected??

  #2  
32 Days Ago
please check,
r u include?or not
<script src="jsfile.js"> </script>
in which the init_table() function is defined
Help as an alias

I think programming is great................
http://www.nikeshyadav.com
Reply With Quote  
Join Date: Jul 2008
Posts: 8
Reputation: zappan is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
zappan zappan is offline Offline
Newbie Poster

Re: object expected??

  #3  
32 Days Ago
yes..but in firefox it give me init_table() is not defined....some say should use window.onload...what window.onload do and how to call init_table() from window.onload if i put init_table inside the external js.
Reply With Quote  
Join Date: Jul 2008
Posts: 8
Reputation: zappan is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
zappan zappan is offline Offline
Newbie Poster

Re: object expected??

  #4  
32 Days Ago
thank for the help..i already figured out the problem...
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb JavaScript / DHTML / AJAX Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the JavaScript / DHTML / AJAX Forum

All times are GMT -4. The time now is 10:47 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC