Click to See Complete Forum and Search --> : [RESOLVED] XHTML 1.0 and external Javascript


Tusserte
08-22-2006, 07:22 PM
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.

felgall
08-22-2006, 09:24 PM
The two things are not related. Can you provide a link?

Tusserte
08-22-2006, 10:06 PM
Okay, here are a few links. If you want to view the source code, be aware that I'm using frames.

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

The resize script (http://www.ultimate-reviews.net/templates/reviewresize.js)
=The text highlighting script (http://www.ultimate-reviews.net/templates/text.js)

Tusserte
08-24-2006, 12:44 PM
Does anyone know?

Tusserte
08-26-2006, 11:17 PM
Okay, if no one can answer, I'll move this question to another forum. Thanks anyways.

Charles
08-27-2006, 06:23 AM
The two things are not related. Can you provide a link?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 .

Tusserte
08-27-2006, 11:13 AM
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.

Charles
08-27-2006, 11:29 AM
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 must read, mark, learn and inwardly digest those HTML Compatability Guidelines (http://www.w3.org/TR/xhtml1/#guidelines).

Tusserte
08-27-2006, 11:44 AM
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.

Tusserte
08-27-2006, 10:48 PM
EDIT: I switched back, and the code still 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?

Charles
08-28-2006, 04:34 AM
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.

Tusserte
08-28-2006, 11:20 AM
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).

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

<script src="/templates/text.js" type="javascript"></script>

Charles
08-28-2006, 01:01 PM
There is no type "javascript"; it's "text/javascript".