/    Sign up×
Community /Pin to ProfileBookmark

including a .js page using javascript

I am trying to include a Javascript page using Javascript, but it doesn’t seem to work.

[CODE]
<head>
<script type=”text/javascript” language=”Javascript”>
….
..
pageToInclude = 1; //for example purposes. It’s a range of 1-39.
output = “<script type=’text/javascript’ language=’Javascript’ src='”;
output += pageToInclude;
output += “.js’></script>”;
document.write(output);
</script>
<title>………….</title>
…..

..
[/CODE]

the code in 1.js is:

[CODE]
imageList=’A Bunch of <img> Links.’;
[/CODE]

What I’m trying to do is to import the imageList variable into my main document. But then, the </script> tag in the output var seems to conflict with the <script> tag in my main document. So how do I import the imageList variable into my main document? I’m so desperate, i tried SSI, but I’m not that good at it so I’m going to use Javascript anyway.

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@CardinauthorDec 30.2005 — sry. no need for replies. I found a Javascript includer function at [URL=http://www.wsabstract.com/dhtmltutors/ajaxincludes.shtml]http://www.wsabstract.com/dhtmltutors/ajaxincludes.shtml[/URL]
×

Success!

Help @Cardin 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.2,
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: @Yussuf4331,
tipped: article
amount: 1000 SATS,

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

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...