By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,630 Members | 1,427 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,630 IT Pros & Developers. It's quick & easy.

Java title

P: n/a
What is the current way for stating what a java script TITLE is for
xhtml strict since I must be over looking it? W3 validation said there
is no title.

When I wrote the site 5 years ago to strict xhtml which was validated at
w3 site it was like this as well for Bobby:
<a id="back"><!-- Today Date --></a>
<script type="text/javascript" src="pages/js/today.js" title="Today
Date">
</script>
<br />
<!-- Date Page was Updated -->
<script type="text/javascript" src="pages/js/update.js" title="Date the
page was last updated">
</script>

Thanks

Jul 20 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a
drum118 <dr*****@hotmail.com> wrote:
What is the current way for stating what a java script TITLE is for
xhtml strict since I must be over looking it?
There is no title attribute for script in any version of HTML or
XHTML. Check the HTML 4.0 spec if you don't believe me.
W3 validation said there is no title.
Correct.
When I wrote the site 5 years ago to strict xhtml which was validated at
w3 site
Yesterday you said 3 years ago.. ;-)

Anyway, no it could not have validated then, this has not changed
since <script> was first introduced in HTML 4.0, back in 1997.
it was like this as well for Bobby:
Bobby doesn't check the validity of the code and hence is irrelevant.
<script type="text/javascript" src="pages/js/today.js" title="Today
Date">
</script>


What do you expect a browser to do with that title? If you told us
that we might be able to tell you the best way to achieve it.

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <st***@pugh.net> <http://steve.pugh.net/>
Jul 20 '05 #2

P: n/a
Steve Pugh wrote:
drum118 <dr*****@hotmail.com> wrote:
What is the current way for stating what a java script TITLE is for
xhtml strict since I must be over looking it?


There is no title attribute for script in any version of HTML or
XHTML. Check the HTML 4.0 spec if you don't believe me.
W3 validation said there is no title.


Correct.
When I wrote the site 5 years ago to strict xhtml which was validated at
w3 site


Yesterday you said 3 years ago.. ;-)

Anyway, no it could not have validated then, this has not changed
since <script> was first introduced in HTML 4.0, back in 1997.
it was like this as well for Bobby:


Bobby doesn't check the validity of the code and hence is irrelevant.
<script type="text/javascript" src="pages/js/today.js" title="Today
Date">
</script>


What do you expect a browser to do with that title? If you told us
that we might be able to tell you the best way to achieve it.

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <st***@pugh.net> <http://steve.pugh.net/>


The site was last up dated 3 years ago and the site was built 7 years ago
with JS been 5 yrs ago.

First one will tell what the current day is. The 2nd one will tell when the
page was last sent to the server. This is on every page.

The person reading the text will understand it.

Like I said, I have not try my hand at web design for 3 years and just
getting back into it. I just cannot find what I have to do for Title and that
is why I am asking the question.

As for my other question, all </p>, <br />, and so on closing brackets are
there. Just ran the page again today and only spits out title="Today Date"
and said nothing about the other JS. So, it have to be the validator that
miss read it the first time.

Thanks
Jul 20 '05 #3

P: n/a
drum118 wrote:
Steve Pugh wrote:
What do you expect a browser to do with that title? If you told us
that we might be able to tell you the best way to achieve it.

Like I said, I have not try my hand at web design for 3 years and just
getting back into it. I just cannot find what I have to do for Title and
that is why I am asking the question.


OK - I'll take a wild leap here. You are using the non-existant title
attribute for <script> becuase you want to provide advisary information
about the data output by the script?

Create a title attribute for the elements the script creates, not for the
script itself.

--
David Dorward <http://dorward.me.uk/>
Jul 20 '05 #4

P: n/a
Steve Pugh wrote:
<script type="text/javascript" src="pages/js/today.js" title="Today
Date">
</script>

What do you expect a browser to do with that title? If you told us
that we might be able to tell you the best way to achieve it.

Steve


Just for fun:

CSS3:
head,script{
display:block;
}
script[title]{
height:100px;
width:30em;
background-color:#000;
color:#fff;
content:attr(title);
}

;-)

(BTW: it is _JavaScript_, not Java, there is a difference between those
two!)
--
Anne van Kesteren
<http://www.annevankesteren.nl/>
Jul 20 '05 #5

P: n/a
drum118 <dr*****@hotmail.com> wrote:
First one will tell what the current day is. The 2nd one will tell when the
page was last sent to the server. This is on every page.
But what will the title attributes do?
The person reading the text will understand it.
Reading what text? Do you expect the person to read the source code to
see the titles?
Like I said, I have not try my hand at web design for 3 years and just
getting back into it. I just cannot find what I have to do for Title and that
is why I am asking the question.
There is no title attribute for the script element. Never was and
probably never will be.

So again I ask what do you want the browser to do with that title
attribute?
As for my other question, all </p>, <br />, and so on closing brackets are
there. Just ran the page again today and only spits out title="Today Date"
and said nothing about the other JS. So, it have to be the validator that
miss read it the first time.


Unlikely. The code you posted did have the errors that the validator
reported. Either the code has changed or you have used the validator's
doctype over ride to validate it as HTML 4.01 or something. Having
code with missing </p> can not be valid XHTML.

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <st***@pugh.net> <http://steve.pugh.net/>
Jul 20 '05 #6

P: n/a
drum118 wrote:
What is the current way for stating what a java script TITLE is for
xhtml strict since I must be over looking it? W3 validation said there
is no title.

When I wrote the site 5 years ago to strict xhtml which was validated at
w3 site it was like this as well for Bobby:
<a id="back"><!-- Today Date --></a>
<script type="text/javascript" src="pages/js/today.js" title="Today
Date">
</script>
<br />
<!-- Date Page was Updated -->
<script type="text/javascript" src="pages/js/update.js" title="Date the
page was last updated">
</script>

Thanks


I figure it out to do what I want to do and it validates.

Change title="Today Date"> to id="Today_Date"> and title="Date the
page was last updated"> to title="Date_the_page_was_last_updated">

Yes I do know the different between Java and Javascript and I should had add
script to the title.

Jul 20 '05 #7

P: n/a
drum118 wrote:
I figure it out to do what I want to do and it validates.

Change title="Today Date"> to id="Today_Date"> and title="Date the
page was last updated"> to title="Date_the_page_was_last_updated">


I you want to add some extra data to element for someone else who is
going to look at you code you could use <!-- comment her --> for example ;-)

--
Anne van Kesteren
<http://www.annevankesteren.nl/>
Jul 20 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.