/    Sign up×
Community /Pin to ProfileBookmark

internal js and external .js

I am trying to get a page to use js that is in its own head section, and some that is in a js file, what I have looks like this:

<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN”
http://www.w3.org/TR/html4/strict.dtd“>
<html>
<head>
<script language=”JavaScript” type=”text/JavaScript” src=”jsfile.js”>
function somefunction()
</script>
</head>
<body>

I cant get the js in the head section to work, when the file is linked, seams like it completly ignores the js in the head.

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@JPnycDec 21.2004 — Make em separate script tags. You can't both link to an external, and include a function, in the same set of script tags.
Copy linkTweet thisAlerts:
@CharlesDec 21.2004 — Also,

  • * A TITLE element is required in all versions of HTML.


  • * You need to specify the character encoding.


  • * The SCRIPT element does not take a "language" attribute in HTML 4.01 Strict.


  • * Your DOCTYPE has the public identifier for 4.01 transitional but the system identifier for 4.01 strict.


  • [font=monopace]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"

    "http://www.w3.org/TR/html4/strict.dtd">[/font]
    ×

    Success!

    Help @aeetes 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.17,
    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,
    )...