Need help creating a "Click absolutely ANYWHERE on this page" link for an HTML page with no content

S

STILL LEARNING

I'm not sure if this can even be done, but what prompts the question
is my desire to be able to create an "Uber Link" script/code of some
sort, such that even if the html page contains nothing but a
background image -or- a background color -- in other words, the page
has neither content nor placed images -- any click, ANYWHERE, will
launch the URL in your browser.

I realize I can make traditional text links and graphics links; what
I'm looking for is to be paroled from these . . . and making the
entire page, whether empty or not, one big CLICK.

Thanks.

SL
 
M

Michael Vilain

"STILL LEARNING said:
I'm not sure if this can even be done, but what prompts the question
is my desire to be able to create an "Uber Link" script/code of some
sort, such that even if the html page contains nothing but a
background image -or- a background color -- in other words, the page
has neither content nor placed images -- any click, ANYWHERE, will
launch the URL in your browser.

I realize I can make traditional text links and graphics links; what
I'm looking for is to be paroled from these . . . and making the
entire page, whether empty or not, one big CLICK.

Thanks.

SL

Don't think you can do this. A link must be associated with an object.
Usually that's text. If you did something like this, it would *NOT* go
over well with most visitors to your site.

Rethink your approach. This one isn't going to fly and if it did,
people won't like it.
 
B

Benjamin Niemann

Hello,

STILL said:
I'm not sure if this can even be done, but what prompts the question
is my desire to be able to create an "Uber Link" script/code of some
sort, such that even if the html page contains nothing but a
background image -or- a background color -- in other words, the page
has neither content nor placed images -- any click, ANYWHERE, will
launch the URL in your browser.

I realize I can make traditional text links and graphics links; what
I'm looking for is to be paroled from these . . . and making the
entire page, whether empty or not, one big CLICK.

Can't image a good usecase for this, but feel free to enlighten me...

You could place a link (preferably with meaningful text for users
non-graphic browsers, i.e. where the user does not "click" or there is
not "entire page") on the page.

<a id="biglink" href="..">Let strange things happen</a>

Then apply the following CSS

#biglink {
display: block;
width: 100%;
height: 100%;
text-indent: -2000px; /* to move the text out of the visible area */
}

you'll also need

html, body {
height: 100%; /* or the height property above will not work */
margin: 0; /* to avoid scrollbars */
padding: 0;
}

HTH
 
R

Randy Webb

STILL LEARNING said the following on 2/7/2007 5:40 PM:

[Followup-To set to comp.lang.javascript]
I'm not sure if this can even be done, but what prompts the question
is my desire to be able to create an "Uber Link" script/code of some
sort, such that even if the html page contains nothing but a
background image -or- a background color -- in other words, the page
has neither content nor placed images -- any click, ANYWHERE, will
launch the URL in your browser.

I realize I can make traditional text links and graphics links; what
I'm looking for is to be paroled from these . . . and making the
entire page, whether empty or not, one big CLICK.


<body onclick="goThere('someURL')">

function goThere(URL){
alert('This is going to be really ANNOYING');
document.location.href = URL;
}
 
D

dorayme

"STILL LEARNING said:
I realize I can make traditional text links and graphics links; what
I'm looking for is to be paroled from these . . . and making the
entire page, whether empty or not, one big CLICK.

What does paroled mean here? You can make a clear gif and set the
width and height of it in the css to 100% and it can be a link.
Is this parolling?
 
S

STILL LEARNING

You can make a clear gif and set the width and height of it in the
css to 100% and it can be a link.

Using which Tags? (sorry, I don't do much CSS and I don't understand
how this is different from simply creating a graphic that links)

SL
 
P

pcx99

STILL said:
I'm not sure if this can even be done, but what prompts the question
is my desire to be able to create an "Uber Link" script/code of some
sort, such that even if the html page contains nothing but a
background image -or- a background color -- in other words, the page
has neither content nor placed images -- any click, ANYWHERE, will
launch the URL in your browser.

I realize I can make traditional text links and graphics links; what
I'm looking for is to be paroled from these . . . and making the
entire page, whether empty or not, one big CLICK.

Thanks.

SL

document.onclick=function () {
document.location.href="http://someurl.com"; }
 
H

Harlan Messinger

STILL said:
I'm not sure if this can even be done, but what prompts the question
is my desire to be able to create an "Uber Link" script/code of some
sort, such that even if the html page contains nothing but a
background image -or- a background color -- in other words, the page
has neither content nor placed images -- any click, ANYWHERE, will
launch the URL in your browser.

I realize I can make traditional text links and graphics links; what
I'm looking for is to be paroled from these . . . and making the
entire page, whether empty or not, one big CLICK.

