从网站中删除框架的解决方案

发布于 2024-07-15 05:47:09 字数 388 浏览 6 评论 0原文

目前我正在与一个有框架集的预订网站合作。

比方说,40% 来自它自己的网站,因此可以轻松更改为无框架网站。

然而,实际的预订流程来自另一个网站(也由我们维护),并且意味着它自己“存在”,以便第三方网站也可以购买/使用预订流程。

现在我的老板希望减少框架,但我发现正确嵌入预订流程存在问题,因为我根本不想触及它。

最好的处理方法是什么?

  • 仅将 iframe 用于预订流程
  • 在服务器端解决它以网络请求预订引擎并更改链接或类似的内容。
  • 使用 AJAX? 但我认为这会影响很多代码。
  • 更好的解决方案?

当然,也存在时间/金钱问题,但我现在认为这是理所当然的。

At the moment I'm working with a booking website that has a frame set.

Let's say, 40% is from it's own website, so can be easily altered into a frame less site.

However, the actually booking-flow is from another website (also maintained by us) and is meant to "live" on it's own, so that 3rd party websites can buy/use the booking-flow as well.

Now my boss wants to have it frame less, but I see problems with embedding the booking-flow properly, because I don't want to touch that at all.

What is the best way to deal with it?

  • Use an iframe for the booking-flow only
  • Solve it server-side to web request the booking-engine and alter links or something like that.
  • Use AJAX? but that will impact a lot of code I think.
  • Better solution?

Of course there is a time/money issue as well, but I'll take that for granted now.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

梦境 2024-07-22 05:47:09

如果您正在处理另一个站点,最快的方法是使用 IFrame。

它的缺点是,将其高度设置为与其中的内容相同可能是一个技巧,但如果你能解决这个问题,那么你应该就没事了。

仅供参考,我已经成功地将弹出式购买流程(呵呵 PPP)转变为一个非常受欢迎的购买网站的 IFrame :P

Quickest way is to use an IFrame if you are dealing with another site.

Its downside is it can be a trick to set its height to be the same as the content within it but if you can get around that, you should be in the clear.

FYI i have been successful in transforming a popup purchase process (heh PPP) into an IFrame for a pretty popular purchasing site :P

要走干脆点 2024-07-22 05:47:09

两个进一步的建议:

  1. 使预订引擎“可换肤”,这样就不需要使用框架
  2. 将 API 添加到可在服务器端使用的预订引擎(几乎是上面的第二个选项,但比抓取 HTML 更干净

)我看到很多 iframe 的使用,并且自己也被自己所困扰,那就是知道它必须渲染的内容的大小。 iframe 不会根据其内容调整大小,您必须指定固定的宽度和高度。

Two further suggestions:

  1. Make the booking engine 'skinnable' so it doesn't require frames to use
  2. Add an API to the booking engine that can be used server-side (pretty much your second option above but more cleanly than scraping HTML)

The issue I see with a lot of iframe usage, and have been caught with myself, is knowing the size of the content it has to render. An iframe will not resize to it's content, you have to specify a fixed width and height.

温柔一刀 2024-07-22 05:47:09

我知道现在使用框架有一些禁忌,但是在这个网站上,它有什么问题吗? 这会给你带来真正的麻烦吗?

由于预订网站应保持原样,我要么坚持使用框架,要么使用 iframe。

使用服务器端或ajax请求然后解析html是自找麻烦。 如果预订网站的界面稍微改变一下怎么办?

您是否曾考虑过通过网络服务扩展预订网站?

I know there is sort of a taboo on using frames these days, but in this website, is there anything wrong with it? Does it cause you real trouble?

Since the booking website should remain as it is, i would either stick to the frames, or use an iframe.

Using server-side or ajax requests and then parsing the html is asking for trouble. What if the interface of the booking website changes even a little bit?

Have you tought of extending the booking website with webservices?

梦途 2024-07-22 05:47:09

如果两个站点存在于不同的域或协议上(似乎预订可能是 https),那么一个简单的 AJAX 解决方案就出现了,无论如何,您都会在那时沦为代理。

修改 HTML 输出将会给您带来大量错误,并且在返回时再次需要代理。

iframe 可以满足您的需要,但由于 x 域问题,再次将流程返回到主页可能会出现问题。

考虑到所有因素,我通常希望辅助预订服务成为一项服务,并且我会在服务器端与该服务进行交互。 实际上,它需要以某种方式提供 API,我认为 Web 服务将是最干净的方式。

A simple AJAX solution is out if the two sites exist on different domains or protocols (it seems likely that booking would be https), you'd be reduced to a proxy at that point anyway.

Modifying HTML output is going to give you a raft of bugs and again will require a proxy on the way back.

An iframe will do what you need, but it may be problematic returnign the flow to the main page again because of x-domain issues.

All things considered I would normally expect the secondary booking service to be a service and I'd interact with that on the server-side. It needs to have an API one way or another realistically, a web-service is going to be the cleanest way forward I imagine.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文