Forum Moderators: open

Message Too Old, No Replies

<link rel="javscript" type="text/css" href="../js/gen_validation.js" /

         

halloweb

10:27 am on Sep 14, 2004 (gmt 0)

10+ Year Member



<SCRIPT language=JavaScript1.2
src="../js/gen_validation.js"></SCRIPT>
also possible as to be written in (xhtml) like this
I tried but nothing if written like mentioned below

<link rel="javscript" type="text/css" href="../js/gen_validation.js" />

halloweb

10:28 am on Sep 14, 2004 (gmt 0)

10+ Year Member


<link rel="javascript" type="text/javascript" href="../js/gen_validation.js" />

halloweb

10:29 am on Sep 14, 2004 (gmt 0)

10+ Year Member


<script language=JavaScript1.2
src="../js/gen_validation.js"></script>

is this also valid xhtml coding?

encyclo

12:19 pm on Sep 14, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



No, the language attribute is deprecated. Try this:

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

moltar

1:03 pm on Sep 14, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Also note that tag names have to be lowercase in XHTML.

halloweb

1:41 pm on Sep 14, 2004 (gmt 0)

10+ Year Member


what about the <noscript> ...</noscript>
is that needed when using comments in your js

second question what if you have one external js
and other part of js in body as needed how is it than the correct way to use the jaavscript in the bodytag

<script type="text/javscript">
function ... blablabla
</script>

and
<script type="text/javscript" src="js/externaljs.js">

</script>

third question in this case was the js written before the xhtml era and it uses the

language="JavaScript1.2" attribute >>>>>>>>>>>
should I leave it out then?

moltar

5:41 pm on Sep 17, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You should do this:


<head>
<script type="text/javascript" src="path/to/external/file" />

<script type="text/javascript">
... inline script code goes here ...
</script>
</head>

language
attribute is deprecated in XHTML. It's replaced with
type
attribute.

drbrain

6:51 pm on Sep 17, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



<html>
<head>
<title>&lt;script&gt; in XHTML</title>
<script type="text/javascript" src="/path/to/script.js"></script>
<!--
! MUST BE CLOSED FOR HTML COMPATIBILITY [w3.org]!

Since you're going to be transmitting this as text/html, most likely, omitting the </script> will leave your document with an unclosed <script> because HTML does not understand what <script /> means.

(No, there is no way [hixie.ch] for the browser to detect XHTML when sent with an HTML MIME type.)
-->
<script type="text/javascript">
<![CDATA[
/* You need to mark this as a CDATA section [w3.org] */
]]>
</script>

</head>
<body>
<p>This is valid XHTML1.0. (No, you do not need the xml prolog or DOCTYPE per Appendix C.)</p>
<p>Note that you may not use document.write() in an XHTML document. You must manipulate the document via the DOM.</p>
</body>
</html>