Inserting a page from one site into another

Asked

Viewed 3,123 times

2

I have a site developed in a CMS and on a certain page of this site, I need to insert another page that was developed without the help of CMS. To be more precise, this page that I am trying to incorporate into my site, is a dynamic price table, which uses the language HTML and Javascript.

Since this my site CMS was all developed with the help of a plugin that works with shortcodes. In this plugin there is a shortcode in which it is possible to add an HTML code.

Knowing this, I researched ways to embed this page (price list) within my CMS site.

The first alternative I found was through iframe, however when trying to access the site page, the browser informs that that page is trying to load scripts from unsafe sources, and ends up "blocking" the frame where the table would be displayed, leaving only a blank space. It is possible to enable the site to load unsafe scripts, however you need to click on a very discrete "shield" that is in the upper right corner of the browser, which is a negative point for site visitors.

The second alternative would be to copy the entire html code from the price table, and insert it into the shortcode in the same way that iframe was inserted. In the attempt to insert the entire code on the page, I realized that when loading the page all the formatting that was in the layout of the site, was disfigured, I believe by some css conflict/ stylesheet.

Therefore, I ask the following questions:

  • It is possible to insert the table by Iframe without the browser blocking the content because of the warning "that the site is trying to load scripts from unsafe sources"?

  • If by Iframe is not possible, how can I do to solve this problem of disfiguring the layout of the site, when the price list is inserted?

I leave here the table page: https://piscinafacil.com.br/tabela2.html

And the page on the CMS site where I’m trying to incorporate the table: https://piscinafacil.com.br/residenciais/

I’d be grateful if someone could shed some light on that problem. :)

  • Link to residential gives error 404

2 answers

1

You can use iframe, or jQuery with Ajax to call this page.

$.ajax({
  url: 'SUA URL'
  success: function(data){//}
});
  • Opa Rafael! Thanks for your attention! I’m sorry for the ignorance on the subject, but I have no experience with jQuery. Since this is a CMS site, I believe you have some limitation to insert jQuery with Ajax. I will be able to insert this jQuery code through an HTML shortcode?

  • Yes, you can do it

  • Just copy that code there? How do I insert it into an html? I’m sorry I’m ignorant, but I have no knowledge of jQuery

  • No problem, just put it inside a script in HTML <script></script> remembering that you have to have jQuery

1

Look, I’m using Chrome 67 and with iframe worked... I opened the second link, for me gave an error 404, but I edited by the code inspector and in place of the error message I entered the iframe without problems, the same way opening directly:

<div class="col-md-12">
  <iframe src="https://piscinafacil.com.br/tabela2.html" width="100%" height="900"></iframe>
</div>

The only problem I had was in the characters ², which for me here appear as ò. Probably javascript is picking up values that are not UTF-8, or if it is a separate javascript, see if it is saved in UTF-8.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.