473,618 Members | 3,005 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

I need help my Ajax script won't work in IE

This is the script.

var reqTopCont;
var reqBotCont;

function changeTopConten t(newUrl)
{
reqTopCont = false;
// branch for native XMLHttpRequest object
if (window.XMLHttp Request) {
try {
reqTopCont = new XMLHttpRequest( );
} catch(e) {
reqTopCont = false;
}
// branch for IE/Windows ActiveX version
} else if(window.Activ eXObject) {
try {
reqTopCont = new ActiveXObject(" Msxml2.XMLHTTP" );
} catch (e) {
try {
reqTopCont = new ActiveXObject(" Microsoft.XMLHT TP");
} catch (e) {
reqTopCont = false;
}
}
}
if (reqTopCont) {
reqTopCont.onre adystatechange = reqTopContUpdat e;
reqTopCont.open ("GET", newUrl, true);
reqTopCont.send ("");
}
}

function changeBottomCon tent(newUrl)
{
reqBotCont = false;
// branch for native XMLHttpRequest object
if (window.XMLHttp Request) {
try {
reqBotCont = new XMLHttpRequest( );
} catch(e) {
reqBotCont = false;
}
// branch for IE/Windows ActiveX version
} else if(window.Activ eXObject) {
try {
reqBotCont = new ActiveXObject(" Msxml2.XMLHTTP" );
} catch (e) {
try {
reqBotCont = new ActiveXObject(" Microsoft.XMLHT TP");
} catch (e) {
reqBotCont = false;
}
}
}
if (reqBotCont) {
reqBotCont.onre adystatechange = reqBotContUpdat e;
reqBotCont.open ("GET", newUrl, true);
reqBotCont.send ("");
}
}

function reqTopContUpdat e()
{
if (reqTopCont.rea dyState == 4 && reqTopCont.stat us == 200) {
alert (reqTopCont.res ponseText);
document.getEle mentById("topCo ntent").innerHT ML =
reqTopCont.resp onseText;
}
}

function reqBotContUpdat e()
{
if (reqBotCont.rea dyState == 4 && reqBotCont.stat us == 200)
document.getEle mentById("botto mContent").inne rHTML =
reqBotCont.resp onseText;
}

May 7 '06 #1
2 1576
fu************* @gmail.com wrote:
I need help my Ajax script won't work in IE
Your message should make sense in its own right, don't rely on others
being able to remember or view the subject at the same time as reading
the message. :-)

This is the script.


You may find it easier to use an AJAX library:

<URL:http://www.ajaxtoolbox .com/>

[...]
--
Rob
May 7 '06 #2
fu************* @gmail.com said the following on 5/7/2006 3:52 PM:
This is the script.


What about it? You have 4 functions, with no call to any of them, what
did you leave out?

You may want to read the group FAQ with regards to the XMLHTTPRequest
object, in the page that is linked to from the FAQ. And then, don't
assume that readers can see the Subject line, and you may want to
include the HTML that goes with the script.

--
Randy
comp.lang.javas cript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
May 7 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
2054
by: G Matthew J | last post by:
interesting "signal vs. noise" blog entry: http://37signals.com/svn/archives2/whats_wrong_with_ajax.php
54
8266
by: VK | last post by:
Mission statement: A mechanics to get text stream into browser from any Web location without reloading the current page. 1) This mechanics has to support *at the very least* IE 5.5 and higher and Firefox 1.5 and higher: but it may be completely different from one browser to another. It is important only to be able to build an uniformed interface atop of it.
1
2133
by: mflll | last post by:
I am having trouble getting my simple AJAX program to work at my current University. Here is one of the programs that is giving problems. I tried it in and Mozilla/5.0 Gecko/20050923 under Fedora Linux I see the alert's "V" and "V Two" The latter says "null.firstChild.data; yy = YYNode.firstChild.data; document.QQ.xxReceive.value = xx;
2
1852
by: Alex | last post by:
Example uploaded to: http://www.clickatus.com/ajax/ BTW - This is for FIREFOX, won't work in IE. I don't know why but when it is executed the browser still in loading state... Even though XMLHttpRequest already got its string from the server... Any help?
2
2541
by: Lanky | last post by:
I am using the Dynamic Ajax Content script from Dynamic Drive (http://dynamicdrive.com/dynamicindex17/ajaxcontent.htm) and trying to load the Ultimate Fade-In Slide Show also from Dynamic Drive (http://www.dynamicdrive.com/dynamicindex14/fadeinslideshow.htm.) Both work just fine independently, but the slide show script won't work when I try to load it with the Ajax Content Script - as if they are conflicting. Any ideas?
1
5113
by: jianxin9 | last post by:
Hi, I have an ajax powered tabs box that has a javascript drop-down search menu in the first tab. When I click on another tab, and go back to the first tab I have to refresh the page to get the information to load. Any suggestions on how I might get around that. The articles tab is the tab where the javascript won't load. Thanks so much for any help you might be able to provide: This is what the tabs code looks like: <ul...
1
4626
by: UKuser | last post by:
Hi, I'm trying to get my PHP scripts to email me an email which includes a button to enable a feature, which I'd like to be done via AJAX so the user can open the resulting page within their Outlook email rather than having to open a web browser. My script is below, however I'm slightly confused, because when run in Outlook or outside the webserver directory it won't work, but run inside, it will. Can someone explain what I'm doing...
9
4609
bugboy
by: bugboy | last post by:
I have a page being generated with PHP, it includes a DIV who's content gets swapped with ajax. the new content contains the following function call PHP echo'd inside the parent DIV. The code works fine when originally loaded in the DIV but not when it's been swapped there with ajax. Should i be putting the function call somewhere else in the code? The $row_num needs to reflect the row number originally clicked to call the ajax...
0
8153
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8595
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
8455
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
7126
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...
0
5552
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
4065
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
4150
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2587
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
1459
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.