在fqdn之后丢失正斜杠 [英] Missing forward slash after fqdn
问题描述
所以这是情况,我从我的自定义广告服务器得到一个广告,如此
So here is the situation, i'm getting an ad from my custom adserver like so
src = 'http://www.adserver.com/www/delivery/ajs.php?zoneid=1&cb=37930400855&charset=UTF-8&loc=http%3A//thissite.com/';
script = document.createElement 'script'
script.type = 'text/javascript'
script.src = src
$('.banner-container').append script
所以问题是src变量中的url是正确的,当插入到dom
So the problem is the url is correct in the src variable it is correct when it is inserted into the dom
<script type="text/javascript" src="http://www.adserver.com/www/delivery/ajs.php?zoneid=1&amp;cb=37930400855&amp;charset=UTF-8&amp;loc=http%3A//thissite.com/"></script>
但第二个浏览器尝试将其更改为
But the second the browser tries to fetch it the url changes to
在.com后面看到,它剥离了/,所以comwww运行在一起,使它抛出一个错误,当然不会显示我想要的。我已经尝试过uri编码和其他一些我在stackoverflow中看到或看不到的小东西。
see right after the .com it strips the / so that comwww runs together, making it throw an error and of course not display what i want. I have tried uri encoding and other little things i had read or seen on stackoverflow to no avail.
推荐答案
也许问题在于广告服务器网站。他们可能会有一个坏的重写,或内部重定向不好。我已经运行了不同域的示例代码,并且运行正常。
Perhaps the problem is on the ad server site. They likely have a bad rewriterule, or a bad internal redirect. I have run your sample code with a different domain and it works fine.
尝试直接访问浏览器中的js url,或使用命令行工具,如卷曲
。检查它是否重定向。因此,adserver.com网站很可能会重新导向。如果他们有支持联系,你应该向该公司提交一张机票。
Try visiting the js url in your browser directly, or using a command line tool like curl
. Check that it is redirecting. So it is likely that the adserver.com site is redirecting badly. If they have a support contact, you should file a ticket with that company.
我很抱歉这不直接解决您的问题,但我觉得这个回应是这个网站的正确答案。
I am sorry that this does not directly solve your problem, but I feel that this response is a proper "answer" for this site.
这篇关于在fqdn之后丢失正斜杠的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!