SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Enthusiast
    Join Date
    Jul 2008
    Location
    India
    Posts
    57
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Linking problem (Was: Redirecting problem)

    Hi
    I am working on a project and i want to redirect that page as follows in a php file:
    <a href="www.google.co.in" target="_blank">Google</a>
    Now my problem is that i am getting an error as "Object not found!" and in address bar i am getting
    http://localhost/loanmod21/www.google.co.in
    what is the problem with this??

  2. #2
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,580
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Since that is not a valid full URL, the browser is interpreting it as a relative URL.

    It should be http://www.google.co.in

    <a href="http://www.google.co.in" target="_blank">Google</a>

  3. #3
    SitePoint Enthusiast
    Join Date
    Jul 2008
    Location
    India
    Posts
    57
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ya its working now

  4. #4
    SitePoint Wizard bronze trophy Black Max's Avatar
    Join Date
    Apr 2007
    Posts
    4,029
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)
    Isn't target="blank" deprecated?

  5. #5
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,580
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Black Max View Post
    Isn't target="blank" deprecated?
    It is deprecated, but supported by every browser, and there is no equivalent in HTML4+. The next best thing is a JavaScript onclick handler that opens a new window.

  6. #6
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,159
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Black Max View Post
    Isn't target="blank" deprecated?
    The target attribute is deprecated, regardless of value. That's because it's mean to be used with frames, which are also deprecated. (And it should be target="_blank", with a leading underscore. Otherwise you're targeting a frame named blank.)

    Quote Originally Posted by Dan Grossman View Post
    It is deprecated, but supported by every browser, and there is no equivalent in HTML4+.
    It is included in HTML 4.01 Transitional and XHTML 1.0 Transitional, which are the DTDs you should use if you, for some reason, need to keep using frames. Of course, those DTDs are also deprecated.

    Quote Originally Posted by Dan Grossman View Post
    The next best thing is a JavaScript onclick handler that opens a new window.
    It's not the next best thing, it's the best thing. Opening windows is behaviour and belongs in the interaction layer, i.e., JavaScript.
    Birnam wood is come to Dunsinane

  7. #7
    SitePoint Wizard bronze trophy Black Max's Avatar
    Join Date
    Apr 2007
    Posts
    4,029
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by AutisticCuckoo View Post
    Otherwise you're targeting a frame named blank.)
    I know, I know, I was either lazy or, well, lazy.

    Quote Originally Posted by AutisticCuckoo View Post
    It's not the next best thing, it's the best thing. Opening windows is behaviour and belongs in the interaction layer, i.e., JavaScript.
    Agreed. I'm just waiting for the time when 0.05% of the populace turns off JavaScript and we can stop creating alternative code for them.... (Cranky tonight, aren't I?)


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
  •