/    Sign up×
Community /Pin to ProfileBookmark

Ok whats wrong with this in a .js file it dont work?

document.write(‘footerhere’);

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@CharlesSep 23.2003 — [font=georgia]Off hand and without seeing the rest of the page I'd say...

1) Know that you cannot "document.write" once a page has already loaded;

2) And using JavaScript for an include is very bad as 13% of users do not use it.[/font]
Copy linkTweet thisAlerts:
@lukezwebauthorSep 23.2003 — ok one sec im linking to a .js file using this:

<SCRIPT SRC="http://######/footer.js">

in the .js file it has the baove i posted
Copy linkTweet thisAlerts:
@CharlesSep 23.2003 — [font=georgia]That's incorrect on two accounts. See http://www.w3.org/TR/html4/interact/scripts.html.[/font]
Copy linkTweet thisAlerts:
@requestcodeSep 23.2003 — Lukesweb,

What are you trying to accomplish? If you could give us some details it might help. Also, you can use document.write once a page loads if you are writing to a container such as a div or span tag, but with the new browers it would be better to using innerHTML or innerTEXT. In NS4 version browsers that was how you added or modified HTML or text.
×

Success!

Help @lukezweb 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.19,
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,
)...