474,042 Members | 2,496 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Error: Unknown runtime error in ie while using ajax

134 New Member
hi
when i m trying to fetch data from one page to another page using ajax, i get an error message in IE., but it runs well in firefox., could anyone help me.,

here is my javascript code.,

[HTML]<script type="text/javascript">
var id;
var action;
function httprequest(id, action)
{

var xmlhttp;
try
{
xmlhttp=new XMLHttpRequest( );
}
catch(e)
{
try
{
xmlhttp=new Activexobject(" Msxml2.XMLHTTP" );
}
catch(e)
{
try
{
xmlhttp=new Activexobject(" MICROSOFT.XMLHT TP")
}
catch(e)
{
alert("ur browser doesnot support Ajax");
return false;
}
}

}
xmlhttp.onready statechange=fun ction()
{
if(xmlhttp.read yState==4)
{
document.getEle mentById("ajax" ).innerHTML=xml http.responseTe xt;
}
}

xmlhttp.open("G ET","url/"ajax.php?id="+ id+"&action="+a ction,true);
xmlhttp.send(nu ll);
}

function hidden(id,actio n)
{
httprequest(id, action)
}
</script>

<table id="ajax">------Place where i fetch data from another page and display---------
<tr><td><a onclick="hidden ('1','next')">n ext</a></td></tr>
</table>
[/HTML]

Could anyone help me.,
Thanks.,
vijay
Mar 19 '08
20 9152
acoder
16,027 Recognized Expert Moderator MVP
Which line does the error occur on?
Mar 21 '08 #11
vjayis
134 New Member
Which line does the error occur on?
Hi

got solution for the problem.,

tried using div tag from the suggestion gave by "gits" in another forum.,

But when the page loads i get an error (only in ie which runs well in firefox)

Error: 'document.getEl ementById(...)' is null or not an object.

can u give me some t ips.,

thanks
Mar 22 '08 #12
acoder
16,027 Recognized Expert Moderator MVP
I assume the error occurs on the following line:
Expand|Select|Wrap|Line Numbers
  1. obj = document.getElementById( "ajax" );
Try using a different ID in case IE has a problem with the "ajax" id.

Failing that, is it possible that you have a test page?
Mar 22 '08 #13
vjayis
134 New Member
I assume the error occurs on the following line:
Expand|Select|Wrap|Line Numbers
  1. obj = document.getElementById( "ajax" );
Try using a different ID in case IE has a problem with the "ajax" id.

Failing that, is it possible that you have a test page?


Hi
sorry i couldnt send u a test page.,

Can u tell me whether ajax can be run in ie5 and ie6.,

coz my ajax script is not running in an system which has ie6 installed., i hav tried even by enabling most of the options in browser settings.,

here is my javascript coding

Expand|Select|Wrap|Line Numbers
  1. function httprequest()
  2. {
  3.  
  4.   var xmlhttp;
  5.   try
  6.  {
  7.    xmlhttp=new XMLHttpRequest();
  8.  }
  9.   catch(e)
  10.  {
  11.     try
  12.    {
  13.     xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");
  14.    }
  15.    catch(e)
  16.    { 
  17.      try
  18.     {
  19.          xmlhttp=new ActiveXObject("MICROSOFT.XMLHTTP")
  20.     }
  21.      catch(e)
  22.     {
  23.      alert("ur browser doesnot support Ajax");
  24.      return false;
  25.     }
  26.    }
  27.  
  28.  }
  29. ------------------------------
  30. }

when i click on the ajax link i got an alert message "ur browser doesnot support Ajax" which i hav given in the script.,

Thanks
Mar 24 '08 #14
acoder
16,027 Recognized Expert Moderator MVP
Can u tell me whether ajax can be run in ie5 and ie6.,
Yes, it can. You may need to watch the case - see if this link helps.
Mar 24 '08 #15
vjayis
134 New Member
Yes, it can. You may need to watch the case - see if this link helps.


Hi

probably i had also used the same script in my page., but when i click the ajax link in my page., it displays the alert message "ur browser does not support ajax"

Here is my code:

Expand|Select|Wrap|Line Numbers
  1.  
  2. <script type="text/javascript">
  3. var id;
  4. var action;
  5. function httprequest(id,action)
  6. {
  7.  
  8. var xmlhttp;
  9. try
  10. {
  11.  xmlhttp=new XMLHttpRequest();
  12. }
  13. catch(e)
  14. {
  15.   try
  16.   {
  17.   xmlhttp=new Activexobject("Msxml2.XMLHTTP");
  18.   }
  19.   catch(e)
  20.   { 
  21.     try
  22.     {
  23.     xmlhttp=new Activexobject("MICROSOFT.XMLHTTP")
  24.     }
  25.     catch(e)
  26.     {
  27.      alert("ur browser doesnot support Ajax");
  28.      return false;
  29.     }
  30.   }
  31.  
  32. }
  33. xmlhttp.onreadystatechange=function()
  34.  if(xmlhttp.readyState==4)
  35.  { 
  36.  
  37.    document.getElementById("ajax").innerHTML=xmlhttp.responseText;
  38.  
  39.  }
  40. }
  41.  
  42. xmlhttp.open("GET","ajax.php?id="+id+"&action="+action,true);
  43. xmlhttp.send(null);
  44. }
  45.  
  46. function hidden(id,action)
  47. {
  48.  httprequest(id,action)
  49. }
  50. </script>
  51.  
