为什么%E2%80%8F被添加到我的Youtube嵌入代码中? [英] Why is %E2%80%8F being added to my Youtube embed code?

查看:1044
本文介绍了为什么%E2%80%8F被添加到我的Youtube嵌入代码中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Youtube上有一堆视频,我使用相同的代码嵌入。所有的视频都运行正常,直到我上传了最后一个。每次我现在执行代码时,%E2%80%8F被附加到上次上传的视频,除非我特别要求子字符串(0,11);请注意,没有这个黑客,代码仍然适用于我所有其他上传的视频。尽管代码现在适用于我的hack,但理解为什么会发生这种情况会很棒。

I have a bunch of videos on Youtube which I embed using the same code. All of the videos worked fine until I uploaded the last one. Every time I now execute the code, %E2%80%8F is appended to the last uploaded video, unless I specifically ask for a substring(0,11); note that without this hack, the code still works fine for all of my other uploaded videos. And though the code now works with my hack, it would be great to understand why this could be happening.

我的HTML标记如下所示:

My HTML markup looks like this:

<li><a href="#" class="help_video" id="oG-M25hnDII‏">sidebars</a></li>

我的javascript / jquery如下所示:

My javascript/jquery looks like this:

function openNewWindow(youtube_link) {
var youtube_link = youtube_link.toString();

youtube_link = youtube_link.substring(0,11);
 popupWin = window.open('/videos/help.php?youtube_link='+youtube_link,
 'open_window',
 'menubar, toolbar, location, directories, status, scrollbars, resizable, dependent, width=800, height=440, left=0, top=0')
 }

$(".help_video").click(function(){
openNewWindow($(this).attr('id'));
return false;
});
 });

然后,我的相关help.php包含以下代码:

Then, my associated help.php has the following code:

<iframe width="756" height="426" src="//www.youtube.com/embed/<?php echo $_GET['youtube_link'];?>?rel=0&vq=hd720" frameborder="0" allowfullscreen></iframe>

谢谢!

推荐答案

链接包括从右到左标记的UTF8字符

The link includes the right-to left mark UTF8 character

看看这里:
http://en.wikipedia.org/wiki/Right-to-left_mark

这是一个非打印字符,所以你不会在屏幕上看到它,但你的编辑器会把它偷偷摸摸。

This is a non-printing character, so you won't see it on screen, but your editor sneaked it in.

试试


  • 使用其他编辑器再次写入此部分代码

  • 设置代码编辑器以显示特殊字符(标签,换行符等)。通过这种方式,您将能够查看和删除rtl标记

这篇关于为什么%E2%80%8F被添加到我的Youtube嵌入代码中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