• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Adding html tags to script

 
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have the following code that creates the <title> on any given page.



Because we have to follow a new Acessibility and Usibility standards, we utilize software the reads text for the blind. In order to divide the page into sections, header level tags are used - H1, H2, H3 - for navigation.

I have tried several ways to get this into the document title with no success - not as text for display but as a snippet of html. So, if you viewed the source, it would read "<h1>TEST - ...</h1>. Any help will be greatly appreciated.
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What in the world is this actually doing? Why are you not using the normal title tags?

<title>Your title</title>

What do you get by setting the title with JavaScript. I am missing something here.

Eric
 
K Robert
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is part of a utility function that sets the <title> for all the pages. Much of the reasoning behind this app design was based on use for handicapped and non-handicapped people. This involves a lengthy "Preference" page that allows the user to utilize the built in access modes. In any, this is an app that I inherited because I have to make it compliant with Accessibility Laws. Is it possible to do what I've asked?
 
Marshal
Posts: 67446
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not really sure what you are asking...

You're trying to put HTML in the title tag? Odd. How would this aid in accessibility?
 
K Robert
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The html would not be part of the title as it is displayed in the browser. Right now, as you can see, the <title> is generated with javascript. Based on the requirements sent to us by the Accessibility committee, the page needs to be divided with "heading" tags. I believe the software uses them for navigation.

Since this snippet of code is what generates the page title, can we add the <h1> there?
 
Bear Bibeault
Marshal
Posts: 67446
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry, still clear as mud. What does the <title> tag have to do with the <h1> and other header tags?
 
Eric Pascarello
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What they are saying is your page needs to be set up such as


That has nothing to do with a title. The title is plain text that does nothing for the user. If you put html in it, it will not do a thing other then look like <h1>sometext</h1> That would do nothing for a screen reader.

Think you need to do some investigation into: http://www.section508.gov/

Eric
 
K Robert
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If this can't be done, it can't be done. I was just asking. But, as to the reasoning behind this, the users and the A&U staff wanted to know if we could use the <title> as a source of information for the screen reader to utilize, so they can navigate between apps or screens.
 
Bear Bibeault
Marshal
Posts: 67446
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by K Robert:
If this can't be done, it can't be done.



We're still in the process of trying to figure out what "it" is.

But, as to the reasoning behind this, the users and the A&U staff wanted to know if we could use the <title> as a source of information



Why the title tag? And what kind of information? The title tag contains a simple string that is used to determine the caption to show on the browser window.
 
K Robert
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Okay - here goes the lengthy version and I am sorry for not posting this at first... Basically, this code snippet(app level *.js):



, grabs this(page level html)



to create the page title. So, basically, the page title and header are created from "id=PageTitle".

In order to facilitate a function in the screen reader, which creates a list box of all <h1>, <h2>, and <h3> tags for navigation; each area needs a heading tag.

Because the page title and heading are created from the "id=PageTitle", we can't wrap the "Blah Blah Blah" title in a heading tag because it will display in the page title as "<h1>Blah Blah Blah</h1>". So, we need away to tag the html w/out it displaying in the title.

As I look back at my previous posts, I think I was misrepresenting my question. Sorry!
 
We don't have time for this. We've gotta save the moon! Or check this out:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic