Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


JS Load Remote Content
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

JS Load Remote Content

Hi,


I'm looking at loading full page remote content with js but have not been able to get it to fill an entire page. This code <---- $("#siteloader").html('<object data="myurl.com">'); ----> gets all remote content, it however comes as a small section and does not fill the whole page. Is it because of parsing?

PS ~ is the above clear or confusing? :D

Comments

  • ATHKATHK Member

    So object is a bit like an iFrame in the sense it doesn't know what height is. You could give it a height of the viewport using height:100vh it's not compatible with older IE you can use http://caniuse.com to see compatability.

  • century1stopcentury1stop Member
    edited May 2016

    yea, that's right w/o use of iFrames. will check it out, thanks

    @ATHK said:
    So object is a bit like an iFrame in the sense it doesn't know what height is. You could give it a height of the viewport using height:100vh it's not compatible with older IE you can use http://caniuse.com to see compatability.

    EDIT: adding height & width to the viewport didn't work for remote content :(

  • @ATHK looks like your suggestion works after all, added height and width to the code and it expanded full page :)
    one minor issue tho, there seem to be a slight margin (maybe 5px 5px 5px 5px) between "body" and "remote_content" , margin:0 doesn't work. any idea?

  • noamannoaman Member

    @century1stop said:
    @ATHK looks like your suggestion works after all, added height and width to the code and it expanded full page :)
    one minor issue tho, there seem to be a slight margin (maybe 5px 5px 5px 5px) between "body" and "remote_content" , margin:0 doesn't work. any idea?

    When loading iframe you have to consider this

    Iframe tag then HTML tag inside and then body tag inside..

    If still could not find it...then right click on the slight margin and inspect element...it would help you debug...:-)

    Thanked by 1century1stop
  • thanks but the initial code is so that "iframe-less". however, I just found using iframe is much better, expands full page nicely w/o issue :)

    @noaman said:

  • update: silly me, margin works, I just forget to append position being absolute. both js and iframe work :)

Sign In or Register to comment.