Home  >  Article  >  Web Front-end  >  How to embed partial content of a web page_html/css_WEB-ITnose

How to embed partial content of a web page_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 12:21:041984browse

Iframe embedded in the web page

For example, I only want to embed this part of the forum

. I want the IFrame to be able to set it according to the coordinates, width, and height. How good would it be? Is there any way to achieve this function?

Reply to discussion (solution)

Is there any way to achieve this function?

Take a shower and go to sleep. . .

div should do the trick

If it is a page on your own website, then design the page to be included according to your requirements.
If it is for pages on other websites, it is complicated.
You can see how other websites implement this function. Generally, they include special pages provided by the target website or return result information from its WebService and write it into a DIV (or they automatically generate echo content in the form of JS) ).

jquery load can do it, for example:

Embed div2 of aaa.html in div1
$("#div1").load("aaa.html #div2" )

jquery load can do it, for example:

Embed div2 of aaa.html in div1
$("#div1").load("aaa.html #div2 ")
This is somewhat similar, except that it cannot be loaded when I want to quote other websites. Thank you very much, but this can only be used on the site.

Is there any way to achieve this function?

Take a shower and go to sleep. . . A little fantasy, a little extravagance.

If it’s a page on your own website, then design that page to include based on your requirements.
If it is for pages on other websites, it is complicated.
You can see how other websites implement this function. Generally, they include special pages provided by the target website or return result information from its WebService and write it into a DIV (or they automatically generate echo content in the form of JS) ).
Thank you very much, I will study it slowly.

1. Those who say loading external URLs directly can wake up. Do you know there is a same-origin policy?
2. Those who say that they participate in obtaining html through server code and then select it through jquery selector, you can also wake up and take a look at what the original poster said "can be set according to coordinates, width, and height"

1. Those who say loading external URLs directly can wake up. Do you know there is a same-origin policy?
2. Those who say that they participate in obtaining html through server code and then select it through jquery selector, you can also wake up and take a look at what the original poster said "can be set according to coordinates, width, and height"
jQuery It is possible to directly load the

of another page within the site, but it is only within the site. What I said about "setting according to coordinates, width, and height" is a function that I personally think it should have, but I haven't found a way to do it, and maybe it doesn't exist. After all, IFrame can embed web pages, so it is theoretically possible to embed only part of it, but it is unknown whether anyone will implement it.

Give up. . .

Unless there is webkit or a browser engine on the server, it is unlikely to be displayed by coordinates

Then I want to ask, are the coordinates calculated according to the 1920x1080 screen or the mobile phone screen?

jquery load can do it, for example:

Embed div2 of aaa.html in div1
$("#div1").load("aaa.html #div2" )
It should be like the one on the 4th floor. If you didn’t make it yourself, it would be difficult to get it into your own website!
It’s not impossible, come on, I believe in you!

Unless there is webkit or a browser engine on the server, it is unlikely to be displayed by coordinates

Then I want to ask, are the coordinates calculated according to the 1920x1080 screen or the mobile phone screen?
Yes, if it is not based on the relative layout, the obtained results will not be consistent. After all, the screens are different.


jquery load can do it, for example:

Embed div2 of aaa.html in div1
$("#div1").load("aaa.html #div2")
It should be like the one on the 4th floor. If you didn’t make it yourself, it’s hard to get it on your own website!
It’s not impossible, come on, I believe in you!
Yes, it’s always difficult.

Posted, no solution

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn