避免在iOS浏览器中对204响应进行表单重定向 [英] Avoid form redirection on 204 response in ios browsers

查看:77
本文介绍了避免在iOS浏览器中对204响应进行表单重定向的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在hubspot中创建了一个表单.

I have created a form in hubspot.

在成功发布带有HTTP 204响应的表单后,在iPhone和iPad等IOS设备中,页面被重定向到操作URL,但是在Windows和android中,页面仍保留在同一页面中.

In IOS devices like iPhone and iPad after successful post of form with the HTTP 204 response, page is redirected to action url, but in windows and android it remains in same page.

有什么方法可以避免iPhone/iPad中的表单重定向?

Is there any way we can avoid form redirection in iPhone/iPad?

推荐答案

我遇到了同样的问题,但没有找到有关如何为iOS设备(任何浏览器)解决该问题的信息.

I had the same issue, and found no info regarding how to solve it for iOS devices (any browser).

因此,当url参数具有字符串 submissionGuid (所有中心表单提交中的参数)时,我插入了一个向下滚动的jQuery.

So I've inserted a jquery to scroll down when the url parameters have the string submissionGuid - parameter present in all hubspot form submissions.

  1. 向显示内联消息的部分添加ID或类.即 id ="AREA_INLINE_MSG"

在页面准备就绪时,插入以下代码:

Insert the following code when the page is ready:


if (window.location.toString().indexOf("submissionGuid") != -1) {
    $("html, body").animate({
        scrollTop: $("#AREA_INLINE_MSG").offset().top + 3000
    }, 1000);
}

注意::我已经在窗口位置添加了3000个像素,以向下滚动一点.

Note: I've added 3000 pixels to the window position to scroll down a little bit more.

这篇关于避免在iOS浏览器中对204响应进行表单重定向的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