Re: Solved using AJAX: JavaScript Trouble, dynamic script not running JS for news feeds?

  • From: "Bryan Garaventa" <bgaraventa11@xxxxxxxxxxxxxx>
  • To: <programmingblind@xxxxxxxxxxxxx>
  • Date: Wed, 2 Jul 2008 18:22:20 -0700

Yes, I see what you mean about the skip link, it doesn't work very well in
Firefox either, I'll have to change that.

The news page itself is just a news reader, using AJAX to load the news feeds into
the page without causing a page refresh that would disrupt navigation.

The RSS service is what is being used in the background to fetch the
content, but this is separate from what the functionality of the news page is for, which is simply a place to view the latest news, which is all I really wanted. the dynamic section has a heading so you can jump to it by pressing 2 in JAWS if the
cursor isn't automatically routed to this new content after clicking one of
the topic links. Depending on your connection, it may take a few seconds for
the new content to show up.

The applet is just a lightning effect that looks like the logo is being
struck by lightning. There is a javascript statement below this to route the
focus to the page body as soon as the page loads to make sure that focus
isn't lost or stuck when it runs.

Is anyone else having trouble with the applet capturing focus? I'm having trouble reproducing this.

Thanks,

Bryan

----- Original Message ----- From: "Octavian Rasnita" <orasnita@xxxxxxxxx>
To: <programmingblind@xxxxxxxxxxxxx>
Sent: Wednesday, July 02, 2008 1:19 PM
Subject: Re: Solved using AJAX: JavaScript Trouble, dynamic script not
running JS for news feeds?


I use Internet Explorer 6 and Jaws 6. And Javascript is enabled.

I've seen that the "skip to content" link uses Javascript, and I don't
think it is a good idea. It won't work if Javascript is disabled.

The problem is that in my browser Javascript is enabled, but that link
doesn't work at all.
In order to make it work, I need to click on it then press Insert+Delete
to route the virtual cursor to the PC cursor.

I've seen that page that talks about RSS, but did I understand correctly
that it should be a kind of RSS reader on a web page?

But by the way, why is that Java applet needed for?

Octavian

----- Original Message ----- From: "Bryan Garaventa" <bgaraventa11@xxxxxxxxxxxxxx>
To: <programmingblind@xxxxxxxxxxxxx>
Sent: Wednesday, July 02, 2008 5:38 PM
Subject: Re: Solved using AJAX: JavaScript Trouble, dynamic script not
running JS for news feeds?


Weird, what browser and version are you using?

I understand about the chat app, it has some definite draw backs, but
this is separate from this. The link for the news page is
http://gutterstar.net/news.php
The rss feed links are found within the body within a layout table.

There are some empty header4's at the top of the page which is a left
over from the script that parses the header links. It needs to be fixed
one day. Hitting the number 1 using JAWS will skip all of this though.

Do you have JavaScript enabled? If not, this would explain why the applet
is capturing focus.



----- Original Message ----- From: "Octavian Rasnita" <orasnita@xxxxxxxxx>
To: <programmingblind@xxxxxxxxxxxxx>
Sent: Wednesday, July 02, 2008 1:16 AM
Subject: Re: Solved using AJAX: JavaScript Trouble, dynamic script not
running JS for news feeds?


Hi,

The chat is nice, but I've seen that it doesn't allow using special
chars.
I've wrote my name (Octavian Râsnita) but it appeared some strange chars
instead.

I've also seen that Jaws reads harder the letters I type in the message
field. Does that field uses some onChange events or something like that?

Another problem I've seen is that after I open the page, Jaws doesn't
work right immediately, like when the virtual cursor is not active. This
is because an applet is running on the page. It appears "Applet
DS_Lightning started " in the status bar.
So I need to switch to another app, then back to the site in order to
make Jaws use the virtual cursor and read the page.

Another problem is that when I use the letter "H" to jump to headings,
nothing is spoken, like when the headings are defined, but they don't
contain any text.
I have also used "skip navigation" link, but nothing happend.
The focus remained on that link after pressing it with space or enter.

I always jump over the Google adds, but the adds on this page are very
bad positioned and it is some more hard to jump over them.

I tried to find those RSS things you told us about, but there were too
many things there and I couldn't test the features you described.

Octavian

----- Original Message ----- From: "Bryan Garaventa" <bgaraventa11@xxxxxxxxxxxxxx>
To: <programmingblind@xxxxxxxxxxxxx>
Sent: Wednesday, July 02, 2008 10:26 AM
Subject: Solved using AJAX: JavaScript Trouble, dynamic script not
running JS for news feeds?


In case anyone is interested, thought this info may be useful.

I wanted to create a central news page where I could browse any number
of
topics that was of interest, and not have to be concerned about
overloading
the page or crashing JAWS with huge amounts of links to parse... So I
originally thought that the dynamic script solution would work. It
didn't
though, likely due to an overabundance of background processing by the
RSS
scripts.

AJAX seemed to be the only solution, so I did a bit of digging, and
found
the following site
http://twilightuniverse.com/projects/sack
Which is a simple AJAX kit that includes a bunch of external file
classes
that can be imported into any page.

Well, it works amazingly well. I've made the page screen reader
friendly,
even though it's an AJAX app, making key areas automatically receive
focus
at various times, and added about 38 news feeds covering a wide range of
topics, displaying a maximum of 50 RSS headings per feed. Which would
have
been totally impossible if all of the scripts were imported into the
page
when it first loaded. This probably would have killed any screen reader
as
well trying to parse the page at the same time. Well, the AJAX functions
only load the desired news feed when one of the topic links is
activated,
and the DOM stores this feed for further use, so it doesn't need to
redownload the content if the same topic is reactivated later within the
same page instance.

If you'd like to try it out, the page is at
http://gutterstar.net/news.php

It's amazing what you can accomplish when you don't really know what you
are
doing...

BTW, I also changed the nature of my skip links, it seems that screen
readers work much better when handling the object.focus() method instead
of
the traditional method. Weird...

Well, it was interesting to me anyway...

Bryan

----- Original Message ----- From: "Bryan Garaventa" <bgaraventa11@xxxxxxxxxxxxxx>
To: <programmingblind@xxxxxxxxxxxxx>
Sent: Friday, June 27, 2008 5:20 PM
Subject: JavaScript Trouble, dynamic script not running JS for news
feeds?


Hi, I've been trying to get this thing working for a few days now, but
I
think I'm missing something.

I'm trying to work out a better and more dynamic method for loading the
news feeds at http://gutterstar.net/news.php
All of these news feeds are being loaded using the script at
http://gutterstar.net/rss , which is rendered within a standard <script
type="text/javascript"
src="http://rssScriptGenURLOutput.php?stuffVariables";></script>

My idea is that, if I could dynamically load each RSS feed when a link
is
clicked, the load delay would be much less, and no page refresh would
occur to disrupt navigation.

So I wrote the test page at http://gutterstar.net/news_test.htm Which,
by
all that I've read, should work, except that it doesn't...

I was able to get the code below to work briefly when the page first
loaded, but nothing after that. Now it doesn't even work when the page
loads for some reason. The dynamic aspect just isn't working at all.
I've
saved out the live DOM to see if it's adding the correct script to the
right Div, and everything appears to be updating correctly in the DOM,
but
I can't see anything on the page itself, which is really weird. Anyone
know what I'm doing wrong?

<html>

<head>

<script type="text/javascript">

/*<![CDATA[*/

var n1 =
'http://gutterstar.net/cgi-bin/apps/rss/js.php?RSSFILE=http%3A%2F%2Fwww.cbsnews.com%2Ffeeds%2Frss%2Fmain.rss&crss=11940&MAXITEMS=10&HeaderText=Top+Stories&TitleText=&TableWidth=&TableHeight=&TableAlign=&TextAlign=left&SectionHeaderClr=%236a5acd&SectionHeaderSize=2&SectionHeaderFont=Times+New+Roman&SectionTitleClr=%23228b22&SectionTitleSize=2&SectionTitleFont=Comic+Sans+MS&SectionRowClr=%2300bfff&SectionRowSize=2&SectionRowFont=Verdana&OpenWindow=newsflash&limit=&astr=&ReverseOrder=&license=&ApplyTo=';

var n2 =
'http://gutterstar.net/cgi-bin/apps/rss/js.php?RSSFILE=http%3A%2F%2Fwww.cbsnews.com%2Ffeeds%2Frss%2Fworld.rss&crss=11942&MAXITEMS=10&HeaderText=World+News&TitleText=&TableWidth=&TableHeight=&TableAlign=&TextAlign=left&SectionHeaderClr=%236a5acd&SectionHeaderSize=2&SectionHeaderFont=Times+New+Roman&SectionTitleClr=%23228b22&SectionTitleSize=2&SectionTitleFont=Comic+Sans+MS&SectionRowClr=%2300bfff&SectionRowSize=2&SectionRowFont=Verdana&OpenWindow=newsflash&limit=&astr=&ReverseOrder=&license=&ApplyTo=';

var n3 =
'http://gutterstar.net/cgi-bin/apps/rss/js.php?RSSFILE=http%3A%2F%2Fwww.cbsnews.com%2Ffeeds%2Frss%2Fnational.rss&crss=11943&MAXITEMS=10&HeaderText=U.S.+News&TitleText=&TableWidth=&TableHeight=&TableAlign=&TextAlign=left&SectionHeaderClr=%236a5acd&SectionHeaderSize=2&SectionHeaderFont=Times+New+Roman&SectionTitleClr=%23228b22&SectionTitleSize=2&SectionTitleFont=Comic+Sans+MS&SectionRowClr=%2300bfff&SectionRowSize=2&SectionRowFont=Verdana&OpenWindow=newsflash&limit=&astr=&ReverseOrder=&license=&ApplyTo=';

var n4 =
'http://gutterstar.net/cgi-bin/apps/rss/js.php?RSSFILE=http%3A%2F%2Ffeeds.cbsnews.com%2FCBSNewsUTTM&crss=11944&MAXITEMS=10&HeaderText=Up+To+The+Minute%A0News&TitleText=&TableWidth=&TableHeight=&TableAlign=&TextAlign=left&SectionHeaderClr=%236a5acd&SectionHeaderSize=2&SectionHeaderFont=Times+New+Roman&SectionTitleClr=%23228b22&SectionTitleSize=2&SectionTitleFont=Comic+Sans+MS&SectionRowClr=%2300bfff&SectionRowSize=2&SectionRowFont=Verdana&OpenWindow=newsflash&limit=&astr=&ReverseOrder=&license=&ApplyTo=';

var n5 =
'http://gutterstar.net/cgi-bin/apps/rss/js.php?RSSFILE=http%3A%2F%2Fwww.cbsnews.com%2Ffeeds%2Frss%2Fbusiness.rss&crss=11945&MAXITEMS=10&HeaderText=Business+News&TitleText=&TableWidth=&TableHeight=&TableAlign=&TextAlign=left&SectionHeaderClr=%236a5acd&SectionHeaderSize=2&SectionHeaderFont=Times+New+Roman&SectionTitleClr=%23228b22&SectionTitleSize=2&SectionTitleFont=Comic+Sans+MS&SectionRowClr=%2300bfff&SectionRowSize=2&SectionRowFont=Verdana&OpenWindow=newsflash&limit=&astr=&ReverseOrder=&license=&ApplyTo=';

var n6 =
'http://gutterstar.net/cgi-bin/apps/rss/js.php?RSSFILE=http%3A%2F%2Fwww.cbsnews.com%2Ffeeds%2Frss%2Fscitech.rss&crss=11946&MAXITEMS=10&HeaderText=Sci-Tech%A0News&TitleText=&TableWidth=&TableHeight=&TableAlign=&TextAlign=left&SectionHeaderClr=%236a5acd&SectionHeaderSize=2&SectionHeaderFont=Times+New+Roman&SectionTitleClr=%23228b22&SectionTitleSize=2&SectionTitleFont=Comic+Sans+MS&SectionRowClr=%2300bfff&SectionRowSize=2&SectionRowFont=Verdana&OpenWindow=newsflash&limit=&astr=&ReverseOrder=&license=&ApplyTo=';

