473,408 Members | 1,798 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

Object doesn't support this property or method (IE), fine with FF

I get this problem when I run my little piece of code

Here is the source :

Expand|Select|Wrap|Line Numbers
  1. <div id="submenu">
  2. <div id="texr">
  3. <h2>Tenders</h2>
  4. <!-- AJAX -->
  5.  
  6. <a onclick="javascript:fetchcontent('test.txt', 'fetch');">&nbsp;&nbsp;&nbsp;&nbsp;Boiler</a><br /><br/>
  7. &nbsp;&nbsp;&nbsp;&nbsp;Turbine
  8. </div>
  9. </div>
  10. <div id="fetch">
  11. </div>
The Javascript :

Expand|Select|Wrap|Line Numbers
  1. function fetchcontent(url, div_id){
  2. var page_r = false
  3. loading = document.getElementById('loading');
  4. if (window.XMLHttpRequest) {// Mozilla, Safari etc
  5. page_r = new XMLHttpRequest()
  6. } else if (window.ActiveXObject){ // pero si es IE
  7. try {
  8. page_r = new ActiveXObject("Msxml2.XMLHTTP")
  9. catch (e){ 
  10. try{
  11. page_r = new ActiveXObject("Microsoft.XMLHTTP")
  12. }
  13. catch (e){}
  14. }
  15. }
  16. else
  17. return false
  18. page_r.open('GET', url, true) 
  19. page_r.onreadystatechange=function(){ 
  20. printc(page_r, div_id)
  21. }
  22.  
  23. page_r.send(null)
  24.  
  25. }
  26.  
  27. function printc(page_r, div_id){
  28. if (page_r.readyState == 4 && (page_r.status==200 || window.location.href.indexOf("http")==-1)){
  29. document.getElementById(div_id).innerHTML=page_r.responseText;
  30. }
  31. }
  32.  
Please help me!
Apr 11 '07 #1
3 2418
acoder
16,027 Expert Mod 8TB
Welcome to TSDN.

On which line do you get this error? Perhaps you may need the href attribute of the A tag?
Apr 12 '07 #2
Hello!

I tried adding the href attribute, but it still generates the same error.

Error at = Line#4, Char#1 - Error - Object doesn't support this property or method
Apr 12 '07 #3
I just removed the "loading = document.getElementById('loading');" in line #3 and it worked.
Apr 12 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Philip | last post by:
Hi all, Been having a really tricky problem. I'm trying to do some object oriented programming with javascript and it was all working fine until I had to support Netscape 4. The problem is...
2
by: Olaf | last post by:
I have a frameset page witch contains the myFuc() function. The function is accessed from a page in one of the frames in the frameset. An example is shown below. <input...
3
by: news.onetel.net.uk | last post by:
I and my friend Karl have spent literally all day trying to find out what is causing my error but we are zapped of any further functionality :) I have a form that adds news records. You select...
7
by: stellstarin | last post by:
hi all, I have a HTML page with two forms. While trying to add a hidden element in a first form by the default javascript function, the error message 'object does not support this property or...
5
by: John Olbert | last post by:
Subject: Error is Object doesn't support this property or method I am trying to pass a C# string under Vs2005 (Net2) to an Vb6 ActiveX Control. I get the following runtime error-- "Object...
5
by: UJ | last post by:
I have a program that uses the Shockwave Flash Objects (ShockwaveFlashObjects) to display a SWF. Everything works fine. When IE7 is installed on the machine, suddenly we get an 'Invalid char line...
6
by: inxanu | last post by:
I am getting this error when using IE, however it works fine with FF Object doesn't support this property or method Any ideas? Thanks in advance... The problem arises when trying to get...
6
by: noodlegarage | last post by:
Help, I've designed and built a portfolio site for a photographer. Now in the debugging process, I've come across an IE 6 bug (only on IE 6, all other browsers work fine). When I try to click on a...
1
by: hhackwell | last post by:
Hi guys, I'm running a simple piece of Javascript on my website to allow users to make an object appear when they want to use it. It works fine but I keep getting this error on IE and although...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.