473,750 Members | 2,557 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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="JavaS cript" src="j1.js"></script>
<script language="JavaS cript" 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="JavaS cript" src="j1.js"></script>
</head>

tnx

Sep 5 '07 #1
4 4270
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.javas cript 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.ja vascript 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.bjoe rn.hoehrmann.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 réponse à 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
7147
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 TRIGGER statement.) I've also defined a SQL stored proc, and the trigger is set to call this SP. I've posted the simplified source below. I can manually call the stored proc, and the external trigger is created without any errors. However, when I do...
9
11576
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; dll=Assembly.LoadFrom(@"c:\app\Assembly.dll");
1
2106
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 add-in to another computer? Thanks a lot -------------------------------- From: Kelly ----------------------- Posted by a user from .NET 247 (http://www.dotnet247.com/)
1
1495
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: 00000064 call dword ptr ds: At another point in the same app, it calls the exact same entry point like this and it works: 00000051 call 00A5B073
2
4766
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 from an external dll file. When I mean external dll file I simply mean it's dll which I have not written and I use as an reference (not a web reference) in my VS solution. When I call my webservice from my javascript code that callback...
6
4270
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 CYRILLIC SMALL LETTER YA
4
3175
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 executes. Help! I can't figure this out. The external JS file is "members.js". Here's the code:
2
2312
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 advance. Bye
7
2261
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 clientside event handler of that loaded page.I load both of them using ajax method. The problem is: how to call a function of that external javascript soon after the external javascript file loaded into main page? I tried eval(functionName()) but it...
0
9001
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
8838
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9583
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...
0
9256
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
6081
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
4716
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4888
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2807
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2226
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.