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

    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?
    SEMrush
     
    haliloo22, Jan 5, 2016 IP
    SEMrush
  2. ThePHPMaster

    ThePHPMaster Well-Known Member

    Messages:
    722
    Likes Received:
    50
    Best Answers:
    31
    Trophy Points:
    150
    #2
    Are page1 and page2 on the same domain level?
     
    ThePHPMaster, Jan 7, 2016 IP
  3. haliloo22

    haliloo22 Member

    Messages:
    42
    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:
    722
    Likes Received:
    50
    Best Answers:
    31
    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:
    218
    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:
    8,325
    Likes Received:
    1,480
    Best Answers:
    220
    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:
    134
    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 Member

    Messages:
    74
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    43
    #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