By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,504 Members | 1,194 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,504 IT Pros & Developers. It's quick & easy.

Problem - JS file

P: n/a
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

Jul 20 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
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

"Yaron Cohen" <ya****@lyciumnetworks.com> wrote in message
news:9k********************************@4ax.com...
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

Jul 20 '05 #2

P: n/a
"Stuart Palmer" wrote 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

--
Michael Winter
M.Winter@[no-spam]blueyonder.co.uk (remove [no-spam] to reply)
Stu

"Yaron Cohen" <ya****@lyciumnetworks.com> wrote in message
news:9k********************************@4ax.com...
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


Jul 20 '05 #3

P: n/a
Stuart Palmer wrote:
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" <ya****@lyciumnetworks.com> wrote
[...]
<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.
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
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?
Did you heard about such problem before?
Yes, see above.
Is my page (including the files) is too big?
The Magic Eight Ball says: Unlikely.
How can I prevent it?
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.
Do you think that moving to use persistent connection (can be used in
HTTP/1.1) will be helpful?


No. It is a location or script issue, not a connection issue.
PointedEars
Jul 20 '05 #4

P: n/a
Michael Winter <M.Winter@[no-spam]blueyonder.co.uk> wrote:
^^^^^^^^^
"Stuart Palmer" wrote 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.


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
Jul 20 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.