简体   繁体   English

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

So the problem is the url is correct in the src variable it is correct when it is inserted into the dom 所以问题是src变量中的url是正确的,将其插入dom时是正确的

<script type="text/javascript" src="http://www.adserver.com/www/delivery/ajs.php?zoneid=1&amp;amp;cb=37930400855&amp;amp;charset=UTF-8&amp;amp;loc=http%3A//thissite.com/"></script>

But the second the browser tries to fetch it the url changes to 但是第二次浏览器尝试获取它,URL更改为

http://www.adserver.comwww/delivery/ajs.php?zoneid=1&cb=37930400855&charset=UTF-8&loc=http%3A//thissite.com/ HTTP://www.adserver.comwww/delivery/ajs.php了zoneid = 1&CB = 37930400855&字符集= UTF-8&LOC = HTTP%3A // thissite.com /

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. 看到.com之后,它会剥离/,以便comwww一起运行,从而引发错误,当然也不会显示我想要的内容。 I have tried uri encoding and other little things i had read or seen on stackoverflow to no avail. 我已经尝试过uri编码以及我在stackoverflow上阅读或看到的其他小东西,但无济于事。

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. 我已经在其他域中运行了示例代码,并且工作正常。

Try visiting the js url in your browser directly, or using a command line tool like curl . 尝试直接在浏览器中访问js网址,或使用curl等命令行工具。 Check that it is redirecting. 检查它是否正在重定向。 So it is likely that the adserver.com site is redirecting badly. 因此,很可能adserver.com网站重定向错误。 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. 抱歉,这不能直接解决您的问题,但我认为此回复是该网站的正确“答案”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM