gpt4 book ai didi

javascript - 如何在谷歌站点中使用 javascript 获取当前页面的 url?

转载 作者:行者123 更新时间:2023-11-30 13:14:55 24 4
gpt4 key购买 nike

如何在 Google 协作平台中使用 javascript 获取当前页面的 url?我需要获取包含所有参数的当前页面的完整网址。window.location.href 返回 http://nosuchhost.invalid:80。它仅发生在 Google 协作平台中,在 Google 博客中 window.location.href 工作正常。

最佳答案

You can't run javascript in a google site .

It won't work as I don't think Google Sites will ever offer JavaScript.

What you have to remember is that your Google Site is always at a google.com address and, therefore, many people, firewalls and virus checkers automatically trust everything at a google.com address: Javacript can deliver malicious code, so it's never going to happen. You should be able to add the javascript through a gadget.

和...

As Steegle has noted, we won't be adding JavaScript anytime soon to the capabilities of Sites.

关于javascript - 如何在谷歌站点中使用 javascript 获取当前页面的 url?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12354855/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com