Loading Specific Elements Cross Domain

落爺英雄遲暮 提交于 2019-12-11 04:36:09

问题


I am trying to design a web page (PHP) that extracts certain elements loaded up by and external website and displays it in my own format on my website. I have seen many things regarding this, but they all seem to work with a the Same Site Origin Policy only.

Another issue is that the first element loaded is a text input that needs to be submitted in order to load up what I'm ultimately trying to retrieve, so how can I got about putting this in my page aswell?


Example of layout:

Notice that Page 1 is basically a search. It requires input in order to retrieve the 2nd page.


Now a few of the methods that I've looked into:

  • jQuery.load

The problem with this is that the website files being loaded need to be local. From my understanding, jQuery doesn't support cross domain due to security reasons. And also I'm unsure of how I would go about inputting the required info to load page 2.

  • Ajax Method From Ways to circumvent the same-origin policy

This method seems promising but the problem here is that I need access to the external website files, and in my case that can't happen. Also unsure of how to implement a POST and GET in order to load page 2.

来源:https://stackoverflow.com/questions/49212121/loading-specific-elements-cross-domain

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!