474,045 Members | 2,342 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Javascript includes not recognised

Hi,

This may seem like a client side problem but....

I have web pages that are made up of a number of javascript include files as
well as 'in page' script. They all work fine running locally until I hosted
them on our IIS server. Then the pages refuse to see nested javascript
calls.

e.g.

Main page contains JS code to call a function to one of the include files (-
no probs), which in turn wants to call a function in one of the other JS
include files but falls over with 'object expected' error in the line of
that call - I assume because it can't fine the function.

I think it may be something to do with processing order but as these files
are almost identical to another site that I created (certainly the JS
include files are and that worked 100%), I'm a bit lost. Any help would be
greatly appreciated.

Martin

Jul 19 '05 #1
25 2031
The problem may be caused because the browser has managed to download all
included the .js files yet. Instead, it is attempting to call a function in
a file that it doesn't have yet, generating an error.

Cheers
Ken
"Martin Walke" <ma**********@s pamvega.co.uk> wrote in message
news:%2******** **********@TK2M SFTNGP10.phx.gb l...
: Hi,
:
: This may seem like a client side problem but....
:
: I have web pages that are made up of a number of javascript include files
as
: well as 'in page' script. They all work fine running locally until I
hosted
: them on our IIS server. Then the pages refuse to see nested javascript
: calls.
:
: e.g.
:
: Main page contains JS code to call a function to one of the include files
(-
: no probs), which in turn wants to call a function in one of the other JS
: include files but falls over with 'object expected' error in the line of
: that call - I assume because it can't fine the function.
:
: I think it may be something to do with processing order but as these files
: are almost identical to another site that I created (certainly the JS
: include files are and that worked 100%), I'm a bit lost. Any help would be
: greatly appreciated.
:
: Martin
:
:
:
Jul 19 '05 #2
Object expected implies that the reference you used is either correct and
the object doesn't exist (script may have failed to load) or that the
reference is incorrect (eg. case sensitivity).

Try putting an alert into the script onload event to see if this pops up
before an alert at the point at which you call the function. You can also
use the DOM to check the script load status if you give the script an id
that you can refer to.

Make sure you .js files are referenced in the HEAD section of the html - the
page body shouldn't load until all elements of this section have loaded
*unless* you specify that a script can be loaded asynchronously.

Chris.
"Martin Walke" <ma**********@s pamvega.co.uk> wrote in message
news:%2******** **********@TK2M SFTNGP10.phx.gb l...
Hi,

This may seem like a client side problem but....

I have web pages that are made up of a number of javascript include files as
well as 'in page' script. They all work fine running locally until I hosted
them on our IIS server. Then the pages refuse to see nested javascript
calls.

e.g.

Main page contains JS code to call a function to one of the include files (-
no probs), which in turn wants to call a function in one of the other JS
include files but falls over with 'object expected' error in the line of
that call - I assume because it can't fine the function.

I think it may be something to do with processing order but as these files
are almost identical to another site that I created (certainly the JS
include files are and that worked 100%), I'm a bit lost. Any help would be
greatly appreciated.

Martin


Jul 19 '05 #3
Chris Barber wrote on 17 feb 2004 in
microsoft.publi c.inetserver.as p.general:
Make sure you .js files are referenced in the HEAD section of the html
- the page body shouldn't load until all elements of this section have
loaded *unless* you specify that a script can be loaded
asynchronously.


Or you can ask serverside help.

replace:

<script type="text/javascript"
src ="/js/myjavascript.js ">
</script>
with:

<script type="text/javascript">
<!--#include virtual ="/js/myjavascript.js "-->
</script>
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 19 '05 #4
But that prevents the browser from caching the page since you are using
inline javascript.

The whole point of <script src="/somewhereElse/something.js"
type="text/javascript"> is to allow the browser to cache the .js files
reducing the apparent response time of the application.

Cheers
Ken

"Evertjan." <ex************ **@interxnl.net > wrote in message
news:Xn******** ************@19 4.109.133.29...
: Chris Barber wrote on 17 feb 2004 in
: microsoft.publi c.inetserver.as p.general:
:
: > Make sure you .js files are referenced in the HEAD section of the html
: > - the page body shouldn't load until all elements of this section have
: > loaded *unless* you specify that a script can be loaded
: > asynchronously.
: >
:
: Or you can ask serverside help.
:
: replace:
:
: <script type="text/javascript"
: src ="/js/myjavascript.js ">
: </script>
:
:
: with:
:
: <script type="text/javascript">
: <!--#include virtual ="/js/myjavascript.js "-->
: </script>
:
:
: --
: Evertjan.
: The Netherlands.
: (Please change the x'es to dots in my emailaddress)
Jul 19 '05 #5
I am having the exact same problem. Brand New win2k install service pack 4 and patches.
The site works on all other servers, but on the new one the javascript includes are not functioning

I put alerts in the included files that never fire.

I tried the virtual includes and I am still getting the problem

Thank
----- Ken Schaefer wrote: ----

But that prevents the browser from caching the page since you are usin
inline javascript

The whole point of <script src="/somewhereElse/something.js
type="text/javascript"> is to allow the browser to cache the .js file
reducing the apparent response time of the application

Cheer
Ke

"Evertjan." <ex************ **@interxnl.net > wrote in messag
news:Xn******** ************@19 4.109.133.29..
: Chris Barber wrote on 17 feb 2004 i
: microsoft.publi c.inetserver.as p.general

: > Make sure you .js files are referenced in the HEAD section of the htm
: > - the page body shouldn't load until all elements of this section hav
: > loaded *unless* you specify that a script can be loade
: > asynchronously
:

: Or you can ask serverside help

: replace

: <script type="text/javascript
: src ="/js/myjavascript.js "
: </script
: with

: <script type="text/javascript"
: <!--#include virtual ="/js/myjavascript.js "--
: </script
: --
: Evertjan
: The Netherlands
: (Please change the x'es to dots in my emailaddress

Jul 19 '05 #6
Ken Schaefer wrote on 17 feb 2004 in
microsoft.publi c.inetserver.as p.general:
The whole point of <script src="/somewhereElse/something.js"
type="text/javascript"> is to allow the browser to cache the .js files
reducing the apparent response time of the application.


I don't think that is that important any more even with POTS bandwith.

A small jpeg is much bigger than the general .js file.

No, IMHO, the point is to make one .js file usable
in many different .html's.

And the serverside include is not possible
for many clientside only virtual servers.

And some people think it diminishes the visual exposure
to simpleminded view-sorcerers.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 19 '05 #7
More Info: When I do the virtual the alerts fire but the popup menu wont function
The application is a .net 1.0 app using user controls for the header.

I have tried if from IE and Safari and both work on all other machines except this one

Thank

Jul 19 '05 #8
=?Utf-8?B?TU1pdGNoZWx s?= wrote on 17 feb 2004 in
microsoft.publi c.inetserver.as p.general:
More Info: When I do the virtual the alerts fire but the popup menu
wont function. The application is a .net 1.0 app using user controls
for the header.


So you are heavily OT here on this classical ASP NG.

Please see a dotnet group.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 19 '05 #9
Thanks guys.

All my includes are in the head section, and the offending line is being
called from the page onLoad routine which I thought was only actioned once
the page HAD downloaded all its 'bits'. It doesn't do it when using PWS, so
at least I can carry on testing for the moment but it must be something it
the timing og page downloads.

I'll check out the DOM object to see how I can check the script loading -
any idea of the method?

In terms of sequence of events when the browser loads a page, is there some
info somewhere that explains it? I've browsed the web without much luck but
sometimes it's useful to know what keywords to look for ;-)!

Thanks again
Martin

"Chris Barber" <ch***@blue-canoe.co.uk.NOS PAM> wrote in message
news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
Object expected implies that the reference you used is either correct and
the object doesn't exist (script may have failed to load) or that the
reference is incorrect (eg. case sensitivity).

Try putting an alert into the script onload event to see if this pops up
before an alert at the point at which you call the function. You can also
use the DOM to check the script load status if you give the script an id
that you can refer to.

Make sure you .js files are referenced in the HEAD section of the html - the page body shouldn't load until all elements of this section have loaded
*unless* you specify that a script can be loaded asynchronously.

Chris.
"Martin Walke" <ma**********@s pamvega.co.uk> wrote in message
news:%2******** **********@TK2M SFTNGP10.phx.gb l...
Hi,

This may seem like a client side problem but....

I have web pages that are made up of a number of javascript include files as well as 'in page' script. They all work fine running locally until I hosted them on our IIS server. Then the pages refuse to see nested javascript
calls.

e.g.

Main page contains JS code to call a function to one of the include files (- no probs), which in turn wants to call a function in one of the other JS
include files but falls over with 'object expected' error in the line of
that call - I assume because it can't fine the function.

I think it may be something to do with processing order but as these files
are almost identical to another site that I created (certainly the JS
include files are and that worked 100%), I'm a bit lost. Any help would be
greatly appreciated.

Martin

Jul 19 '05 #10

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

Similar topics

8
2408
by: Dave Thomas | last post by:
I have developed a web site using asp pages that use both vbscript and javascript. Run the site on my PC and everything is fine. Ftp to my web hosting provider which hosts asp pages and look on my site only to find my vbscript is not recognised. It is treated as pure text so you see <% =Request.Form("LoginId") %>. Also see all the vbscript when you "View Source". I have e-mailed my host provider but thought this may be quicker! Any ideas...
0
1199
by: Martin Walke | last post by:
Hi guys, For those who responded before here's an update from hell!!! I think I confused people before when I said on the 'page load' and Chris suggested using the body onload. I was using the onLoad of the body tag anyway to start my JS function. Anyway, I changed the order of my includes such that the one that calls all the rest was loaded last and that worked.....or so I thought.
5
1901
by: relaxedrob | last post by:
Howdy All! I have just finished developing a menu template for easy use in an any web page! The example uses CSS and JavaScript. The url is: http://phd.netcomp.monash.edu.au/RobertMarkBram/menu/
7
1961
by: McKirahan | last post by:
Has anyone experienced this (and found a solution)? I have five files: a .htm that invokes four .js include files. Only the first alert in the first include is displayed. This only happens when I run on a client's corporate server. I have no problems on a laptop connected to the network or on my home PC. Any ideas? Thanks in advance.
1
3515
by: =?Utf-8?B?SkhpbGJDUk0=?= | last post by:
I am trying to write a httpmodule to inject javascript includes on some of the aspx pages we have. For instance, I want to inject into the resulting IIS response something like... response.Write("<script language='javascript'>"); response.Write("alert('tt');"); response.Write(@"</script>");
0
10546
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
12140
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...
1
12023
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
11142
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...
0
7870
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
6837
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
5417
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
4944
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3971
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.