474,047 Members | 3,350 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Object Expected Error

renji1981
8 New Member
Hi Pals

Im getting Object Expected Error and Im new to Ajax . I have pasted the Html code here .. please help .

Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <head> 
  3. <title>My first ajax Application </title>
  4. <script language="javascript">
  5. var XMLHttpRequestObject =false;
  6. if(window.XMLHttpRequest)
  7. {
  8. XMLHttpRequestObject = new XMLHttpRequest();
  9. }
  10. else if(window.ActiveXObject)
  11. {
  12. XMLHttpRequestObject = new ActiveXObject("Microsoft.XMLHTTP");
  13. }
  14. funtion getdata(datasource , divid)
  15. {
  16. if (XMLHttpRequestObject)
  17. {
  18. var obj = document.getElementById(divid);
  19. XMLHttpRequestObject.open("GET",datasource);
  20. XMLHttpRequestObject.onreadystatechange = funcion()
  21. {
  22. if (XMLHttpRequestObject.readystate ==4 && XMLHttpRequestObject.status ==200)
  23. {
  24. obj.innerHTML = XMLHttpRequestObject.responseText;
  25. }
  26. XMLHttpRequestObject.send(null);
  27. }
  28. }
  29. </script>
  30. </head>
  31. <body>
  32. <form>
  33. <input type ="button" value="Click here " onclick="getdata('data.txt','target')">
  34. </form>
  35. <div id = "target">
  36. Hi this is just a test
  37. </div>
  38. </html>
  39.  
the data file is in the same folder as the html file is and just contains some basic text
do reply to[edit]
Jan 18 '09 #1
5 1170
Dormilich
8,658 Recognized Expert Moderator Expert
there are some typos creating havoc:
line #4 better use the type attribute
line #14 the keyword is "function"
line #20 (same as line #14)
Jan 18 '09 #2
renji1981
8 New Member
@Dormilich

thanks for the reply ...there is no error now . but it is not loading the file contents which i have in the Data.txt file .My first ajax Application ... can you please check it
Jan 18 '09 #3
Dormilich
8,658 Recognized Expert Moderator Expert
it's a typo again:
line #22: XMLHttpRequestO bject.readyState

note: unbeatable for debugging: Firebug plugin for Firefox
Jan 18 '09 #4
renji1981
8 New Member
Thanks a lot ... Works Perfect Now .... Really appreciate the Quick response from this site .. i waited 2 days in another site and dint get get even 1 replies . Thanks to the Moderators
Jan 18 '09 #5
Dormilich
8,658 Recognized Expert Moderator Expert
I'm pleased about such a praise, nevertheless we're here to help (Experts, Members (and Moderators))
Jan 18 '09 #6

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

Similar topics

4
44885
by: Bill | last post by:
I call a function in my .js file like this: onClick="location.href='blank.html' + generateSearchStringFromForm('section')" where section is the name of my form. The function is defined as follows: myFunction(k) {
2
2296
by: jsnX | last post by:
i want a function object that is a) initialized with an STL container foo b) will search foo for an object of type foo::value_type here is my code: ======================================================================== /* if we have a big list of things, and we went to check it * over and over for this or that thing, then we can use this * object to cache the list and consolidate queries of it.
2
1133
by: FredC | last post by:
OS Name Microsoft Windows XP Professional Version 5.1.2600 Service Pack 2 Build 2600 Total Physical Memory 1,024.00 MB MDE 2003 Version 7.1.3008 ..NET Framework 1.1 Version 1.1.4322 SP1 Microsoft Visual C# .NET 69462-335-0000007-18707 Crystal Reports for Visual Studio .NET AAP50-GS0000S-WCK00C3
11
44286
by: westplastic | last post by:
This one is driving me insane. The script works perfect on Firefox, but Internet Explorer keeps complaining about "Error Object Expected" and stuff like that. I've run it through Firefox's Java Console, and it comes back with no errors. Any pointers on this, would be much appreciated. <script type="text/javascript"> <!-- var p = new Array(0,0,0,0,0) var c = new Array(0,0,0,0,0,0,0,0,0)
26
5732
by: yb | last post by:
Hi, Is there a standard for the global 'window' object in browsers? For example, it supports methods such as setInterval and clearInterval, and several others. I know that w3c standardized several parts of the DOM, but this does not include the window object. Thank you
12
5577
by: Andrew Poulos | last post by:
With the following code I can't understand why this.num keeps incrementing each time I create a new instance of Foo. For each instance I'm expecting this.num to alert as 1 but keeps incrementing. Foo = function(type) { this.num = 0; this.type = type this.trigger(); } Foo.prototype.trigger = function() {
4
2791
by: loserdude84 | last post by:
Hi I keep getting the good old error 'Object Expected Error' on a site I recently built. I am really struggling with this one. Object Expected Error Line 66 <div class="headerBG_2"></div> <div class="contentBG_2"> <!-- flash banner --> <div class="flash_banner"> LINE 66 <script type="text/javascript">
1
3931
by: JOJO123 | last post by:
I got here in search of an answer to this Javascrpt question. I upgraded jave on XP Ie 7, acrobat 5.1 and suddenly can't open any pdf files on web sites using IE. I see u guys all say, this is a Javscript issue. but how do we, mere mortals who know nothing of anything about Java, scripts, etc, fix this? Is there a programm, does MS have any fix? is there any tweak like in the Registry, or whatever, how do I access anyihint java without in IE 7...
10
13344
RMWChaos
by: RMWChaos | last post by:
WinVista/IE7 I am getting some weird errors only in IE7, but not in FF2.0.0.8 or NN9. It even happens on this website when I click "Sign In". The error is: "A Runtime Error has occurred." "Line:xxx" "Error: Object expected" and Debug says: "Microsoft JScript runtime error: Object expected."
2
5758
by: thj | last post by:
Hi. I've got this form that I'm trying to validate: <form id="periodForm" action="" method="post"> <p> Periode: <input id="startDate" name="startDate" type="text" size="7" value="<%= ViewData %>" /> -
0
12151
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
11607
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10317
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
8704
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7876
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
6662
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
6842
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
5423
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4947
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.