472,952 Members | 1,835 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,952 software developers and data experts.

how to call external .js file from another .js file

hi,

usually if we call external js file by declaring them in our html page
head section:

<head>
..
..
..
<script language="JavaScript" src="j1.js"></script>
<script language="JavaScript" src="j1_ext.js"></script>
</head>

my question is...is it possible to declare j1_ext.js from j1.js?
eliminating j1_ext.js from <head ..section declaration.

<head>
..
..
..
<script language="JavaScript" src="j1.js"></script>
</head>

tnx

Sep 5 '07 #1
4 4244
Randy Webb :
You forgot to mention that the type attribute is obsolete though.
I sure learn a lot here! Since when is that the case?

--
Johannes
"Quand on dit c'est un Johannes, cela vaut autant que ce que maintenant
on appelle un pédant" (H. Estienne, in É. Littré, /Dictionnaire de la
langue française/, art. PÉDANT)
Sep 5 '07 #2
Johannes Baagoe said the following on 9/5/2007 5:20 PM:
Randy Webb :
>You forgot to mention that the type attribute is obsolete though.

I sure learn a lot here! Since when is that the case?
I shouldn't have said the type attribute was obsolete, it isn't. What is
obsolete is the only acceptable value for the attribute. text/javascript
was obsoleted the minute it was standardized.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Sep 5 '07 #3
Randy Webb wrote:
Johannes Baagoe said the following on 9/5/2007 5:20 PM:
>Randy Webb :
>>You forgot to mention that the type attribute is obsolete though.
I sure learn a lot here! Since when is that the case?

I shouldn't have said the type attribute was obsolete, it isn't. What
is obsolete is the only acceptable value for the attribute.
text/javascript was obsoleted the minute it was standardized.
Wrong. RFC4329, which you are you are referring to is *not* on the IETF
Standards Track. In fact, its status section explicitly states that "It
does not define an Internet standard of any kind."

That it was registered at IANA by initiative of the IESG/IETF as being
obsolete due to the presumption of the latter or the RFC's author (or him
not being clear enough on the subject, let alone not having demonstrated
sufficient experience in the field of application of the said media type
to date) has no bearing for (at least) my recommendation regarding that,
as using that so-called obsolete media type is the best current practice
due to the maximum possible support of it among current and possibly future
user agents. Much in contrast to the alternatives defined by that RFC.

The explanation for "obsolete" given to me by the RFC's author, Bjoern
Hoermann, in de.comp.lang.javascript was that according to RFC4288, the only
alternatives would have been "common" and "limited use", while the former
was strongly objected and the latter was seen as not being heavily endorsed
by the participants of the respective discussion.[1] Which IMHO would beg
the question whether any of those people has ever written a cross-browser
client-side script in an ECMAScript implementation.

http://pointedears.de/scripts/test/mime-types/
PointedEars
___________
[1] <b1********************************@hive.bjoern.ho ehrmann.de>
--
"Use any version of Microsoft Frontpage to create your site. (This won't
prevent people from viewing your source, but no one will want to steal it.)"
-- from <http://www.vortex-webdesign.com/help/hidesource.htm>
Sep 6 '07 #4
ASM
En rponse Randy Webb qui crivit, en date du : 7/09/07 15:30, le
message suivant :
>
ASM has already posted the URL to
a page and the code to include a .js file on the fly. I know the code he
posted is dependable because I wrote it :)
Yes it is a copy-past :-)

It could be time you give your address and/or name on this page, no ?

(as it is in my bookmarks and I very often site it - without remembering
from where/who it comes )
Sep 7 '07 #5

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

Similar topics

0
by: Dave Sisk | last post by:
I've created a system or external trigger on an AS/400 file a.k.a DB2 table. (Note this is an external trigger defined with the ADDPFTRG CL command, not a SQL trigger defined with the CREATE...
9
by: keith | last post by:
I created a class libery which has name space Assembly and class Assembly and compiled it. Then created a C# project and called a method in the external class e.g. Assembly dll;...
1
by: Kelly Xie via .NET 247 | last post by:
Hi, I am building an add-in to the .NET framework using C#. I need to call an external executable file. It works fine with the computer I am working now. How can I make it work when I install the...
1
by: stevo | last post by:
What causes C# to generate code to call the same external DLL 2 different ways? At one point in the app, it calls the entry point like this (disassembled) and it bombs with a null reference:...
2
by: PrettySneaky | last post by:
I have bumbed into a frustrating problem with my webservice. When I run he web site in Visual studio 2005 everything works fine. But when i try to publish it, it seems to be unable to call a method...
6
by: mygoogleaccount | last post by:
Hi, may be someone could help me ? i need to use cyrillic letters in a php application. I changed everything to UTF-8 and it works fine. The only problem are CYRILLIC SMALL LETTER ES...
4
by: dennise9 | last post by:
My exeternal JS works fine when the call is placed in the page head or body. But if I call the same javascript from a (clicked) text link on the page, the script throws a JS error when it...
2
by: kirkox | last post by:
Hi guys, this is my first post. I am a newbie, of course. The question is really simple: how can I call functions from an external file in a new js file and work with its method? Thank in...
7
progdoctor
by: progdoctor | last post by:
I have a php web based application with dhtml menu. Each time user click menu Item, the page loads external php page into a div container in that page and then load external javascript as the...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...

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.