By being "paroled" from text and graphics links, your must be intent on
moving to the next step: guesswork and psychic phenomena. The percentage
of your users who will figure out that they're supposed to click on an
empty area of the page to proceed to the place you want them to go will
be vastly smaller than the percentage who will be completely perplexed,
figure your page is broken or that there *is* nothing else on your site,
and will leave.
 
S

STILL LEARNING


dorayme (and anyone else reading this thread) this is precisely the
effect I was looking for. I have another question about the
"clear.gif" that we're using in this example:

I want to be able to specify which of my directories this little image
will be in, as opposed to being dependent on "the image is relative to
the location" option -- in other words, I want to be free to assign a
different directory at my discretion. Right now, the anchor reads
simply

<a href="somewhere.html"><img id="bigAsBigCanBe" src="clear.gif"
alt="nothing much at all"></a>

so if I wanted to specify a particular directory, could I do so
modifying just this one line? or would I have to add additional
line(s) referencing clear.gif's directory location? Example (and
please note I've modified the alt text language ;) . . .

<a href="somewhere.html"><img id="bigAsBigCanBe" src="http://
www.MYHOMEPAGE/ONEofmyDIRECTORIES/ThisSpecificSub-Directory/clear.gif"
alt="Click Absolutely ANYWHERE On This Page To Visit My Homepage!"></
a>

Thanks again dorayme (I just figured out your nickname hee hee,
cute ;)

SL'in
 
S

STILL LEARNING

Sample solution: (tested on firefox/linux, should work on other
browsers)

Kevin, thank you for this solution, very nice. The only drawback I
can see here is if someone (inadvertently or deliberately, go figure)
turned OFF their Java, this wouldn't work. I think you can agree,
it's best to keep this solution as cross-browser + HTML _durable_ (and
simple) as we can make it.

Otherwise, a very nice solution.

SL'in
 
S

STILL LEARNING

document.onclick=function () {
document.location.href="http://someurl.com"; }

pcx99, forgive my ignorance but . . . what is this? Javascript? It's
quite elegant and I like it, but I'm not sure where it would go or if
it might be fussy (eg cross-browser compatible).

Very elegant, and this is easily the best solution -- both for
simplicity and size -- but only if it is not fussy. Could you
elaborate a bit? Does this go BEFORE the </HEAD> -or- AFTER the
<BODY> tag? Thank you pcx99. :)

SL'in
 
S

STILL LEARNING

Oh and, I forgot to add . . . this solution has got to work with
frames in IEx. I remember years ago when I designed a custom page
counter I had a devil of a time with Explorer's frames.

SL'in
 
J

John

Kevin, thank you for this solution, very nice. The only drawback I
can see here is if someone (inadvertently or deliberately, go figure)
turned OFF their Java, this wouldn't work. I think you can agree,
it's best to keep this solution as cross-browser + HTML _durable_ (and
simple) as we can make it.

Otherwise, a very nice solution.

So if you don't want a JavaScript solution, why did you post to
c.a.javascript?

And BTW, Java is not the same as JavaScript, despite the shared letters.
 
P

pcx99

STILL said:
pcx99, forgive my ignorance but . . . what is this? Javascript? It's
quite elegant and I like it, but I'm not sure where it would go or if
it might be fussy (eg cross-browser compatible).

Very elegant, and this is easily the best solution -- both for
simplicity and size -- but only if it is not fussy. Could you
elaborate a bit? Does this go BEFORE the </HEAD> -or- AFTER the
<BODY> tag? Thank you pcx99. :)

SL'in

Yes this is javascript. It can go anywhere on your page. Here's the
full text you'll need to insert.

<script type="text/javascript">
document.onclick=function ()
{document.location.href="http://someurl.com";}
</script>

This will over-ride any other links you would have on the page. If the
user clicks anywhere, regardless of where or what he or she clicks it
will call this script (unless the user has javascript disabled, in which
case nothing would happen).

Sorry for not being clearer in the original post. I had not noticed it
was cross-linked.
 
J

Jonathan N. Little

Harlan said:
By being "paroled" from text and graphics links, your must be intent on
moving to the next step: guesswork and psychic phenomena. The percentage
of your users who will figure out that they're supposed to click on an
empty area of the page to proceed to the place you want them to go will
be vastly smaller than the percentage who will be completely perplexed,
figure your page is broken or that there *is* nothing else on your site,
and will leave.

Agree! Most folks don;t like playing "...and behind door number 3..."
with links. Sounds like an awful idea.
 
S

STILL LEARNING

So if you don't want a JavaScript solution, why did you post to
c.a.javascript?

And BTW, Java is not the same as JavaScript, despite the shared letters.

