473,668 Members | 2,457 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Yet another IE/W3C confusion

Don
I was recently handed responsibility for a web site that is a
combination of ASP, javascript, and some cgi-bin style programs which
generate HTML with javascript. Though I'm new to javascript, the
language isn't causing my any headaches but the difference in how code
gets processed by different browsers is enough to send me searching for
Zoloft.

One of the generated pages has this general structure:

<html>
<head>
<script type="text/javascript" src="/main.js"></script>
<script type="text/javascript" src="/file.js"></script>
<script type="text/javascript" language="JavaS cript">
var url="http://www.yadayada.ne t";
var name="yada";
</script>
<title>Title</title>
</head>
<body onload="init(); " >
<script type="text/javascript" src="/menu.js"></script>
....
</body>
</html>

main.js contains general purpose functions used within the body
init() is in file.js and sets up for code in menu.js
menu.js references functions in file.js

The javascript in menu.js was slanted heavily toward IE 4, looks like it
supports NS 4, and doesn't function properly in NS6/Mozilla. So I
reworked it to work with the W3C DOM. Running from files on my local
drive, the pages and menus displayed correctly in both IE6 and Mozilla
1.3 so I pushed them over to the test server. Loaded from there the
code works correctly in Mozilla but in IE6 it throws an error because it
can't find the init() function which is in file.js Taking init() out of
the body tag makes no difference to Mozilla which continues to display
the menu correctly. But without the init() IE shows nothing.

However, if instead of using a <script ... src=file.js> tag, I take the
code from file.js and but it in-line within a script block, IE can find
the init() function and display everything correctly.

It looks as if IE is holding of on reading the script files until after
the body has loaded. Since it hasn't read the file with the init()
function in it, it can't find it.

Has anyone else seen anything like this?

Jul 20 '05 #1
1 2747
Don wrote:
However, if instead of using a <script ... src=file.js> tag, I take the
code from file.js and but it in-line within a script block, IE can find
the init() function and display everything correctly. Has anyone else seen anything like this?


Only when somebody slipped HTML (<--//) in to the external JavaScript file.
A URL makes these things much easier to troubleshoot.

--
David Dorward http://david.us-lot.org/
Redesign in progress: http://stone.thecoreworlds.net/
Microsoft announces IE is dead (so upgrade):
http://minutillo.com/steve/weblog/20...ces-ie-is-dead
Jul 20 '05 #2

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

Similar topics

1
3157
by: Doug Farrell | last post by:
Hi all, I'm trying to do the following from within a code module: import re # text to match text = "Good morning x something /x, how are you today x something else /x"
1
1991
by: Mathias Mamsch | last post by:
Hi, I have some confusion concerning the weakref module. I am trying to save a weak reference to a bound member function of a class instance for using it as a callback function. But I always get dead references, when I try to create a reference to a bound member function. It seems as if an instance of a class owns no reference to its memberfunctions, so the the reference count is always zero. How can I come behind that?
38
3663
by: Grant Edwards | last post by:
In an interview at http://acmqueue.com/modules.php?name=Content&pa=showpage&pid=273 Alan Kay said something I really liked, and I think it applies equally well to Python as well as the languages mentioned: I characterized one way of looking at languages in this way: a lot of them are either the agglutination of features or they're a crystallization of style. Languages such as APL, Lisp, and Smalltalk are what you might call style...
10
1940
by: Kamilche | last post by:
I'm trying to pack two characters into a single byte, and the shifting in Python has me confused. Essentially, it should be possible to use a 'packed string' format in Python, where as long as the characters you're sending are in the ASCII range 0 to 127, two will fit in a byte. Here's the code. Can you tell what I'm doing wrong? |import types
4
2537
by: JMCN | last post by:
object invalid or no longer set - confusion of the recordset in access 2003. i am currently converting from access 97 to access 2003. majority of the codes converted over perfectly fine, though my recordset did not. i read from pasts posts that some references will not convert. so i tried to change the dao 3.51 reference to dao 3.6 in access 97. then i imported all of the objects into an access 2003. it did not work. so my second...
0
1397
by: i_have_control | last post by:
I'd be grateful for any input on this one: I have three web domains. The destinations of two are set to folders on the first, though that fact is transparent to the user (i.e: it does not REDIRECT to the first domain). Example: http://www.maindomain.com (main hosted package) http://www.subdomain1.com -> www.maindomain.com/subdomain1/ http://www.subdomain2.com -> www.maindomain.com/subdomain2/
13
2097
by: Steve | last post by:
I have a form with a dataset and a datagrid. I created a dataview on this dataset. When the user modifies the datagrid, I look up this record in the dataview to make sure it is unique. Here is the confusion......... I thought that the DataView is the view from the dataset, but it seems that the dataview has the records that are in the datagrid, because everytime I search for a record that I know is NOT in the dataset, it finds it. I...
10
3638
by: joelagnel | last post by:
hi friends, i've been having this confusion for about a year, i want to know the exact difference between text and binary files. using the fwrite function in c, i wrote 2 bytes of integers in binary mode. according to me, notepad opens files and each byte of the file read, it converts that byte from ascii to its correct character and displays
1
3167
by: Richard Lewis Haggard | last post by:
I'm having a problem with what appears to be some sort of confusion with references. I have a single solution with a dozen projects which has been working quite nicely for a while. The references between projects in the solution were established through project references, not by browsing to an assembly DLL. All of the projects are strongly named and use key files. Each project's AssemblyInfo.cs specifies the assembly version, where the...
2
1531
by: Riaaaa | last post by:
Hello, We are doing the project in VB.Net. We had a great confusion for ASP.Net and VB.Net. Is VB.Net project performed in Microsoft Visual Studio 2005 ?? We have created forms in ASP.Net Website selecting the language as Visual Basic in Visual 2005. We want to do the VB.Net project for the central server of the company. Is it can be done as mentioned above ??
0
8459
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
8371
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
8790
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
8652
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
6206
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
5677
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
4372
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2782
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
1779
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.