1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

How to open a external link in a target frame page within website

Discussion in 'HTML & Website Design' started by rajuginne, Dec 11, 2014.

  1. #1
    I want to open all external links in my website using iframe but i unable to do that.

    i am able to do display google search results in a custom page.

    Also tried w3schools http://www.w3schools.com/html/html_iframe.asp

    tried this
    <iframesrc="demo_iframe.htm"name="iframe_a"></iframe>
    <p><ahref="http://www.w3schools.com"target="iframe_a">W3Schools.com</a></p>

    but frame loading within the page as a iframe. but i want to open to in a new page.

    i saw this on http://www.weblogtemplates.net/p/preview.html?url=http://newspaper-blogger-template.blogspot.com/

    it's blogger page what i have to paste on http://www.weblogtemplates.net/p/preview.htm page
    in my website. i found some javascript on that source page. can anyone explain it.


    Also want to know about opening external links in popup window as iframe
    http://engineershub.in/newhome/all-jntu-hyd-results-2013/?ea3de000
    or
    http://engineershub.in/newhome/all-jntu-hyd-results-2013/
     
    Last edited: Dec 11, 2014
    rajuginne, Dec 11, 2014 IP
  2. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,998
    Best Answers:
    253
    Trophy Points:
    515
    #2
    1) this is 2014, why are you using frames?

    2) this is 2014, why are you using frames?

    Now I realize that this is in fact only one thing, but it's such a colossal thing that I felt the need to restate it.

    Though IF you want to use the bleeding edge of 1997 web development practices, change your TARGET attribute from pointing at the frame to pointing at "_blank", that will open a new window. If you want it to open in the parent window instead of a new one, you use target="_parent" to target the immediate parent, or target="_top" for the top-most document.

    NOT that you should be dicking around with ANY of that in the first place since again, welcome to garbage that was deprecated sixteen years ago FOR A REASON. that reason being iframes are an accessibility train wreck.

    Sixteen Joe-blasted years and people are STILL dicking around with frames... *SIGH*
     
    deathshadow, Dec 12, 2014 IP
    kk5st likes this.
  3. T-Law

    T-Law Well-Known Member

    Messages:
    45
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    128
    #3
    Awesome answer @deathshadow, educating people takes time and effort but this how our industry evolves. Thanks for great explanation and most important solution.
     
    T-Law, Dec 17, 2014 IP
  4. jamjar919

    jamjar919 Well-Known Member

    Messages:
    332
    Likes Received:
    7
    Best Answers:
    5
    Trophy Points:
    180
    #4
    The <iframe> tag is not deprecated. You're thinking of <frameset>. There are still valid reasons to use iframes, the most common being for advertisements and loading hidden content (Tracking code and the like...). They also help with encapsulation and allow secure or remote content to be managed more effectively. Not that I'm suggesting iframes are meant to be a core component of layout and site functionality, but there are reasons to use them.

    However, OP's reason is not a valid reason to use an iframe. Why do you want to open google search results in an iframe? What is the benefit to the user? You also didn't explain your problem very well, from what I understand you want links clicked within the iframe to open in the topmost layer. You could probably find someone to write you a script that would read the current URL of the frame once it changed and redirect the page, but at this point anyone would really begin to question why you need to do this.
     
    jamjar919, Jan 2, 2015 IP
    ketting00 likes this.
  5. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,998
    Best Answers:
    253
    Trophy Points:
    515
    #5
    No, I'm thinking IFRAME which was deprecated 17 years ago in HTML 4 STRICT. Just like TARGET, just like CENTER, FONT and on many tags attributes like ALIGN. TECHNICALLY we're SUPPOSED to be using OBJECT instead, and probably would be if Microshaft hadn't spent a decade with their thumb up their ass about doing things like letting us turn off borders on OBJECT, not using that stupid CLASSID property, etc, etc...

    Hell, originally the next version of HTML was supposed to even get rid of IMG as being redundant to OBJECT; that's why EMBED was never officially a tag -- but of course the mouth-breathing idiotic halfwits at WhatThe***WG had to undo that entire direction of HTML and all the progress of the past decade and a half, and instead re-introduce all new pointless redundancies by saying "Go ahead, sleaze it out any old way" -- See AUDIO, VIDEO, CANVAS, and all the other tags that are redundant to OBJECT and do nothing but promote vendor lock-in.

    In any case, see why <b>IFRAME is NOT in the STRICT DTD</b>. It is most certainly valid in tranny -- but again transitional means "In transition from 1997 to 1998 coding practices". The LAUGH is that it didn't exist in 3.2, so basically it was deprecated (in STRICT) the exact same time it was introduced (in Loose/Transitional). W3C logic in action. As a browser specific property it existed before HTML 4 existed, and we were NOT supposed to use it on new websites any time after the introduction of HTML 4. (see STRICT) -- It's actually funny, there are a number of tags that didn't exist prior to HTML 4 tranny, that are in 4 tranny but not 4 STRICT. IFRAME is one of those, and it wasn't in STRICT for a REASON.

    Was going to link to the DTD, but this stupid malfing forum's URL validation complains about the links taking too long!

    Which of course is just part of why HTML 5 is little more than "the new transitional" and promotes nothing more than the bleeding edge of 1997 coding practices since it says go ahead and crap together outdated practices any old way. Now instead of slapping 4 tranny on their outdated, outmoded accessibility train wrecks, developers can keep their craniums wedged up 1997's rectum and slap 5 lip-service around it for zero improvement in methodology whatsoever.
     
    Last edited: Jan 3, 2015
    deathshadow, Jan 3, 2015 IP