Alternating text

J

John

Hi:

I'm pretty new at this, and not even sure this is the correct group to post this
question. If not, please direct me to the correct group. Thanks!

Is there a way whereby I can have two "groups" of text in my "index.htm" page,
which would show alternately as a person accesses that page?

For example, a person accessing the page would see (in a specific location on
the page)

"Hi: This is your site for finding out all there's to know about milking a cow
by hand".

The next person accessing the same page would see in that identical spot:

"Hi: This is the site to find the answer to questions you have always wanted to
ask, but were afraid to".

Obviously, the above examples are pure fiction, but hopefully will illustrate
what I mean.

Thanks for any help and suggestions!

John <><

A wise monkey is a monkey who doesn't monkey
with an other monkey's monkey.
 
J

Jukka K. Korpela

John said:
Is there a way whereby I can have two "groups" of text in my
"index.htm" page, which would show alternately as a person accesses
that page?

No. You can't even know whether your visitor is a person, still less
whether he, she, or it is the same as some other visitor.
Obviously, the above examples are pure fiction, but hopefully will
illustrate what I mean.

They illustrate that there is no point in the alternating text idea.

There might be some idea in showing a page as different on the first visit,
perhaps, but it can't be done. So forget it, and move forward.
 
W

WD10

Hi:

I'm pretty new at this, and not even sure this is the correct group to post this
question. If not, please direct me to the correct group. Thanks!

Is there a way whereby I can have two "groups" of text in my "index.htm" page,
which would show alternately as a person accesses that page?

For example, a person accessing the page would see (in a specific location on
the page)

"Hi: This is your site for finding out all there's to know about milking a cow
by hand".

The next person accessing the same page would see in that identical spot:

"Hi: This is the site to find the answer to questions you have always wanted to
ask, but were afraid to".


You can't do it with HTML, but you can do it with something like PHP.
What exactly do you want it to do? Alternate text between only two groups
of text or randomize text? Alternate between visitors or between page
views? It isn't hard to do if you have something like PHP on
your server...
 
N

Neredbojias

With neither quill nor qualm said:
Hi:

I'm pretty new at this, and not even sure this is the correct group to post this
question. If not, please direct me to the correct group. Thanks!

Is there a way whereby I can have two "groups" of text in my "index.htm" page,
which would show alternately as a person accesses that page?

For example, a person accessing the page would see (in a specific location on
the page)

"Hi: This is your site for finding out all there's to know about milking a cow
by hand".

The next person accessing the same page would see in that identical spot:

"Hi: This is the site to find the answer to questions you have always wanted to
ask, but were afraid to".

Obviously, the above examples are pure fiction, but hopefully will illustrate
what I mean.

You could do it with javascript, but if the visitor has javascript
turned off...
 
J

Jukka K. Korpela

Neredbojias said:
You could do it with javascript, but if the visitor has javascript
turned off...

Even with JavaScript enabled, it would not work. There is no way in
JavaScript to recognize the user as the same person or other being that
earlier visited the page. Even if you could do that, and you cannot,
you could not know whether he, she, or it visited the page between the two
visits.

If you have password protected pages that require a user id and password,
and if you record all visits, and if you have reliably identified the
people to whom you give an id, and if nobody ever lets anyone else use his
or her id, then you recognize users and visits, and send alternating
content. Of course, the recognition and other logic would need to reside on
the server.

The conditions will not be fulfilled in the sublunar world, however.
Especially the part "nobody ever lets anyone else..." fails.
 
N

Neredbojias

With neither quill nor qualm, Jukka K. Korpela quothed:
Even with JavaScript enabled, it would not work. There is no way in
JavaScript to recognize the user as the same person or other being that
earlier visited the page. Even if you could do that, and you cannot,
you could not know whether he, she, or it visited the page between the two
visits.

Yes, that is all true, but the OP did not explicitly state that the
"next person" had to be a different person. Using the "session-
variable" strategy of attaching a search string to the url and relying
on the history of the back button to recognize it (which, of course, it
does,) the tactic is, to a degree, possible.
If you have password protected pages that require a user id and password,
and if you record all visits, and if you have reliably identified the
people to whom you give an id, and if nobody ever lets anyone else use his
or her id, then you recognize users and visits, and send alternating
content. Of course, the recognition and other logic would need to reside on
the server.

-And such would (possibly) be a 100% reliable solution whereas
javascript is never 100% reliable simply because of user-interaction.
The conditions will not be fulfilled in the sublunar world, however.
Especially the part "nobody ever lets anyone else..." fails.

Html itself is not ideally "faultless", and css, in my humble opinion,
is based on a very flawed model, but nevertheless, those are the tools
with which we have to work,
 
J

Jukka K. Korpela

Neredbojias said:
- - the OP did not explicitly state that the
"next person" had to be a different person.

Reading the original question again, I notice that the OP _first_ told he
wants the page show "alternately as a person accesses that page", then
something completely different, namely that the page should alternate _by
person_.

