Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
getting javascripts into external file
Old 03-01-2010, 02:23 PM getting javascripts into external file
Skilled Talker

Posts: 62
Name: Andrew
Trades: 0
I am attempting to get most of the javascripts in the html of my site into external files (ina directory on my site). The process seems fairly straigtfoward when there is a single script in the head or body - you just create a script with a url path leading to the external file (a page with the actual script with a .js extention).

But some of my scripts have a section in the head section, and then a corresponding section in the body snippet. I'm not sure exactly how it works, but it seems like the script snippet in the body section somehow calls the script in the head section. I was wondering if anyone had any suggestions as to how to get these type of javascripts into external file?

Do I just create a external file for the javascript section in the head, or do I do this just for the section in the body, or... can I create external files for both of the scripts locinted in the head and body? Thanks for any suggestions.
andrew99 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 03-01-2010, 03:29 PM Re: getting javascripts into external file
lynxus's Avatar
Awesomeo-Maximo

Posts: 1,618
Location: UK
Trades: 1
You should be fine referring to external JS wherever you put the script.

All i can suggest is 'Sucking it and seeing' Ie: Give it a try.
__________________

Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE


lynxus is offline
Reply With Quote
View Public Profile Visit lynxus's homepage!
 
Old 03-01-2010, 03:51 PM Re: getting javascripts into external file
xela1966's Avatar
Super Talker

Posts: 135
Name: Baptista
Location: Alvor, Algarve Portugal
Trades: 0
And if the script is a outside the domain as the counters, is that possible to put it out side the html in a external .js???
__________________
Algarve Holidays
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
xela1966 is offline
Reply With Quote
View Public Profile Visit xela1966's homepage!
 
Old 03-01-2010, 04:02 PM Re: getting javascripts into external file
Skilled Talker

Posts: 62
Name: Andrew
Trades: 0
xela1966 - I've been able to pull external scripts from other domains before, so my quess is that it will work. I used scripts like this to trigger popups.

I'm still wondering if a script has a head and body section, which section can be the external .js file, the head section, the body section, or both? I'll keep experimenting, but pelase let me know if anyone has any suggestions.
andrew99 is offline
Reply With Quote
View Public Profile
 
Old 03-01-2010, 04:04 PM Re: getting javascripts into external file
lynxus's Avatar
Awesomeo-Maximo

Posts: 1,618
Location: UK
Trades: 1
Normally putting JS outside of your domain will cause problems due to cross site scripting.

But ive had "mostly" good success with CSS issues.

I think CSS only really comes into play when you try to load external cab / jar files from a domain not local to the page.
__________________

Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE


lynxus is offline
Reply With Quote
View Public Profile Visit lynxus's homepage!
 
Reply     « Reply to getting javascripts into external file
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.81642 seconds with 12 queries