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 can i embed an external page without an iframe?

Discussion in 'Programming' started by haliloo22, Jan 5, 2016.

  1. #1
    hello, i have a page2.html, i have 1 button of 300x250 in this html page
    SEMrush
    now i want to show this page in a iframe into my other sites, therefore i can use the next code:

    <iframe src="http:// mywebsiteurl/page 2. html" name="iframe985426" width="300px" height="250px" scrolling="auto" frameborder="1" align="center"></iframe>

    but is it possible to show this page2.html without a iframe code into my other sites?

    a code where i dont need to put width and height. the code must only show the content of page2.html?
     
    haliloo22, Jan 5, 2016 IP
    SEMrush
  2. ThePHPMaster

    ThePHPMaster Well-Known Member

    Messages:
    737
    Likes Received:
    52
    Best Answers:
    33
    Trophy Points:
    150
    #2
    Are page1 and page2 on the same domain level?
     
    ThePHPMaster, Jan 7, 2016 IP
    scu8a likes this.
  3. haliloo22

    haliloo22 Member

    Messages:
    46
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #3
    Hello,

    thnx for ur reply. no they are on different domains

    any help?
     
    haliloo22, Jan 7, 2016 IP
  4. hostingv

    hostingv Active Member

    Messages:
    24
    Likes Received:
    1
    Best Answers:
    1
    Trophy Points:
    58
    #4
    Hello,

    You could it by using Jquery.

    <script>$("#test1").load("http:// mywebsiteurl/page 2. html");</script>
    <div id="test1"></div>

    I think, this code will work.
     
    hostingv, Jan 8, 2016 IP
  5. ThePHPMaster

    ThePHPMaster Well-Known Member

    Messages:
    737
    Likes Received:
    52
    Best Answers:
    33
    Trophy Points:
    150
    #5
    Do you have access to all domains (are you the same owner for both domains and able to get server changes on both)?
     
    ThePHPMaster, Jan 8, 2016 IP
  6. Tahity

    Tahity Well-Known Member

    Messages:
    216
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    115
    #6
    you cant use that because of CORS. you can either load it on the backed via a request and dump it in your page, or you can try with jsonp
     
    Tahity, Jan 10, 2016 IP
  7. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,178
    Likes Received:
    1,728
    Best Answers:
    239
    Trophy Points:
    515
    #7
    Uhm, if ALL it is would be an IMG tag, why aren't you just using an IMG tag?

    Well, unless you want to rotate the image, but even then I'd be just having a script that pulls a AJAX request of the relevant information (image url, alt text, and you probably have a href for an anchor around it?) and plug it in that way on the DOM.
     
    deathshadow, Jan 10, 2016 IP
  8. helpinghand

    helpinghand Active Member

    Messages:
    135
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    73
    #8
    AJAX looks like the only solution for your problem like deathshadow said. Here is the working example in csstricks site.
    https://css-tricks.com/ajax-load-container-contents/
     
    helpinghand, Jan 14, 2016 IP
  9. ilyasdeckers

    ilyasdeckers Member

    Messages:
    12
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    26
    #9
    You can try to use the object tag.

    example:
    <object width="100%" height="400px" data="URLHERE"></object>

    This does the trick most of the time, however, it is not perfect. I have tried many options before and have learned that including external pages is too much of a hassle in terms of cross-browser compatibility and functionality. And last but not least google hates it.
     
    ilyasdeckers, Jan 19, 2016 IP
  10. bjdea1

    bjdea1 Member

    Messages:
    20
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #10
    Jquery Ajax will not let you retrieve from a different domain (URL). However you could code a CGI script on your server (under your domain) to respond to your Jquery Ajax request. This CGI script would use cURL to retrieve the webpage from the external website, returning the raw HTML to the Jquery /Ajax request. This would however result in hotlinking - the images would be loading from the external site and this may get you blocked by the external site.
     
    bjdea1, Jan 26, 2016 IP
  11. RDarby

    RDarby Active Member

    Messages:
    79
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    68
    Digital Goods:
    1
    #11
    Just worth mentioning... If you are not the site owner, you have to have permission. A lot of webmasters really do not like being framed on other sites and it is often in their terms of use.
     
    RDarby, Jan 26, 2016 IP
  12. scu8a

    scu8a Greenhorn

    Messages:
    81
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    15
    #12
    I've used AJAX for the purpose of avoiding the <iframe> tag. That's proof that it can be done. If you want to grab data across domains, you can grab it on the server side using a simple HTTP client you create yourself. It's not difficult.
     
    scu8a, Dec 21, 2019 IP
  13. scu8a

    scu8a Greenhorn

    Messages:
    81
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    15
    #13
    Ha, AJAX is for little girls.

    If you gather contents as a search engine spider would, and follow the best practices with copyright licensing, this shouldn't be an issue. I know how the cross-site thing works, and I have an easy workaround on several levels.

    Companies know that they can't have it both ways. They often rely greatly on search engine referrals to generate traffic, so naturally, they want their content indexed by search engines. This means that the search engine stores the files of the web page into its private memory, and hence copies them. There are potential copyright issues as a result, but there are things a webmaster can do to control how (well-behaved) HTTP clients index their data and present it to an audience of users. Can you file suit on a search engine for spidering your contents, regardless of best practices used? Yes, technically. Will you be successful in your suit? I don't know. It depends on the context. Not likely IMO.

    What I'm saying is that there is a grey area, especially regarding Internet media we all share so much of. Just by knowing a thing or two about how loopholes always exist in a web site's terms of service, you can get away with grabbing many things. If you're not sure, contact the media's owner and request written permission for license to disseminate their data for a link or often a small royalty fee. Often, vendors are happy to allow you to use it for free.

    Now, I could say if you were taking someone else's content and claiming it as your own, that's an entirely different story.

    That's as in-depth as I can get without knowing any specifics of an organization's digital marketing model.
     
    scu8a, Jan 10, 2020 IP