Well, to be perfectly frank I find the level of creativity in this
forum quite robust. As the length of this thread indicates, there is
more than one way to approach this objective (although I confess I
didn't fully think through the cross-browser + "friendly" issues
before first diving in). In any event, I think I can be forgiven
acknowledging the native creativity of the Javascript forum. Anything
you might lose to conspiratorial impulses you more than make up for in
knowledge ha ha.

Folks, no one is trying to hack (anyone, anywhere) with this request.
This is about emailing my 96-year old grandmother a (stock) graphic
that says "I've got new pictures Nana, click ANYWHERE in this window
and it will send you to the latest installment." She's not exactly
steady with a mouse, so this is a (somewhat) forgiving method of
giving her a wwwwwiiiiidddddeeeee berth to click.

And to answer the question burning in everyone's mind ("Why don't you
just make the graphic a link in the first place???"), I'm having
trouble getting it to send properly through my email client (or she's
got trouble on her end? damned if I know) because the graphic keeps
showing up on her end as an ATTACHMENT that she would have to open
separately.

So (sorry, this is kind of long lol) I tested another way to send this
"CLICK ANYWHERE" graphic -- as a >>BACKGROUND image -- and it sent
through my (old, I confess) email program just fine . . . but there's
just one little problem: I don't have any method through my email
program to control the purpose of that background image -- namely, to
make the entire thing One Big Click. It just sits there, you see.

Then we attempt "dorayme's" solution (it works a charm btw Do, a very
nice thing to have learned, thank you!) and . . . oh hell, here we go
again! :( The "clear.gif" is sent as an >>ATTACHMENT. Again, I'm
sorry this is such a soap opera but . . . well, don't read it if it's
too lengthy. I don't blame you; I'm ready to toss the whole project
lol.

Finally, if some of you are about to strongly recommend that I get a
new email program, I hear you. Unfortunately I just love the one I'm
using (it's "Calypso" not that anyone has ever heard it lol). This
being the one and only reason I would have need to change to a
different email program, I just have to weigh if it is that important
to me. I even tried dropping the html into Netscape and sending it to
myself to see if it would work, but I run into the same problem:
These email programs obviously alter (any) HTML in the course of
formatting something for email.

It's interesting because I've never realized this before, but . . . I
gather there IS no way to "Send" (email) an HTML page -- I mean, the
page itself, not a link referring to the page (or at least, I don't
know of any way to do it).

SL'in
 
G

Guest

[...] I even tried dropping the html into Netscape and sending it to
myself to see if it would work, but I run into the same problem:
These email programs obviously alter (any) HTML in the course of
formatting something for email.

It's interesting because I've never realized this before, but . . . I
gather there IS no way to "Send" (email) an HTML page -- I mean, the
page itself, not a link referring to the page (or at least, I don't
know of any way to do it).

SL'in

(Followups set to comp.infosystems.www.authoring.html)

Can you put the image on the web and create an IMG element that uses
that image? E.g.

<IMG src="http://my.homepages.example.com/~SLin/image.jpg" alt="Click
anywhere">

You would only send the HTML text in the e-mail, but the image would
reside on your website.
 
J

Jonathan N. Little

STILL LEARNING wrote:
Folks, no one is trying to hack (anyone, anywhere) with this request.
This is about emailing my 96-year old grandmother a (stock) graphic
that says "I've got new pictures Nana, click ANYWHERE in this window
and it will send you to the latest installment." She's not exactly
steady with a mouse, so this is a (somewhat) forgiving method of
giving her a wwwwwiiiiidddddeeeee berth to click.

And to answer the question burning in everyone's mind ("Why don't you
just make the graphic a link in the first place???"), I'm having
trouble getting it to send properly through my email client (or she's
got trouble on her end? damned if I know) because the graphic keeps
showing up on her end as an ATTACHMENT that she would have to open
separately.

Whoa, right there! don't try to do this in an email. Put pics online,
even a free-server and send dear old Nana a link to the online source.
Aside of the security issues that may be blocking your effort here email
must encode your binary image data to transmit so images on any size
balloon in size...use a webserver and send via http.
 
D

dorayme

Harlan Messinger said:
STILL LEARNING wrote:

The percentage
of your users who will figure out that they're supposed to click on an
empty area of the page to proceed to the place you want them to go will
be vastly smaller than the percentage who will be completely perplexed,
figure your page is broken or that there *is* nothing else on your site,
and will leave.


Maybe that is what is wanted by OP and you cannot know what his
or her intent or purpose is. Maybe it is only the minority you
imagine that is wanted by the OP to "go through" to wherever.

[btw, wanna a little side bet, Harlan, on the percentage? I
figure if people see a hand icon with finger pointing, more will
click than you might wager on and I will clean up. You can give
me odds if you still don't believe it.]
 

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,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top