Expand|Select|Wrap|Line Numbers
  1. <div id="ajax">
  2. <table >
  3. <tr>
  4. <td>------Place where i fetch data from another page and display---------</td>
  5. <td><a onclick="hidden('10','next')">next</a></td>
  6. </tr>
  7. </table>
  8. </div>
  9.  
and in my ajax.php page i hav displayed datas fetched from database which are above the id(10) i sent on onclick event;

but when i click the ajax(next) link., i get an alert message
"ur browser doesnot support Ajax"
in ie5 and ie6;
but its working well with ie7 and firefox.,

and i had even tried changing the id name from "ajax" to someother string., but nothing happened.,

could u help me to get rid of the problem.,

kind regards
vijay
Mar 25 '08 #16
acoder
16,027 Recognized Expert Moderator MVP
You've made the same mistake. Remember JavaScript is case-sensitive.

Activexobject should be ActiveXObject.

What I suggest is that you copy the code from the linked page and then try that.

The reason why it works in IE7/Firefox is that they both support the XMLHttpRequest object.
Mar 25 '08 #17
vjayis
134 New Member
You've made the same mistake. Remember JavaScript is case-sensitive.

Activexobject should be ActiveXObject.

What I suggest is that you copy the code from the linked page and then try that.

The reason why it works in IE7/Firefox is that they both support the XMLHttpRequest object.

Hi

thanx., got the solution.,

ajax is working well in ie6.,

but after the page gets loaded.,

the status bar displays the message.,
"error on page." does my javascript made some errors., ??

could you help me in this

regards
Mar 26 '08 #18
acoder
16,027 Recognized Expert Moderator MVP
but after the page gets loaded.,

the status bar displays the message.,
"error on page." does my javascript made some errors., ??
Yes, you've got some errors. Double click the error icon and see what the error is.
Mar 26 '08 #19
vjayis
134 New Member
Yes, you've got some errors. Double click the error icon and see what the error is.

Hi

got the solution by finding the errors.,

thanks
regards
vijay
Mar 28 '08 #20

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

Similar topics

4
4359
by: neil brown | last post by:
Whenever I try and run a project in VB.NET 2003, all i get is: "An unhandled exception of type 'System.ArgumentException' occurred in Unknown Module. Additional information: The parameter is incorrect." or "An unhandled exception of type
7
38050
by: John | last post by:
Hi Everyone, I'm having this extremely annoying problem with Internet Explorer 6, giving me an error message saying "unknown runtime error" whenever I try to alter the contents of a <divelement using innerHTML. Now, I've researched this problem on the web, and found many references to it, but none of them quite addressed my specific situation, and since my experience with JavaScript is limited, I was not able to adapt the solutions I...
3
11124
by: =?Utf-8?B?bWNpbWFnaW5n?= | last post by:
We have recently applied AJAX to our web site, nothing particularly fancy, just some update panel, progress images and collapsible panels, just the basics to improve the user experience. The project has gone fantastically well except we have ran into a strange error when accessing the site from inside of one of our client networks. All the pages load fine without any problems, but if you try and press any buttons on an AJAX enabled...
1
7873
by: jesmi | last post by:
my code is: U]employee.cfm <html> <head> <title>Employee List</title> </head> <body> <h1>Employee List</h1>
4
4144
by: Jeremy | last post by:
I am getting an error Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occured while processing the request on the server. The status code returned from the server was:500. It appears that this error occurs after I browse to the specific page and leave it for a while, then click on a linkbutton within an update panel. Has anyone experienced this behavior?
1
7800
by: Valli | last post by:
Hi, I have an issue with the content page('default.aspx') while executing the asp.net project. I am getting the error 1. unknown server tag 'asp.Scriptmanager' 2. unknown server tag 'asp.collapsiblepanelextender' 3. unknown server tag 'asp.UpdatePanel Why I am getting this error.? What should be done to fix it.
3
1966
by: nnaveenraju | last post by:
Hi Gurus, I am new to Ajax and JAVA. I am able to call the servlet class from the JSP page using AJAX. The servlet class is called successfully. I am processing some data and the data has to passed back to the front end JSP. I have used the following code
21
2163
by: sheldonlg | last post by:
I have googled for '"Internet Explorer" "Unknown runtime error"' and not found anything useful. I have the following (for simplicity of presentation here): <div><table><tr><th id="foo"></th></tr></table></div> In my javascript I have two lines: var titleObj = document.getElementById('foo'); titleObj.innerHTML = "Name is bar";
0
3613
by: Julien Hoffmann | last post by:
Hi all, Me too I thought I could give out my solution to a similar problem ; hopefully it will help. Long story made short : On a VB.NET 3.5 + AJAX web site, I wanted my visitors to be able to navigate inside one page unsing anchors. Anchors inside content rendered by a listview inside an update panel are ok, but....believe it or not, the "top" anchor, referring to the top of page was causing the "unknown error" ! Anchor was <a name="top"...
0
10536
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
12131
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...
1
12005
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
11137
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7862
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
6648
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
6827
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
5405
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
4937
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.