/    Sign up×
Community /Pin to ProfileBookmark

newbie: including js in js

Hi all,

I have problems believing that it is not possible to write a js file and use a function located in another js file.

I don’t want to use these files in html (I need them for [URL=http://www.openqa.org/selenium-ide/]Selenium IDE[/URL] testing), so I guess that

[CODE]<script type=”text/javascript” src=’xyz.js’>[/CODE]

will do me no good.

Is there anything like “include xyz.js” statement or anything similar that would help me separate the code in several files (thus not making a single file of some 7-8000 lines)?

Thanx in advance..

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@KorSep 06.2006 — Hi all,

I don't want to use these files in html (I need them for [URL=http://www.openqa.org/selenium-ide/]Selenium IDE[/URL] testing), so I guess that [CODE]<script type="text/javascript" src='xyz.js'>[/CODE] will do me no good.

[/QUOTE]

What makes you think so? That is exacttly what you should have done, use an external file. Except that you must close the tag:

<script type="text/javascript" src="xyz.js">[COLOR=DarkGreen]</script>[/COLOR]
Copy linkTweet thisAlerts:
@zorglub76authorSep 06.2006 — None of these worked..

As I said, I am not working with html and html parsers. I am providing pure js functions to an application, and that application could not parse my <script type="text/javascript" src="xyz.js"></script> tag however I entered it to the application (as a link to a html instead of js file in application's configuration, or from inside a js file - from js function that does document.write(.....))
Copy linkTweet thisAlerts:
@cridleySep 06.2006 — What application? Selenium? don't know much about it except that it must have an include framework of some sort. Try their site or the selenium docs for help on this one, as you are not providing enough info here...
×

Success!

Help @zorglub76 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.20,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...