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

Discussion in 'HTML' started by STILL LEARNING, Feb 7, 2007.

  1. 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
     
    STILL LEARNING, Feb 7, 2007
    #1
    1. Advertising

  2. In article <>,
    "STILL LEARNING" <> wrote:

    > 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.

    --
    DeeDee, don't press that button! DeeDee! NO! Dee...
     
    Michael Vilain, Feb 7, 2007
    #2
    1. Advertising

  3. Hello,

    STILL LEARNING wrote:

    > 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

    --
    Benjamin Niemann
    Email: pink at odahoda dot de
    WWW: http://pink.odahoda.de/
     
    Benjamin Niemann, Feb 7, 2007
    #3
  4. STILL LEARNING

    Randy Webb Guest

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

    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;
    }

    --
    Randy
    Chance Favors The Prepared Mind
    comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
    Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
     
    Randy Webb, Feb 8, 2007
    #4
  5. STILL LEARNING

    dorayme Guest

    In article
    <>,
    "STILL LEARNING" <> wrote:

    > 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?

    --
    dorayme
     
    dorayme, Feb 8, 2007
    #5
  6. On Feb 7, 4:42 pm, dorayme <> wrote:
    > 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
     
    STILL LEARNING, Feb 8, 2007
    #6
  7. STILL LEARNING

    dorayme Guest

    In article
    <>,
    "STILL LEARNING" <> wrote:

    > On Feb 7, 4:42 pm, dorayme <> wrote:
    > > 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)




    <http://members.optushome.com.au/droovies/test/bigAsBigCanBe.html>

    --
    dorayme
     
    dorayme, Feb 8, 2007
    #7
  8. STILL LEARNING

    pcx99 Guest

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

    STILL LEARNING wrote:
    > 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"; }


    --
    http://www.hunlock.com -- Musings in Javascript, CSS.
    $FA
     
    pcx99, Feb 8, 2007
    #8
  9. Re: Need help creating a "Click absolutely ANYWHERE on this page"link for an HTML page with no content

    STILL LEARNING wrote:
    > 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.
     
    Harlan Messinger, Feb 8, 2007
    #9
  10. On Feb 7, 7:15 pm, dorayme <> wrote:
    > <http://members.optushome.com.au/droovies/test/bigAsBigCanBe.html>


    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
     
    STILL LEARNING, Feb 8, 2007
    #10
  11. On Feb 8, 6:15 am, "Kevin" <> wrote:
    > 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
     
    STILL LEARNING, Feb 8, 2007
    #11
  12. On Feb 8, 6:36 am, pcx99 <> wrote:
    >
    > 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
     
    STILL LEARNING, Feb 8, 2007
    #12
  13. 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
     
    STILL LEARNING, Feb 8, 2007
    #13
  14. STILL LEARNING

    John Guest

    "STILL LEARNING" <> wrote in message
    news:...

    > 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.

    --
    John
     
    John, Feb 8, 2007
    #14
  15. STILL LEARNING

    pcx99 Guest

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

    STILL LEARNING wrote:
    > On Feb 8, 6:36 am, pcx99 <> wrote:
    >> 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
    >


    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.



    --
    http://www.hunlock.com -- Musings in Javascript, CSS.
    $FA
     
    pcx99, Feb 8, 2007
    #15
  16. Re: Need help creating a "Click absolutely ANYWHERE on this page"link for an HTML page with no content

    Harlan Messinger wrote:
    > STILL LEARNING wrote:
    >> 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.


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

    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO
    http://www.LittleWorksStudio.com
     
    Jonathan N. Little, Feb 8, 2007
    #16
  17. On Feb 8, 7:47 am, "John" <> wrote:
    >
    > 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
     
    STILL LEARNING, Feb 8, 2007
    #17
  18. Re: Need help creating a "Click absolutely ANYWHERE on this page"link for an HTML page with no content

    On 02/08/2007 12:35 PM, STILL LEARNING wrote:
    > [...] 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.


    --
    Windows Vista and your freedom in conflict:
    http://techdirt.com/articles/20061019/102225.shtml
     
    Mumia W. (NOSPAM), Feb 8, 2007
    #18
  19. Re: Need help creating a "Click absolutely ANYWHERE on this page"link for an HTML page with no content

    STILL LEARNING wrote:
    <snip>
    > 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.


    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO
    http://www.LittleWorksStudio.com
     
    Jonathan N. Little, Feb 8, 2007
    #19
  20. STILL LEARNING

    dorayme Guest

    In article <>,
    Harlan Messinger <> wrote:

    > STILL LEARNING wrote:


    > > 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.

    >
    > 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.]

    --
    dorayme
     
    dorayme, Feb 8, 2007
    #20
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kevin Spencer

    Re: Link Link Link DANGER WILL ROBINSON!!!

    Kevin Spencer, May 17, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    864
    Kevin Spencer
    May 17, 2005
  2. hazz
    Replies:
    6
    Views:
    49,637
    SkyUCHC
    Jun 9, 2010
  3. johnjohn
    Replies:
    0
    Views:
    510
    johnjohn
    Sep 6, 2006
  4. Shailesh Patel
    Replies:
    2
    Views:
    814
    Steve C. Orr [MVP, MCSD]
    Nov 15, 2006
  5. Dave L
    Replies:
    3
    Views:
    3,252
    Göran Andersson
    Mar 4, 2010
Loading...

Share This Page