473,804 Members | 4,066 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Sequence of Loading

I have a number of sources of javascript and don't really know the
sequence of when each gets loaded.

<SCRIPT FOR="window" EVENT="onLoad">
var tmp = "where are you";
</script>

<script language="JavaS cript">
alert(tmp);
</script>

<script language="JavaS cript" src="code.js"></script>

Are they loaded based on the order they are seen in the page?

Aug 31 '05 #1
7 2279
pk
<Excerpt from the HTML 4 specification>

--------------
18.2.4 Dynamic modification of documents

1. All SCRIPT elements are evaluated in order as the document is loaded
--------------

Aug 31 '05 #2
<SCRIPT FOR="window" EVENT="onLoad">
var tmp = "where are you";
</script>

Apparently this does not load until after the document has finished
loading, correct?

Aug 31 '05 #3
pk
I believe so, and I could be way wrong since I don't work with
JavaScript and the only reason I found myself in this newsgroup was
because I had questions of my own. :) With that said,

"The onload event occurs when the user agent finishes loading a window
or all frames within a FRAMESET. This attribute may be used with BODY
and FRAMESET elements. "

My guess is that while you wouldn't see the effects of that particular
javascript section until the window or all the frames finished loading,
the code would still be processed first.

Someone who knows should definitely comment though...

-pk

Aug 31 '05 #4
pk
It seems to me (now that I actually read your code to see what you're
trying to accomplish), that the code as you have it now would put out
an alert with the tmp variable which presumably holds garbage at this
point. Then as the page finishes loading, it loads what you wish for
it to print in the variable tmp, but never prints the alert again.

Why do you have the delay on loading the string into the tmp variable?

Aug 31 '05 #5
mike wrote on 31 aug 2005 in comp.lang.javas cript:
<SCRIPT FOR="window" EVENT="onLoad">
var tmp = "where are you";
</script>

Apparently this does not load until after the document has finished
loading, correct?


loading and executing are not the same thing.

--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)

Aug 31 '05 #6
Reason for the question is I am applying an xml and xsl transformation
so I wait for the document to be loaded before transforming it and
rendering it in a <div id="stuff"></div> using something like
stuff.innerHTML = src.transformNo de(sf); where src is the xml and sf is
the xsl stylesheet.

Another Reason is i had some code in a external file like: <script
language="JavaS cript" src="code.js"></script> and I had a button with
an onclick event that called a function in that external file. It
produced an error when I clicked the button, but when I put that
function embedded in the document like:
<script language="JavaS cript">
function test(){}
</script>
then it ceased to produce the error and longer.

Aug 31 '05 #7
mike wrote:
I have a number of sources of javascript and don't really know the
sequence of when each gets loaded.

<SCRIPT FOR="window" EVENT="onLoad">
var tmp = "where are you";
</script>


It may be useful to know that for..event is IE only.

[...]

--
Rob
Sep 1 '05 #8

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

Similar topics

1
1854
by: CST | last post by:
Hi All, I have a "Digital Dashboard" that basically has 4 IFrame sections. The page flows in the following order: Messages, Stocks, Weather, User Links. Please note that this order needs to stay that way. Everything but the Stocks section is pulled from our dB. I am using the server control InetCtls.Inet to obtain the stock data from Yahoo Finance. The question I have is can I load the page using the dB driven sources
5
5069
by: Paul | last post by:
The problem I am having involves the sequence of events between frames in an html page. The Pages: Page A has an imbedded IFrame which displays Page B. Page A has a radio button which on the onClick event calls a function which
0
747
by: sophocles the wise | last post by:
automatically post data & click buttons on sequence of web pages with AxWebBrowser Hi, I need to post stuff everyday to a website and am working on a VB program to do this for me. I am a computer technician and I post an ad on craigslist.org everyday but sometimes I don't have time to do this. So, I accomplished so far to load the first page and post my ad in the textbox, with title and email address, and to alter the radio button and...
1
1535
by: ltnats | last post by:
Hi there, I have C# Windows Forms app I am building that has a Splash Screen and 4 other forms that are to be shown in different sequences depending on what sequence buttons on the forms are pressed. I had written a starter class to handle this. The starter class used ShowDialogue() to open the forms. Each form had a public property called FormAction that I set with information as to what form to open next. So when I set the Forms...
4
6333
by: bboyle18 | last post by:
Hi, I am working with a table sorting script which can be found here http://www.workingwith.me.uk/articles/scripting/standardista_table_sorting This script works very nicely, but when there is a large amount of data to sort e.g > 200 then there is a slight delay in the table sort. To cater for this I want to provide some feedback to the user to inform them that the sort function is processing. My idea is to add a "sorting...." message...
1
2821
by: (PeteCresswell) | last post by:
I'm loading a TreeView control from a recordset that's sequenced by a date. When I step through the code, I *think* I'm seeing the nodes created in the expected sequence. Problem is, when the tree is viewed, the dates are not in that sequence. Instead, the tree appears to be sequenced alphabetically by the highest level node names. In the TreeCtrl.Properties, I see a checkbox labeled "Sorted" and have unchecked
5
11546
by: zgh1970 | last post by:
Hi, We have some tables with db2 generated field. How can I find the next generated sequence fot those fields. Thanks,
4
14771
by: beertje | last post by:
This is a very newbie question for my first post, perhaps appropriately. I want to print '....' gradually, as a progress indicator. I have a for-loop that every 10 steps executes: print '.', This results in something like 'Loading. . . .', whereas I want 'Loading....'
0
1551
by: rval | last post by:
I have this schema while teh following sequence <complexType name="SetOfTasks" mixed="true"> <sequence> <choice minOccurs="1" maxOccurs="unbounded"> <element minOccurs="0" ref="tns:task1" /> <element minOccurs="0" ref="tns:task2" /> <element minOccurs="0" ref="tns:task3" /> <element minOccurs="0" ref="tns:task4" /> <element minOccurs="0" ref="tns:task5" />
0
9710
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
9589
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
10593
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
10340
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
10329
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
9163
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
7626
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...
1
4304
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
3
3000
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.