我正在使用window.open()
将我的客户重定向到新网站。我想在该网站加载之前显示一些消息或图像。在弹出窗口中显示负载信息
这是我的代码。
<input class="btn add-to-cart-btn" onclick="two();"
type="button" value="More Info At {{ product.vendor }}"/>
JavaScript代码:
<script>
function two()
{
window.open('{{ product.metafields.google.custom_label_0 }}'); trackOutboundLink('{{ product.metafields.google.custom_label_0 }}'); }
alert("please wait your page is loading ");
var trackOutboundLink = function(url) { ga('send', 'event', 'outgoing', 'click', url, { 'transport': 'beacon' });
}
</script>
这里{{ product.metafields.google.custom_label_0 }}
是一个动态的URL。测试警报消息显示在同一页面中。
有帮助吗?
你想在新窗口中显示的消息? – Mohammad