/    Sign up×
Community /Pin to ProfileBookmark

Calling a JS file

I’ve created a .js file that I call from my HTML page. The call code looks like this: ‘<SCRIPT LANGUAGE=”JavaScript” SRC=”/wsmedia/jsfiles/settheuserid.js”></SCRIPT>’

That is the path where the js file exists. All it does is read a cookie and place it in a hidden text field on a form. It is not working at all. I get an error saying ‘Object expected’.

I placed the javascript code in the HTML (instead of calling it) (between head tags) and worked fine. Does anyone know what might be causing the error when it’s called?

Thanks in advance.

to post a comment
JavaScript

5 Comments(s)

Copy linkTweet thisAlerts:
@PittimannFeb 25.2005 — Hi!

Maybe you have script tags inside the file. You need 'naked' js in a .js file.

Cheer - Pit
Copy linkTweet thisAlerts:
@rbarilaauthorFeb 25.2005 — Sorry, I had the javascript tags inside the js file.
Copy linkTweet thisAlerts:
@PittimannFeb 25.2005 — Hi!

No need to say sorry! ?

The tags simply do not belong there.

Cheers - Pit
Copy linkTweet thisAlerts:
@rbarilaauthorFeb 25.2005 — Hey Pit, Thanks for the response. I actually realized that mistake before I read your response. Good call though. Thanks again.
Copy linkTweet thisAlerts:
@PittimannFeb 25.2005 — Hi!

The main thing is that you got it working.

Even though I didn't help (I sometimes try to be polite): you're welcome. ?

Regards - Pit
×

Success!

Help @rbarila 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 6.16,
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: @nearjob,
tipped: article
amount: 1000 SATS,

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

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