Either way, the answer is still "no".
Using the "session-
variable" strategy of attaching a search string to the url and relying
on the history of the back button to recognize it (which, of course, it
does,) the tactic is, to a degree, possible.

No it isn't. If persons A and B successively access the page on their
browsers, or if person A successively accesses the page on two browsers,
there will be no session variables. So this fails for either interpretation
of the "problem".
Html itself is not ideally "faultless", and css, in my humble opinion,
is based on a very flawed model, but nevertheless, those are the tools
with which we have to work,

The defects of HTML and CSS have nothing to do with this. Neither of them
was meant to address wishes like this, and there isn't even anything you
could try in HTML or CSS to solve the, er, "problem".

(As usual, the real problem behind the non-problem is probably more
interesting than has been told so far.)
 
T

TheWebJunkie

If I interpret the problem correctly, John wants fifty percent of the
web pages he serves to contain *one* text, and the *other* fifty percent
to contain a *different* text. He is not concerned about *who* receives
*which* version, or whether or not the same person receives the same
version twice consecutively.

This is not an html or a client issue. The situation must be dealt with
server-side. Every time the page is requested, a database is consulted.
If it indicates an odd number, version "A" is served. If it indicates
an even number, version "B" is served. Then, for each serving, an
addition is made to the database.
 
B

Blinky the Shark

If I interpret the problem correctly, John wants fifty percent of the
web pages he serves to contain *one* text, and the *other* fifty percent
to contain a *different* text. He is not concerned about *who* receives
*which* version, or whether or not the same person receives the same
version twice consecutively.

Please learn to quote. Please learn to attribute. Please learn to use
a real news client.
 
N

Neredbojias

With neither quill nor qualm, Jukka K. Korpela quothed:
Reading the original question again, I notice that the OP _first_ told he
wants the page show "alternately as a person accesses that page", then
something completely different, namely that the page should alternate _by
person_.

Either way, the answer is still "no".


No it isn't. If persons A and B successively access the page on their
browsers, or if person A successively accesses the page on two browsers,
there will be no session variables. So this fails for either interpretation
of the "problem".

Yes, true, very true. What I would do is make a large list of messages,
say greetings in different languages, and use the random function or
possibly the date() function to select one when the page loads. The
larger the list, the less likely the same message would appear in
succession. Of course, this is not *guaranteed* the way it could be
during one session and there is a possibility a visitor would see the
same message again in a repeat albeit discrete visit.

However, as an extreme example, one could use cookies in the manner that
some bank sites employ them. If the visitor has cookies (or javascript)
disabled, he is denied access to the main part of the site and the
waiting message unless and until he activates them in his browser.
Otherwise, voila! - a new message every time (-based, of course, upon a
representation within the cookie of the previous message.)

So it *is* possible.
The defects of HTML and CSS have nothing to do with this. Neither of them
was meant to address wishes like this, and there isn't even anything you
could try in HTML or CSS to solve the, er, "problem".

No, not specifically with this which seems to beg for a script solution.
But then the css "hover" was a big (and not unpleasant) surprise when I
first encountered it. So if "hover," why not "alternate?" -Okay, it's
a stretch, but perhaps the dividing line between active and non-active
presentation is not so sharp as it once was.
(As usual, the real problem behind the non-problem is probably more
interesting than has been told so far.)

In trying to find what I hope won't be a "non-solution", I often sense
myself attempting to extrapolate what it is that the poster is really
wishing to do. If more details were proffered, better solutions could
certainly be devised.
 
J

Jukka K. Korpela

Neredbojias said:
What I would do is make a large list of
messages, say greetings in different languages, and use the random
function or possibly the date() function to select one when the page
loads.

That might be an interesting experiment, but it has really nothing to do
with the original question, which was about "alternating text" in a
particular sense (or a couple of sense, but neither of them involved
random, or pseudorandom).
So it *is* possible.

For some values of "it"; not for the request in the original question.
 
N

Neredbojias

With neither quill nor qualm said:
Hi:

I'm pretty new at this, and not even sure this is the correct group to post this
question. If not, please direct me to the correct group. Thanks!

Is there a way whereby I can have two "groups" of text in my "index.htm" page,
which would show alternately as a person accesses that page?

For example, a person accessing the page would see (in a specific location on
the page)

"Hi: This is your site for finding out all there's to know about milking a cow
by hand".

Oh, that's udder nonsense!
 
S

Stewart Gordon

Jukka said:
Even with JavaScript enabled, it would not work. There is no way in
JavaScript to recognize the user as the same person or other being that
earlier visited the page. Even if you could do that, and you cannot,
you could not know whether he, she, or it visited the page between the two
visits.
<snip>

Not even with the aid of cookies? Still, it doesn't solve the OP's
request....

Stewart.

--
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCS/M d- s:- C++@ a->--- UB@ P+ L E@ W++@ N+++ o K-@ w++@ O? M V? PS-
PE- Y? PGP- t- 5? X? R b DI? D G e++>++++ h-- r-- !y
------END GEEK CODE BLOCK------

My e-mail is valid but not my primary mailbox. Please keep replies on
the 'group where everyone may benefit.
 

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,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top