var n7 =
'http://gutterstar.net/cgi-bin/apps/rss/js.php?RSSFILE=http%3A%2F%2Fwww.cbsnews.com%2Ffeeds%2Frss%2Fpolitics.rss&crss=11948&MAXITEMS=10&HeaderText=Politics%A0News&TitleText=&TableWidth=&TableHeight=&TableAlign=&TextAlign=left&SectionHeaderClr=%236a5acd&SectionHeaderSize=2&SectionHeaderFont=Times+New+Roman&SectionTitleClr=%23228b22&SectionTitleSize=2&SectionTitleFont=Comic+Sans+MS&SectionRowClr=%2300bfff&SectionRowSize=2&SectionRowFont=Verdana&OpenWindow=newsflash&limit=&astr=&ReverseOrder=&license=&ApplyTo=';

var n8 =
'http://gutterstar.net/cgi-bin/apps/rss/js.php?RSSFILE=http%3A%2F%2Fwww.cbsnews.com%2Ffeeds%2Frss%2F501370.rss&crss=11951&MAXITEMS=10&HeaderText=Strange+News&TitleText=&TableWidth=&TableHeight=&TableAlign=&TextAlign=left&SectionHeaderClr=%236a5acd&SectionHeaderSize=2&SectionHeaderFont=Times+New+Roman&SectionTitleClr=%23228b22&SectionTitleSize=2&SectionTitleFont=Comic+Sans+MS&SectionRowClr=%2300bfff&SectionRowSize=2&SectionRowFont=Verdana&OpenWindow=newsflash&limit=&astr=&ReverseOrder=&license=&ApplyTo=';

function getRSSFeed(url, id) {

var e = document.getElementById(id);

if (e.innerHTML == '') {

var newScript = document.createElement('script');

newScript.type = 'text/javascript';

newScript.src = url;

e.appendChild(newScript);

}

if (e.style.display == 'none') {

e.style.display = 'block';

e.style.visibility = 'visible';

}

}

/*]]>*/

</script>

</head>

<body>

<div>

<a onclick="getRSSFeed(n1, 'n1d');return false;" href="#">Top
Stories</a>|

<a onclick="getRSSFeed(n2, 'n2d');return false;" href="#">World
News</a>|

<a onclick="getRSSFeed(n3, 'n3d');return false;" href="#">U.S.
News</a>|

<a onclick="getRSSFeed(n4, 'n4d');return false;" href="#">Up To The
Minute
News</a>|

<a onclick="getRSSFeed(n5, 'n5d');return false;" href="#">Business
News</a>|

<a onclick="getRSSFeed(n6, 'n6d');return false;" href="#">Sci-Tech
News</a>|

<a onclick="getRSSFeed(n7, 'n7d');return false;" href="#">Politics
News</a>|

<a onclick="getRSSFeed(n8, 'n8d');return false;" href="#">Strange
News</a>

</div>

<div style="display:none;visibility:hidden;" id="n1d"></div>

<div style="display:none;visibility:hidden;" id="n2d"></div>

<div style="display:none;visibility:hidden;" id="n3d"></div>

<div style="display:none;visibility:hidden;" id="n4d"></div>

<div style="display:none;visibility:hidden;" id="n5d"></div>

<div style="display:none;visibility:hidden;" id="n6d"></div>

<div style="display:none;visibility:hidden;" id="n7d"></div>

<div style="display:none;visibility:hidden;" id="n8d"></div>

<script type="text/javascript">

getRSSFeed(n8, 'n8d');

</script>

</body></html>

__________
View the list's information and change your settings at
//www.freelists.org/list/programmingblind


__________
View the list's information and change your settings at
//www.freelists.org/list/programmingblind

__________
View the list's information and change your settings at
//www.freelists.org/list/programmingblind

__________
View the list's information and change your settings at
//www.freelists.org/list/programmingblind


__________
View the list's information and change your settings at
//www.freelists.org/list/programmingblind


__________
View the list's information and change your settings at //www.freelists.org/list/programmingblind

Other related posts: