简体   繁体   English

如何加载meta http-equiv =“ REFRESH” content =“ 0; URL =“ somedomain”进入div。

[英]how to load meta http-equiv=“REFRESH” content=“0; URL=”somedomain" into a div.

I am trying to make a ajax request to a page which contains below meta tag 我正在尝试向包含以下meta标签的页面发出ajax请求

<meta http-equiv="REFRESH" content="0; URL=https://www.ohterDomain.com/help?nodeId=2&view=content-only">

Upon successful ajax call I am not getting the correct content in my response object. 成功调用ajax后,我在响应对象中未获得正确的内容。 And the meta tag causing my entire page to reload with the given URL. 而meta标签会导致我的整个页面重新加载给定的URL。

The URL in mata tag is from different domain and throwing cross domain exception on separate ajax call. mata标记中的URL来自不同的域,并且在单独的ajax调用中引发跨域异常。

Is there any way to load the refreshed meta URL into my response object? 有什么方法可以将刷新的元URL加载到我的响应对象中? Or any other workaround to solve this issue? 或任何其他解决方法来解决此问题?

AJAX(as approach) also known as XMLHttpRequest or XHR is typical way to load data without reloading page. AJAX(作为方法)也称为XMLHttpRequest或XHR是不重新加载页面而加载数据的典型方法。

But you are going to request different domain. 但是您将请求其他域。 So you will porobably face CORS restrictions. 因此,您很可能将面临CORS限制。

Is it acceptable for you to load data into <iframe> instead of <div> ? 将数据加载到<iframe>而不是<div>是否可以接受?

How is the AJAX call triggered? 如何触发AJAX呼叫? Make sure to cancel the original event when clicking a link or submitting a form. 单击链接或提交表单时,请确保取消原始事件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM