JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old August 31st, 2004, 03:27 PM
shawn shawn is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 24 shawn User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
external js files

Howdy yall.

I am having a little trouble here with external js files.
I have a page which loads a .js file with my navigation scripts. I also have another .js file that I would
like to load which contains all the specific page functions. However, it doesn't seem to like that I have two
external files. One works just fine. If I copy and paste the code from the second one into the html file, it works.

It just complains when I have two external js. Is there a one external file limit?

Heres the code if that helps any.

Code:
<script language="JavaScript" src="partfilenavigation.js"></script>
<script language="JavaScript" src="partfilerouting.js"></script>


The above doesnt work.
The below does. The code is the partfilerouting.js file is what is inside the script tags in the inline javascript.

Code:
<script language="Javascript" src="partfilenavigation.js"></script>
<script>
function doThis() {
alert("Test");
}
</script>


Any reason why?

Thanks in advance for any help.
Shawn

Reply With Quote
  #2  
Old August 31st, 2004, 04:52 PM
Jackot29 Jackot29 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Location: Paris, FRANCE
Posts: 29 Jackot29 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 32 m 10 sec
Reputation Power: 0
Smile tags positionning is important, (relatively to the functions or variables calls)

If you call the doThis() function, you must insert the Script-Insert-Tag before it in your page.

However, the doThis() function can be declared anywhere, if you insert it directly in your page.


There is no other restriction.
You can load as many external .js files as needed.

Reply With Quote
  #3  
Old August 31st, 2004, 05:04 PM
shawn shawn is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 24 shawn User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Quote:
Originally Posted by Jackot29
If you call the doThis() function, you must insert the Script-Insert-Tag before it in your page.

However, the doThis() function can be declared anywhere, if you insert it directly in your page.


There is no other restriction.
You can load as many external .js files as needed.


I do call the doThis() function. I use the functions as my onBlur="doThis();" events and such. My two externals are declared right after each other.
Neither external refers to each other. The externals are declared in the HEAD section of the HTML page.

Does that make any sense?

Reply With Quote
  #4  
Old August 31st, 2004, 05:11 PM
Jackot29 Jackot29 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Location: Paris, FRANCE
Posts: 29 Jackot29 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 32 m 10 sec
Reputation Power: 0
Question

It seems to be good. Exposed like it, it should work.

Could you tell more about this 3 files ?

Reply With Quote
  #5  
Old September 1st, 2004, 10:19 AM
shawn shawn is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 24 shawn User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Possible answer

Ok, I think I may have figured out what makes it not work. I probably failed to mention (not thinking it should matter) that I am
programming in Coldfusion. Well, the javascript interacts with the Coldfusion varaibles using CFOUTPUT tags to identify those varaibles.
Apparently, javascript can handle this when the function is inline, but not when it is external.

I tried a simple function that just sent an alert to the screen, and it worked fine. But when I tried to have it alert with the coldfusion variable
it threw an error upon loading the javascript.

So that seems to be the problem.

Thanks for the assistance anyway.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingJavaScript Development > external js files


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump




 Free IT White Papers!
 
Create the Optimal Architecture for your Critical Applications
Warburton's the largest independently owned bakery in the UK faced a number of difficult challenges in providing the most robust yet efficient IT infrastructure for their organization's success. IBM's services combined with their xSeries servers created the perfect platform for their SAP environment with sufficient flexibility, and did so in very time effective fashion.

Request Your Free Technology Downloads!
 
Five Best Practices for Deploying a Successful Service-Oriented Architecture
This white paper describes the benefits you can expect with SOA, and how IBM can help take your business there.

Request Your Free Technology Downloads!
 
Gartner Magic Quadrant for Application Delivery Controllers
Gartner summarizes its view on Application Delivery Controllers, evaluates strengths and weaknesses of solutions, and provides Magic Quadrant reporting for a quick comparison across all vendors. Learn from Gartner how you can benefit from an all-in-one device like Citrix NetScaler that delivers the highest levels of availability, performance and security.

Request Your Free Technology Downloads!
 
Knowledge is Power
What you don't know can hurt you, and is likely costing you money and increasing your security risks during an era of scarce resources. This white paper proposes six key strategies that enterprise security managers can use to improve their network defense posture.

Request Your Free Technology Downloads!
 
Rationalizing the Multi-Tool Environment
The rationalized multi-tool approach is flexible, scalable and cost effective. It provides the necessary input to the IT service management business processes. It preserves prior investments in monitoring tools, empowers technologists to select the best tools with which to do their jobs, and enhances effective response to incidents.

Request Your Free Technology Downloads!
 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 




© 2003-2010 by Developer Shed. All rights reserved. DS Cluster 3 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek