REQ: Tickertape technique

M

mark4asp

The following tickertape technique is done by incorporating an single
line iframe into the window and writing to the iframe from the server.

http://www.mandatewire.com/

However HTML 4.01 and XHTML strict standards don't allow iframes so
the page fails W3C validation.

How can I get this same effect by other means?

I've been told that it can be done with javascript by constantly
expanding the width of a div to the right. However that method
doesn't actually write characters to the screen one-by-one - to
exactly emulate a tickertape (in the traditional meaning of the term)
- so it isn't going to look as 'nice'.

It is essential that the line appears to be written character-by-
character and therefore looks like proper 'tickertape'.

PS 1: I'm not asking for javascript 'scripts' here; and unless you've
used a script to do exactly this job please don't bother to recommend
a 'script'.

PS 2: I've tried substituting an object for the iframe but IE6 doesn't
fully understand objects. So I gave up trying. However I'm still
potentially interested in that approach (if it can be made to work).

This page has to be compatible with both W3C standards (strict HTML
4.01 or XHTML 1.0) and IE6!
 
M

Mick Walker

mark4asp said:
The following tickertape technique is done by incorporating an single
line iframe into the window and writing to the iframe from the server.

http://www.mandatewire.com/

However HTML 4.01 and XHTML strict standards don't allow iframes so
the page fails W3C validation.

How can I get this same effect by other means?

I've been told that it can be done with javascript by constantly
expanding the width of a div to the right. However that method
doesn't actually write characters to the screen one-by-one - to
exactly emulate a tickertape (in the traditional meaning of the term)
- so it isn't going to look as 'nice'.

It is essential that the line appears to be written character-by-
character and therefore looks like proper 'tickertape'.

PS 1: I'm not asking for javascript 'scripts' here; and unless you've
used a script to do exactly this job please don't bother to recommend
a 'script'.

PS 2: I've tried substituting an object for the iframe but IE6 doesn't
fully understand objects. So I gave up trying. However I'm still
potentially interested in that approach (if it can be made to work).

This page has to be compatible with both W3C standards (strict HTML
4.01 or XHTML 1.0) and IE6!
I can not get the website to work, so I can't actually look at your example.
 
S

Stevo

mark4asp said:
The following tickertape technique is done by incorporating an single
line iframe into the window and writing to the iframe from the server.
http://www.mandatewire.com/
However HTML 4.01 and XHTML strict standards don't allow iframes so
the page fails W3C validation.

Stop trying to validate it? It's not the law.
How can I get this same effect by other means?

I'd just have an array of strings and write them into a div one by one.
The strings can be written in one character at a time using setInterval
or setTimeout.
 
K

Kevin Spencer

There's no need for an iFrame. Just put the "headlines" into an array of
strings in the page via server-side code. The write each string into a div
one character at a time, using the JavaScript setInterval method to time the
calling of the function that writes the next character. Example:

var position = 0; // Headline char position
var index = 0; // index of headlines array

// Headlines to write
var headlines = new Array("First headline", "Second headline", "Third
headline");

// function to write headlines to div with id "headlineDiv"
function writeHeadline()
{
// write substring of headline to div's innerHtml
document.getElementById("headlineDiv").innerHtml =
headlines[index].substr(0, ++position)

// if end of headline, select next headline and re-initialize position
if (position == headlines[index].length - 1)
{
position = 0;

// ensures that headlines are looped through repeatedly
index = (index + 1 == headlines.length ? 0 : index + 1);
}
}

// Call writeHeadline every 250 milliseconds
setInterval("writeHeadline()", 250);

--
HTH,

Kevin Spencer
Microsoft MVP

DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net
 
S

Steve Robinson

mark4asp said:
The following tickertape technique is done by incorporating an single
line iframe into the window and writing to the iframe from the server.

http://www.mandatewire.com/

Tickertape effect isn't such a great idea in my opinion. It's annoying and
inaccessible.

You'll be using <marquee> and <blink> next...

Steve.
 
M

Mark Rae [MVP]

Tickertape effect isn't such a great idea in my opinion. It's annoying and
inaccessible.
Agreed.

You'll be using <marquee> and <blink> next...

LOL!
 
B

Ben Bacarisse

mark4asp said:
The following tickertape technique is done by incorporating an single
line iframe into the window and writing to the iframe from the server.

http://www.mandatewire.com/

However HTML 4.01 and XHTML strict standards don't allow iframes so
the page fails W3C validation.

How can I get this same effect by other means?

You'd have to say more. From what you posted the technique does not
seem to require an iframe, so I don't see what the problem is. You
could do exactly what you do now, but with the JS from the tickertape
page in the main page.
I've been told that it can be done with javascript by constantly
expanding the width of a div to the right. However that method
doesn't actually write characters to the screen one-by-one - to
exactly emulate a tickertape (in the traditional meaning of the term)
- so it isn't going to look as 'nice'.

You can do it with the JS you are doing it with now! You don't need
to change the technique.

I am not JS expert, so maybe I am missing something, because I just
can't see the problem. I take it that you know all the reasons why
client-side scripts should not be used for anything but optional
decoration?
 
A

Andy Dingley

However HTML 4.01 and XHTML strict standards don't allow iframes so
the page fails W3C validation.

It only fails validation for Strict. So if you want to use "legacy"
markup like <iframe>, then use the Transitional DTD instead. That's
what it's there for. It's no "worse" than Strict.

If you have a fear of <font> (fair enough), then you'll now have to
use additional checks to make sure none of those have crept in. Not a
big problem.
 
A

Adam Malcontenti-Wilson

It only fails validation for Strict. So if you want to use "legacy"
markup like <iframe>, then use the Transitional DTD instead. That's
what it's there for. It's no "worse" than Strict.

If you have a fear of <font> (fair enough), then you'll now have to
use additional checks to make sure none of those have crept in. Not a
big problem.

try the "object" tag instead of iframe. it's supposed to be the xhtml
equivalent (i think).
 
T

Thomas 'PointedEars' Lahn

Adam said:
try the "object" tag instead of iframe. it's supposed to be the xhtml
equivalent (i think).

No, it is supposed to replace the `iframe' element since HTML 4.01 already:

http://www.w3.org/TR/html401/present/frames.html#h-16.5
http://www.w3.org/TR/html401/struct/objects.html
http://www.w3.org/TR/html401/sgml/dtd.html (search for "ELEMENT OBJECT")

Please stop crossposting (without Followup-To) to groups irrelevant to the
topic discussed.


F'up2 comp.infosystems.www.authoring.html

PointedEars
 
A

Andy Dingley

try the "object" tag instead of iframe.

<object data="...foo..." ></object>
works as a replacement for
<iframe src="...foo..." ></iframe>
that can also validate under Strict.

What does the team think (particularly those who've done cross-browser
testing of it) as a technique for refactoring away from <iframe>?
I've got a metric shedload of these things to deal with, and it would
be nice to get to Strict more quickly by using a simple dumb
conversion.

Is CSS rendering (mainly positioning) of <object> consistent with that
for <iframe> ?

It's mainly for IE6 (stupid contractual closed-world webapp reasons),
but I need to look at IE7 and then doing it properly and open-platform.
 
J

Jukka K. Korpela

Scripsit Andy Dingley:
<object data="...foo..." ></object>
works as a replacement for
<iframe src="...foo..." ></iframe>
that can also validate under Strict.

For some values of "works". Why would you replace iframe markup, given the
fact that there is no browser that supports object but not iframe? Moreover,
using iframe, you can use the target="..." attribute in a link to indicate
that it be opened inside a particular inline frame; using object, you would
need to do such things via JavaScript.
What does the team think (particularly those who've done cross-browser
testing of it) as a technique for refactoring away from <iframe>?

"Refactoring" seems to be the modern word for pointless tuning of code, a
phenomenon roughly as old as computers. "There is always someone who
rewrites working code, to clean it up or to speed it up."
I've got a metric shedload of these things to deal with, and it would
be nice to get to Strict more quickly by using a simple dumb
conversion.

And getting to Strict would give you... let me guess... money? power?
chicks?

Followups trimmed to ciwah.
 
M

mark4asp

Tickertape effect isn't such a great idea in my opinion. It's annoying and
inaccessible.

You'll be using <marquee> and <blink> next...

Steve.

TIckertape is relevant here because this site delivers news to people
working in finance.
I agree with you that it's not something I or anyone else should
normally do. It was
already there and I don't get to make design decisions - the client
does - which is
absolutely correct from my POV.
 
M

mark4asp

<object data="...foo..." ></object>
works as a replacement for
<iframe src="...foo..." ></iframe>
that can also validate under Strict.

What does the team think (particularly those who've done cross-browser
testing of it) as a technique for refactoring away from <iframe>?
I've got a metric shedload of these things to deal with, and it would
be nice to get to Strict more quickly by using a simple dumb
conversion.

Is CSS rendering (mainly positioning) of <object> consistent with that
for <iframe> ?

It's mainly for IE6 (stupid contractual closed-world webapp reasons),
but I need to look at IE7 and then doing it properly and open-platform.

I had an impossible time getting object to display as I wanted it to
with IE6 so I wasn't able to replace the iframe in that way. There's
the classid fudge you can try:

<http://www.aplus.co.yu/web-dev/insert-html-page-into-another-html-
page/>
<http://www.456bereastreet.com/archive/200612/
dump_iframes_and_use_object_elements_instead/>
<http://intranation.com/test-cases/object-vs-iframe/>

I never got that far as that as I learnt about it at about the same
time that the javascript fix got posted here. I will be using that
javascript in future in place of the dreaded iframe.

Thanks again to whoever posted it, but that post seems to have
vanished from google groups - with my reply! - I gues I just can't see
them here.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,276
Latest member
Sawatmakal

Latest Threads

Top