473,608 Members | 2,090 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Multiple onload problem

32 New Member
On this page:
http://jimpix.co.uk/default-ajax1.asp

When viewed in IE6, only the wallppaper ajax section (which is 1 of 4 ajax sections, along with ecards / news / photo ecards and wallpapers), loads.

But in Firefox, they all load, when first loading the page.

I am using this method to load all of the functions on first loading the page:
http://www.netlobo.com/wom.html

My javascript functions are at the bottom of the page. Could the problem be to do with my first function - since this issue seems to be browser specific.

Thanks

Expand|Select|Wrap|Line Numbers
  1. function GetXmlHttpObject() {
  2.   var xmlhttp;
  3.   if (window.XMLHttpRequest) { // Mozilla, Safari, Opera...
  4.     xmlhttp = new XMLHttpRequest();
  5.     //if (xmlhttp.overrideMimeType) xmlhttp.overrideMimeType('text/xml');
  6.   } else if (window.ActiveXObject) { // IE
  7.       try {
  8.         xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
  9.       } catch (e) {
  10.           try {
  11.             xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  12.           } catch (e) {}
  13.       }
  14.   }
  15.   if (!xmlhttp) {
  16.     alert('Cannot create an XMLHTTP instance');
  17.     return false;
  18.   }
  19.   return xmlhttp;
  20. }
  21.  
  22. var http = GetXmlHttpObject();
Mar 18 '08 #1
7 2060
acoder
16,027 Recognized Expert Moderator MVP
womAdd() requires strings. Put quotes around the function call.
Mar 20 '08 #2
burtonfigg
32 New Member
Thanks for the reply. I have changed that, but for some reason, the page works fine in Firefox, when it first loads, but again, in IE6, it only displays the last of the 4 functions - the one in bold.

[HTML]<script type="text/javascript" src="_wom.js"></script>
<script type="text/javascript">
womAdd("sendReq uest(MyCurrentV ar + ',' + MyCurrentCat)") ;
womAdd("sendPho toRequest(MyPho toVar)");
womAdd("sendNew sRequest(MyNews Var)");
womAdd("sendWPR equest(MyWPVar) ");
womOn();
</script>[/HTML]

And if I comment out the bold line (calling the 'sendWPRequest' function), IE6 will display the 3rd function, but ignore the 1st and 2nd!

I uploaded the revised page again:
http://jimpix.co.uk/default-ajax1.asp

Thanks again

Jim
Mar 20 '08 #3
acoder
16,027 Recognized Expert Moderator MVP
It seems that IE6 is overwriting the onload. Try using this script and see if it makes a difference.
Mar 22 '08 #4
burtonfigg
32 New Member
Thanks acoder, again, for your helpful suggestion and feedback.

I gave it a try, but would you believe it, just the same result:
http://jimpix.co.uk/default-ajax1a.asp

I think that's the 4th method I've tried now:

1. multiple list on the onload in the body tag:
[HTML]<body onload="sendReq uest(MyCurrentV ar + ',' + MyCurrentCat);s endPhotoRequest (MyPhotoVar);se ndNewsRequest(M yNewsVar);sendW PRequest(MyWPVa r);">[/HTML]

2. Use the window.onload:
Expand|Select|Wrap|Line Numbers
  1. window.onload = function()
  2. {
  3.     sendRequest(MyCurrentVar + ',' + MyCurrentCat)
  4.     sendPhotoRequest(MyPhotoVar)
  5.     sendNewsRequest(MyNewsVar)
  6.     sendWPRequest(MyWPVar)
  7. }
3. Use the NetLobo option:
http://www.netlobo.com/wom.html

4. Use Simon Wilson's option:
http://simon.incutio.c om/code/js/addloadevent/

Do you think it just can't be done?

Thanks again for your help

Jim
Mar 22 '08 #5
acoder
16,027 Recognized Expert Moderator MVP
Then it must be that you're reusing the http-request object, so it doesn't finish one and starts another. Either use different variables for each one or wait for one to finish before making another request using the same variable.
Mar 22 '08 #6
burtonfigg
32 New Member
Dear acoder,

you are a star! Thank you so much for your help. That was the problem all along. I created different variables for each function, and it works a treat now, in IE6 and Firefox. Thank you again, what a helpful person!

Jim
Mar 22 '08 #7
acoder
16,027 Recognized Expert Moderator MVP
You're welcome. Glad it's working now :)
Mar 23 '08 #8

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

Similar topics

0
1924
by: Richard Payne | last post by:
I am developing a web application that utilises multiple grids, panels, validation controls etc on the same page. I have added the appropriate code to pop up dialogs to confirm delete in datagrids using the ItemCreated event, template colums and the Button.Attributes.Add ("onclick", "return confirm('Are you sure you wish to delete this row?');"). This works fine in some instances when you click on the delete button but not always.
0
2315
by: Richard Payne | last post by:
I am developing a web application that utilises multiple grids, panels, validation controls etc on the same page. I have added the appropriate code to pop up dialogs to confirm delete in datagrids using the ItemCreated event, template colums and the Button.Attributes.Add ("onclick", "return confirm('Are you sure you wish to delete this row?');"). This works fine in some instances when you click on the delete button but not always.
2
1508
by: Emmanuel | last post by:
Hi, I'm working on a c# web app and require having some code which runs in the page Load event of each page and to be reusable in other web apps. So i decided to use a Class Library which contains a class that inherits from the System.Web.UI.Page. the class contains an override of the OnLoad event in which the common code is executed.
0
237
by: Richard Payne | last post by:
I am developing a web application that utilises multiple grids, panels, validation controls etc on the same page. I have added the appropriate code to pop up dialogs to confirm delete in datagrids using the ItemCreated event, template colums and the Button.Attributes.Add ("onclick", "return confirm('Are you sure you wish to delete this row?');"). This works fine in some instances when you click on the delete button but not always.
4
2457
by: Matt Ratliff | last post by:
Hello, I would appreciate any assistance you have with the following problem: I have (as an example) an array of values as follows: arrayvalues=new Array("0001","0003","0005") where each is the value of an option in a select statement: <select id="usertypes" multiple="multiple"> <option value="0033">data1</option>
0
8498
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
8478
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...
1
8152
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
6817
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
3962
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
4025
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2474
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
1
1598
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1331
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.