简体   繁体   English

如何将 Chargify 托管页面重定向到不同的 URL

[英]How to redirect Chargify hosted page to different URL

I have chargify hosted page but i would like to redirect it to different url as chargify have limited customization allowed on their public hosted pages, i have tried following code to redirect by putting into custom javascript area but it didn't work.我有 chargify 托管页面,但我想将其重定向到不同的 url,因为 chargify 在其公共托管页面上允许的自定义有限,我尝试通过放入自定义 javascript 区域来重定向以下代码,但它不起作用。

 window.onload = function() {
            setTimeout(function() {
                window.location = "https://reference.chargify.com/v1/subscriptions/create-subscription";
            }, 100);
        };

Looking forward to solution, thanks期待解决,谢谢

I think it needs to be window.location.href (not just window.location).我认为它需要是 window.location.href(不仅仅是 window.location)。 It worked for me with that addition.它对我有用。

This answer suggests that window.location.replace is preferable How do I redirect to another webpage?这个答案表明 window.location.replace 更可取如何重定向到另一个网页?

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

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