/    Sign up×
Community /Pin to ProfileBookmark

[RESOLVED] XHTML 1.0 and external Javascript

Ever since I started validating my pages with XHTML 1.0 Transitional, my external Javascript codes have stopped working. What do I have to change in my codes to get them to work again? Thanks.

to post a comment
JavaScript

12 Comments(s)

Copy linkTweet thisAlerts:
@felgallAug 23.2006 — The two things are not related. Can you provide a link?
Copy linkTweet thisAlerts:
@TusserteauthorAug 23.2006 — Okay, here are a few links. If you want to view the source code, be aware that I'm using frames.

[URL=http://www.ultimate-reviews.net/gamereviews/advancewars2blackholerising/main.html]An example page[/URL] (the window should resize and the middle frame with the reviews should have a code to disable text highlighting)

[URL=http://www.ultimate-reviews.net/templates/reviewresize.js]The resize script[/URL]

[URL=http://www.ultimate-reviews.net/templates/text.js]=The text highlighting script[/URL]
Copy linkTweet thisAlerts:
@TusserteauthorAug 24.2006 — Does anyone know?
Copy linkTweet thisAlerts:
@TusserteauthorAug 27.2006 — Okay, if no one can answer, I'll move this question to another forum. Thanks anyways.
Copy linkTweet thisAlerts:
@CharlesAug 27.2006 — The two things are not related. Can you provide a link?[/QUOTE]No doubt they are. HTML and XHTML are not compatable and you are using XHTML but telling browsers that it's HTML. So the browser is expecting you to follow some HTML rules that you are breaking with abandon. I'm thinking that this is the problem. Your best bet is to use HTML 4.01 Strict, XHTML isn't really suited for the internet. But if you think that it will make you popular with the ladies and insist upon XHTML you need to use the HTML/XHTML hybrid described in the XHTML 1.0 spec. See http://www.w3.org/TR/xhtml1/#guidelines .
Copy linkTweet thisAlerts:
@TusserteauthorAug 27.2006 — I was just trying to convert to XHTML to keep from being outdated. However, I can go back to HTML, but it'll be a really big job... I'm not too good with making my own code, so coulld you explain what you mean by "using XHTML but telling browsers that it's HTML"? I tried following the new rules for XHTML, but I guess I didn't understand them well enough...

ALSO, could I just make the file a .shtml file (and replace the opening/closing script tags) and use SSI to put it in each page? If possible, I would rather do that than change back.
Copy linkTweet thisAlerts:
@CharlesAug 27.2006 — There is absolutely nothing outdated about HTML and never will be. XHTML is something else, developed for other things.

But if you do keep with XHTML you [i]must[/i] read, mark, learn and inwardly digest those [url=http://www.w3.org/TR/xhtml1/#guidelines]HTML Compatability Guidelines[/url].
Copy linkTweet thisAlerts:
@TusserteauthorAug 27.2006 — Okay, since I don't really understand how to actually apply those rules, I'll just make the switch back. Thanks for all your help.
Copy linkTweet thisAlerts:
@TusserteauthorAug 28.2006 — EDIT: I switched back, and the code [I]still[/I] didn't work. It worked perfectly before I tried to validate everything (first with HTML 4.01 Transitional, then with XHTML 1.0 Transitional, and then back to HTML 4.01 Transitional). I'm also using UTF-8 encoding. Can anyone tell me what's wrong?
Copy linkTweet thisAlerts:
@CharlesAug 28.2006 — Well, you should be using HTML 4.01 Strict but obviously you made some other change.

This might help, I was unable to find your scripts in your documents.
Copy linkTweet thisAlerts:
@TusserteauthorAug 28.2006 — Okay...

The two parts of the codes are right here (one's in the middle frame); they're both in the head commands and both don't work any more (they used to).

[CODE]<script src="/templates/reviewresize.js" type="javascript"></script>

<script src="/templates/text.js" type="javascript"></script>[/CODE]
Copy linkTweet thisAlerts:
@CharlesAug 28.2006 — There is no type "javascript"; it's "text/javascript".
×

Success!

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