Problem - JS file

Y

Yaron Cohen

Hi,

I would like to ask for you help.

I have a page that contains few JS files (please see below).

The problem is that sometimes one of the files is not loaded (I am
using IE 5.5).

I get a run time error about object that is defined in
"MeridianView.js";


<LINK REL="stylesheet" TYPE="text/css" HREF="../style.css">
<SCRIPT language=JavaScript
src="../JavaScript/MeridianView.js"></SCRIPT>
<SCRIPT language=JavaScript src="../JavaScript/siteMenu.js"></SCRIPT>
<SCRIPT language=JavaScript src="../JavaScript/table.js"></SCRIPT>
<SCRIPT language=JavaScript src="../JavaScript/cookies.js"></SCRIPT>


style.css size is 21k
MeridianView.js size is 29k
siteMenu.js size is 9k
table.js size is 21k
cookies.js size is 5k

My page (asp file) size is 4k

Did you heard about such problem before?

Is my page (including the files) is too big?
How can I prevent it?

Do you think that moving to use persistent connection (can be used in
HTTP/1.1) will be helpful?

Thanks,

Yaron
 
S

Stuart Palmer

I personally would always reference the JS file with a absolute url rather
than a relative, stopping mistakes of having the file in the worng location.
This may not be your problem if it is sometimes loading but worth mentioning
I think.

Stu
 
M

Michael Winter

on 12/11/2003:
I personally would always reference the JS file with a absolute url rather
than a relative, stopping mistakes of having the file in the worng location.
This may not be your problem if it is sometimes loading but worth mentioning
I think.

I would instead recommend specifying the base URL explicitly with the
BASE element. It makes it clear what URLs are relative to, without
being as verbose as using the entire address.

Mike
 
T

Thomas 'PointedEars' Lahn

Stuart said:
I personally would always reference the JS file with a absolute url rather
than a relative, stopping mistakes of having the file in the worng location.

I would not since this increases efforts required for local
testing or simply moving a site to another location.

When the document is downloaded from a HTTP server, the Mozilla JavaScript
console shows a script error in the case a 404 page has been defined and
the script file cannot be found. I found that very useful to track down
undeclared functions.
[Top posting]

Please stop wasting bandwidth and disk space:
http://www.netmeister.org/news/learn2quote.html
Yaron Cohen said:
[...]
<SCRIPT language=JavaScript
src="../JavaScript/MeridianView.js"></SCRIPT>
<SCRIPT language=JavaScript src="../JavaScript/siteMenu.js"></SCRIPT>
<SCRIPT language=JavaScript src="../JavaScript/table.js"></SCRIPT>
<SCRIPT language=JavaScript src="../JavaScript/cookies.js"></SCRIPT>

The OP should try

<script
src="../JavaScript/MeridianView.js"
type="text/javascript"
</script>
<script src="../JavaScript/siteMenu.js" type="text/javascript"></script>
<script src="../JavaScript/table.js" type="text/javascript"></script>
<script src="../JavaScript/cookies.js" type="text/javascript"></script>

instead.

Now sum it up and think about a low-bandwidth (say a 56k analog modem) user
that has JavaScript supported and enabled. Is the additional functionality
really worth to wait this long?

Yes, see above.

The Magic Eight Ball says: Unlikely.

Check for the location of your files (use the location bar),
and optimize the scripts where possible. If you used that
scripts unreflected, you better discard them, learn JavaScript
and the DOMs your are targeting and write it for yourselves.

No. It is a location or script issue, not a connection issue.


PointedEars
 
T

Thomas 'PointedEars' Lahn

Michael Winter said:
on 12/11/2003:

Please repair your newsreader:
http://home.in.tum.de/~jain/software/oe-quotefix/

And use a valid e-mail address, according to the standards:
http://www.interhack.net/pubs/munging-harmful/
I would instead recommend specifying the base URL explicitly with the
BASE element. It makes it clear what URLs are relative to, without
being as verbose as using the entire address.

As said before, using the `href' attribute of the `base' element
increases maintenance effort. Thus I would not recommend it.


PointedEars
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top