SitePoint Sponsor

User Tag List

Page 1 of 2 12 LastLast
Results 1 to 25 of 27
  1. #1
    SitePoint Evangelist Barnum's Avatar
    Join Date
    Oct 2008
    Posts
    418
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Another Stupid Question

    I have a link on my site that takes one to a manufacturer's website, but once there the back arrow does not bring you back to my page. How do I insure that happens?

    What I have is:

    <center><a href="http://www.whitesdetectors.com"><img src="images/Trade.jpg" border="0" height="100" width="200" align="center"></a></center>

  2. #2
    Avid Logophile silver trophy
    ParkinT's Avatar
    Join Date
    May 2006
    Location
    Central Florida
    Posts
    2,343
    Mentioned
    192 Post(s)
    Tagged
    4 Thread(s)
    You can use the 'target' attribute in your anchor tag. Like this:
    Code:
    <a href="http://www.whitesdetectors.com" target="_parent"><img src="images/Trade.jpg" border="0" height="100" width="200" align="center"></a>
    Don't be yourself. Be someone a little nicer. -Mignon McLaughlin, journalist and author (1913-1983)


    Git is for EVERYONE
    Literally, the best app for readers.
    Make Your P@ssw0rd Secure
    Leveraging SubDomains

  3. #3
    SitePoint Guru bronze trophy TheRaptor's Avatar
    Join Date
    Jul 2011
    Location
    New York
    Posts
    710
    Mentioned
    40 Post(s)
    Tagged
    0 Thread(s)
    I would actually do this:

    Code HTML4Strict:
    <center><a href="http://www.whitesdetectors.com" target="_blank"><img src="images/Trade.jpg" border="0" height="100" width="200" align="center"></a></center>
    That target="_blank" in there will make the link open in a seperate window so your site will stay open, thus keeping visitors at your site.
    TheRaptor - Joe

  4. #4
    Avid Logophile silver trophy
    ParkinT's Avatar
    Join Date
    May 2006
    Location
    Central Florida
    Posts
    2,343
    Mentioned
    192 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by TheRaptor View Post
    That target="_blank" in there will make the link open in a seperate window so your site will stay open, thus keeping visitors at your site.

    But then there is no "Back" button. And I know that naive users are very confused by the lack of a BACK button.

    Of course, it is really a matter of preference which value to use in the 'target' attribute.
    You could always get "really fancy" and display the Manufacturer's site in a FRAME with a "RETURN" message at the top - outside the frame. But that would be so 80's!
    Don't be yourself. Be someone a little nicer. -Mignon McLaughlin, journalist and author (1913-1983)


    Git is for EVERYONE
    Literally, the best app for readers.
    Make Your P@ssw0rd Secure
    Leveraging SubDomains

  5. #5
    Life is not a malfunction gold trophysilver trophybronze trophy
    TechnoBear's Avatar
    Join Date
    Jun 2011
    Location
    Argyll, Scotland
    Posts
    6,408
    Mentioned
    273 Post(s)
    Tagged
    5 Thread(s)
    Quote Originally Posted by ParkinT View Post
    But then there is no "Back" button. And I know that naive users are very confused by the lack of a BACK button.
    Not just naive users. You need to remember accessibility issues, too. W3C recommendations:

    10.1 Until user agents allow users to turn off spawned windows, do not cause pop-ups or other windows to appear and do not change the current window without informing the user. [Priority 2]
    For example, in HTML, avoid using a frame whose target is a new window.

  6. #6
    SitePoint Evangelist Barnum's Avatar
    Join Date
    Oct 2008
    Posts
    418
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    I am sorry I see nothing different when I do this....? Guess I don't understand.

  7. #7
    SitePoint Evangelist Barnum's Avatar
    Join Date
    Oct 2008
    Posts
    418
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Okay, why does the top one work but the bottom doesn't?

    <center>
    <a href="http://whiteselectronics.com/vx3.html"><img src="images/vx3.gif" alt="Introducing The Spectra VX3!" width="700" height="117"/></a>
    </center>




    <center><a href="http://www.whitesdetectors.com" target="_blank"><img src="images/Trade.jpg" border="0" height="100" width="200" align="center"></a></center>

  8. #8
    billycundiff{float:left;} silver trophybronze trophy RyanReese's Avatar
    Join Date
    Oct 2008
    Location
    Whiteford, Maryland, United States
    Posts
    13,746
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    Well in the second one you have target=" blank". There is a space before blank, and it should read "_blank", not " blank" .
    Always looking for web design/development work.
    http://www.CodeFundamentals.com

  9. #9
    SitePoint Evangelist Barnum's Avatar
    Join Date
    Oct 2008
    Posts
    418
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Sorry can't see that?

  10. #10
    billycundiff{float:left;} silver trophybronze trophy RyanReese's Avatar
    Join Date
    Oct 2008
    Location
    Whiteford, Maryland, United States
    Posts
    13,746
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Barnum View Post
    Sorry can't see that?
    I'm relaly sorry, due to a forum upgrade, some characters are cut off in posts, though I'm guessing your browser doesn't have that happen. It wasn't until I highlighted the section I was talking about, and copy pasted into my own Notepad document, I was able to see the _. Sorry.

    I was just jumping in to help on that since I thought it was something simple like that. I'll leave this to the gurus .
    Always looking for web design/development work.
    http://www.CodeFundamentals.com

  11. #11
    SitePoint Evangelist Barnum's Avatar
    Join Date
    Oct 2008
    Posts
    418
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Never any need to apologize to this old fart. You guys have helped time after time, and can not thank you enough. I appreciate you even taking the time to respond. I did eventurally figure out my problem. Thank you all again for being so great.

  12. #12
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,319
    Mentioned
    462 Post(s)
    Tagged
    8 Thread(s)
    Glad you sorted it, Barnum! Of the two examples you had above, the first is better (in terms of accessibility etc.) because when someone clicks that link, the new page opens in the same window. People can then click the back button if they want to return to your site.

    In the example that includes target="_blank", your page stays as is, but a new browser window opens on top of it displaying the destination page. In this case, the back button does nothing, and that can confuse people. To get back to your site, they have to close the current web page to see your site again. That's why use of target="_blank" is discouraged now.

  13. #13
    <title class="lol"> bronze trophy TehYoyo's Avatar
    Join Date
    Feb 2012
    Location
    Northeast Chicago Suburbs
    Posts
    806
    Mentioned
    18 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by ralph.m View Post
    Glad you sorted it, Barnum! Of the two examples you had above, the first is better (in terms of accessibility etc.) because when someone clicks that link, the new page opens in the same window. People can then click the back button if they want to return to your site.

    In the example that includes target="_blank", your page stays as is, but a new browser window opens on top of it displaying the destination page. In this case, the back button does nothing, and that can confuse people. To get back to your site, they have to close the current web page to see your site again. That's why use of target="_blank" is discouraged now.
    And old teacher once told me to use target="_blank" if I wanted people to stay on my site and not to navigate away - that might be a reason to use it.

    ~TehYoyo

  14. #14
    Life is not a malfunction gold trophysilver trophybronze trophy
    TechnoBear's Avatar
    Join Date
    Jun 2011
    Location
    Argyll, Scotland
    Posts
    6,408
    Mentioned
    273 Post(s)
    Tagged
    5 Thread(s)
    Quote Originally Posted by TehYoyo View Post
    And old teacher once told me to use target="_blank" if I wanted people to stay on my site and not to navigate away - that might be a reason to use it.
    That's thinking about you, not your visitors. Read posts 4, 5 and 12 for why not to use it.

  15. #15
    <title class="lol"> bronze trophy TehYoyo's Avatar
    Join Date
    Feb 2012
    Location
    Northeast Chicago Suburbs
    Posts
    806
    Mentioned
    18 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by TechnoBear View Post
    That's thinking about you, not your visitors. Read posts 4, 5 and 12 for why not to use it.
    Oh, no. I got the accessibility thing. Was just noting why one might consider using it.

    ~TehYoyo

  16. #16
    Life is not a malfunction gold trophysilver trophybronze trophy
    TechnoBear's Avatar
    Join Date
    Jun 2011
    Location
    Argyll, Scotland
    Posts
    6,408
    Mentioned
    273 Post(s)
    Tagged
    5 Thread(s)
    Quote Originally Posted by TehYoyo View Post
    And old teacher once told me to use target="_blank" if I wanted people to stay on my site and not to navigate away - that might be a reason to use it.
    Quote Originally Posted by TehYoyo View Post
    Oh, no. I got the accessibility thing. Was just noting why one might consider using it.
    But you still haven't grasped the issues. Suppose a designer doesn't care two hoots for accessibility and uses target="_blank" because he or she "wanted people to stay on my site and not to navigate away". (How arrogant.) Somebody clicks the link, which takes them away from that site by opening a new window. Suppose they do want to return to the site - there's no back button, so the designer's just made it harder for them to return and shot himself in the foot. (And also risked alienating visitors who dislike having to close multiple windows they didn't ask for in the first place.)

  17. #17
    <title class="lol"> bronze trophy TehYoyo's Avatar
    Join Date
    Feb 2012
    Location
    Northeast Chicago Suburbs
    Posts
    806
    Mentioned
    18 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by TechnoBear View Post
    But you still haven't grasped the issues. Suppose a designer doesn't care two hoots for accessibility and uses target="_blank" because he or she "wanted people to stay on my site and not to navigate away". (How arrogant.) Somebody clicks the link, which takes them away from that site by opening a new window. Suppose they do want to return to the site - there's no back button, so the designer's just made it harder for them to return and shot himself in the foot. (And also risked alienating visitors who dislike having to close multiple windows they didn't ask for in the first place.)
    I don't know how to say that I get that point w/out repeating myself. I do get the accessibility/annoyance issue.

    ~TehYoyo

  18. #18
    Life is not a malfunction gold trophysilver trophybronze trophy
    TechnoBear's Avatar
    Join Date
    Jun 2011
    Location
    Argyll, Scotland
    Posts
    6,408
    Mentioned
    273 Post(s)
    Tagged
    5 Thread(s)
    Quote Originally Posted by TehYoyo View Post
    I don't know how to say that I get that point w/out repeating myself. I do get the accessibility/annoyance issue.
    OK - sorry. In that case I just don't understand why you'd mention it in the first place if you understand why it's a bad idea.

  19. #19
    <title class="lol"> bronze trophy TehYoyo's Avatar
    Join Date
    Feb 2012
    Location
    Northeast Chicago Suburbs
    Posts
    806
    Mentioned
    18 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by TechnoBear View Post
    OK - sorry. In that case I just don't understand why you'd mention it in the first place if you understand why it's a bad idea.
    It was just theoretical. I don't think I said I'd recommend it...is that how you saw it?

    ~TehYoyo

  20. #20
    billycundiff{float:left;} silver trophybronze trophy RyanReese's Avatar
    Join Date
    Oct 2008
    Location
    Whiteford, Maryland, United States
    Posts
    13,746
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by TehYoyo View Post
    It was just theoretical. I don't think I said I'd recommend it...is that how you saw it?

    ~TehYoyo
    It's how I saw it (as well). No point mentioning stuff that isn't really usable.
    Always looking for web design/development work.
    http://www.CodeFundamentals.com

  21. #21
    Life is not a malfunction gold trophysilver trophybronze trophy
    TechnoBear's Avatar
    Join Date
    Jun 2011
    Location
    Argyll, Scotland
    Posts
    6,408
    Mentioned
    273 Post(s)
    Tagged
    5 Thread(s)
    Quote Originally Posted by TehYoyo View Post
    It was just theoretical. I don't think I said I'd recommend it...is that how you saw it?
    Well the phrase "that might be a reason to use it" does rather suggest that you're advocating using it, yes.

    The technique - and reasons against - had already been covered in the thread, so raising it again also suggested you were advocating its use.

    As Ryan says, best not to confuse matters.

  22. #22
    <title class="lol"> bronze trophy TehYoyo's Avatar
    Join Date
    Feb 2012
    Location
    Northeast Chicago Suburbs
    Posts
    806
    Mentioned
    18 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by TechnoBear View Post
    Well the phrase "that might be a reason to use it" does rather suggest that you're advocating using it, yes.

    The technique - and reasons against - had already been covered in the thread, so raising it again also suggested you were advocating its use.

    As Ryan says, best not to confuse matters.
    Point taken, I suppose.

    ~TehYoyo

  23. #23
    SitePoint Wizard bronze trophy
    Join Date
    Jul 2006
    Location
    Augusta, Georgia, United States
    Posts
    4,192
    Mentioned
    17 Post(s)
    Tagged
    4 Thread(s)
    I don't tend to use the target attribute considering it is deprecated in HTML4 but I will apply a class like "popup" to links and handle them with JavaScript opening the URL in a new window. People tend to request that type of functionality when linking to an external site. I think it can be useful considering most average users do not know nor wan to be bothered with manually creating a new window. Of course it should be done in moderation like anything. To much of it will probably annoy people.

    @Barnum

    I think in your case opening up the third party site(s) in a different window is perfectly acceptable. Using the target attribute wouldn't be my first choice but if you using a doctype that supports it than it is much easier than the method I use when dealing with HTML4. I don't see it hurting anything.

  24. #24
    Life is not a malfunction gold trophysilver trophybronze trophy
    TechnoBear's Avatar
    Join Date
    Jun 2011
    Location
    Argyll, Scotland
    Posts
    6,408
    Mentioned
    273 Post(s)
    Tagged
    5 Thread(s)
    My understanding of Barnum's OP is that he wanted to ensure the back button does work, so opening a link in a new window is the opposite of what he wants. Either way, he has solved his problem, which was, after all, the main purpose of the thread.

  25. #25
    Non-Member bronze trophy
    Join Date
    Nov 2009
    Location
    Keene, NH
    Posts
    3,760
    Mentioned
    23 Post(s)
    Tagged
    0 Thread(s)
    Mein gott.... PEOPLE... You're kidding me...

    First, the OP has outdated markup circa the late '90s... ok, not a big deal... but then the first thing people suggest is the deprecated TARGET attribute which has no business being used on websites in the first place, AND as technobear pointed out does the exact opposite of what the OP is asking for?!?

    People are DUMBER for having read this thread so far.

    @Barnum

    There is nothing in your code that would prevent a user from having a back button after visiting that link. If something IS blocking the back button, I would suspect it's the page being targeted and nothing you are doing... though we'd have to see the actual page in question to say for sure. Without seeing the complete code of your site it's hard to weigh in properly. Local testing here I can find nothing in at "whites metal detectors" that would cause the problem either.

    That said, CENTER, ALIGN, BORDER and a good number of the other elements in your tiny little code snippet have no business being on websites written after sometime around 2001, when we kicked Netscape 4 to the curb the way people are kicking IE6 to the curb now. This indicates old/outdated code that may mean it's time to pitch your site and start over.

    Particularly if oddball problems are cropping up like the one you describe... may not be the actual problem, they are just indicators of deeper rooted issues with your site.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •