473,769 Members | 2,078 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Only functions in first included script are available after onLoad

Hi there. Has anyone experienced an intermittent problem where only functions
from the first included script tag are available to the onLoad event handler?
An example:

<html>
<head>
<script src="library1.j s></script>
<script src="library2.j s></script>
<script>
function doLoad()
{
functionCallFro mLibrary2();
}
</script>
</head>
<body onLoad="doLoad( );">
</body>
</html>

The script _ocassionally_ (once every 20 or 30 times, I would say) halts at
the functionCallFro mLibrary2() with an Object Expected error. My debugger
tells me that, at this point in execution, all functions from library1.js are
defined and available but no functions from library2.js are available. Both
library1.js and library2.js are function libraries... there is no inline code
in either file.

Any insight? THANKS!!
-- Gene
Jul 20 '05 #1
1 2449
hi Gene,

Gene Goykhman wrote:
Hi there. Has anyone experienced an intermittent problem where only functions
from the first included script tag are available to the onLoad event handler?
An example:

<html>
<head>
<script src="library1.j s></script>
<script src="library2.j s></script>
<script>
function doLoad()
{
functionCallFro mLibrary2();
}
</script>
</head>
<body onLoad="doLoad( );">
</body>
</html>

The script _ocassionally_ (once every 20 or 30 times, I would say) halts at
the functionCallFro mLibrary2() with an Object Expected error. My debugger
tells me that, at this point in execution, all functions from library1.js are
defined and available but no functions from library2.js are available. Both
library1.js and library2.js are function libraries... there is no inline code
in either file.

Any insight? THANKS!!
-- Gene


quick thought: try to call the doLoad-function from your both of your
external js-files (at the end) and modify the doLoad function like this

var counter=0;
function doLoad(){

if(++counter>1) {
functionCallFro mLibrary2();
}
}

lg

mord

Jul 20 '05 #2

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

Similar topics

3
6821
by: Da Costa Gomez | last post by:
Hi all, I've been eluded the last couple of *days* on the onload mystery within the frame and function context. Problem is as follows: - frameset with two frames. One called scripts and the other called main - scripts carries a bunch of js functions rechable via parent.scripts.functioName() - Main carries the html page that utilizes some functions
7
3878
by: Randell D. | last post by:
Folks, I've found a nice menu piece of javascript that works fine when the code is included entirely inside the html page. However, when I place the javascript code outside, in its own ".js" type file, it doesn't execute. IE6 reports an error "Object expected" line 30, char 1, code 0. This is the BODY tag which I've pasted below (with carriage returns to make it easier to read). I cannot understand as to how this line could be...
3
2002
by: Disco-181 | last post by:
Hi, I have a script which isn't working in Mozilla based browser for some reason. I'm trying to run two functions from the body onload tag and it simply isn't happening. I have a cascading menu, where the primary dropdown selection determines the contents of a second dropdown. This is triggered by a function in the onchange tag of the primarys select tag. When triggered like this, the function and drop downs work fine. When
4
38255
by: Mark Hannon | last post by:
I am trying to initialize an array only once so it can be seen & used by any functions that need it. As I understand it, if a variable is declared by itself outside of any functions, its scope is global and any functions should be able to access it. I have been having trouble getting this to work. In the 1st of the 2 examples below I initialize the Array "initArray" with 4 form text fields. When I try to use initArray inside either of...
5
2781
by: danny.myint | last post by:
I was under the assumption that javascript loads all the <head></head> elements before processing the <body> tag in Mozilla/Netscape/Firefox. It doesn't seem like it, with my problem. I have navigation that has onMouseOver and onMouseOut triggers, that use function calls in my external .js file. When I mouseOver a button in my navigation quickly enough to catch it before the rest of the body loads, it returns a function "not defined"...
8
5480
by: baustin75 | last post by:
Posted: Mon Oct 03, 2005 1:41 pm Post subject: cannot mail() in ie only when debugging in php designer 2005 -------------------------------------------------------------------------------- Hello, I have a very simple problem but cannot seem to figure it out. I have a very simple php script that sends a test email to myself. When I debug it in PHP designer, it works with no problems, I get the test email. If
7
2918
by: jsale | last post by:
I'm currently using ASP.NET with VS2003 and SQL Server 2003. The ASP.NET app i have made is running on IIS v6 and consists of a number of pages that allow the user to read information from the database into classes, which are used throughout the application. I have made class collections which, upon reading from the DB, create an instance of the class and store the DB values in there temporarily. My problem is that if user1 looks at...
6
1426
by: Richard | last post by:
I am new to php and am looking for some quick "get up and go" help. What would the arguments for and against be for function declarations v simple include? e.g <?php include("myfunc.php"); // declares a function "myfunc". myfunc("hello");
5
9479
by: lilOlMe | last post by:
Hi there! I'm developing some crazy Tab Control in .NET that uses JavaScript. A particular JavaScript method needs to be called during the window.onload event in order to initialize my Tab Control. The thing is that there can be more than one Tab Control on the page....and each one must be initialized during the window.onload event. Adding the JavaScript function call responsible for initializing a particular Tab Control to the...
0
9422
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,...
1
9987
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
9857
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...
1
7404
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
6662
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
5294
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...
1
3952
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
3558
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2812
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.