2

如何在 Google 协作平台中使用 javascript 获取当前页面的 url?我需要使用所有参数获取当前页面的完整 url。 window.location.href返回http://nosuchhost.invalid:80。它只发生在 Google 网站中,在 Google 博客中window.location.href运行良好。

4

1 回答 1

3

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.

and...

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

于 2012-09-10T15:38:45.210 回答