https javascript 和 firefox

发布于 2024-07-29 02:10:58 字数 1178 浏览 2 评论 0原文

我有一些 javascript,它调用一些 php 函数来跟踪 webstats (piwik.org)

在 http 网站上一切正常,从每个浏览器都可以跟踪

我有一个网站是 https - 它将跟踪来自 ie 的访问,但不会跟踪来自 Firefox 的访问或 Chrome

有谁知道我需要做什么、设置或使用才能使其在 https 网站上运行?

这是 html 中的代码 - 如果您需要其他内容,请告诉我:

<!-- Piwik -->
<!--"http://webstats.veritythree.com";-->
<script type="text/javascript">
var pkBaseURL = "https://mysite/Webstats/";
document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.js' type='text/javascript'%3E%3C/script%3E"));
</script><script type="text/javascript">
try {
var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", 6);
piwikTracker.trackPageView();
piwikTracker.enableLinkTracking();
} catch( err ) {}
</script>
<!-- End Piwik Tag -->

piwik.js 相当大,但我不知道它是否有帮助,所以我现在不会发布它......

我尝试用我自己的一个简单文件替换他们的 piwik.php,该文件只写入一个文本文件 - 这可以在 IE、Firefox 和 Chrome 中工作,甚至不会创建文件

$myFile = "testFile.txt";
$fh = fopen($myFile, 'w') or die("can't open file");
$stringData = "V3 Developer\n";
fwrite($fh, $stringData);
$stringData = "Testing PHP\n";
fwrite($fh, $stringData);
fclose($fh);

感谢您对此的任何帮助!

I have some javascript which calls some php functions to track webstats (piwik.org)

Everything works fine on http sites, from every browser it is all tracked

I have one site that is https - it will track visits from ie, but not from Firefox or Chrome

Does anyone know of anything I need to do or set or use to make it work on an https site?

Here is the code that goes in the html - please let me know if you need anything else:

<!-- Piwik -->
<!--"http://webstats.veritythree.com";-->
<script type="text/javascript">
var pkBaseURL = "https://mysite/Webstats/";
document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.js' type='text/javascript'%3E%3C/script%3E"));
</script><script type="text/javascript">
try {
var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", 6);
piwikTracker.trackPageView();
piwikTracker.enableLinkTracking();
} catch( err ) {}
</script>
<!-- End Piwik Tag -->

The piwik.js is pretty large but I don't know if it will help so I will refrain from posting it for now...

I tried replacing their piwik.php with a simple file of my own that just writes a text file - this works from IE, from Firefox and Chrome it doesn't even create the file

$myFile = "testFile.txt";
$fh = fopen($myFile, 'w') or die("can't open file");
$stringData = "V3 Developer\n";
fwrite($fh, $stringData);
$stringData = "Testing PHP\n";
fwrite($fh, $stringData);
fclose($fh);

Thanks for any help on this one!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

无畏 2024-08-05 02:10:58

这听起来像是 XSS 预防。 当您的 javascript 指向安全 url 时,您是否也在通过安全 url 查看页面?

This sounds like XSS prevention. When your javascript is pointing to the secure url, are you also viewing the page through the secure url?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文