简体   繁体   English

jQuery HTML追加输出过多的引号

[英]jquery html append outputs excessive quotes

I have a quite peculiar problem with some jQuery code. 我对某些jQuery代码有一个非常特殊的问题。 Basically I'm trying to work out a video mirror script where you click on a button and the div should change embed code to another video service. 基本上,我正在尝试制定一个视频镜像脚本,在其中单击按钮,然后div应该将嵌入代码更改为另一个视频服务。 This is my code: 这是我的代码:

jQuery(function($){

    $('#mirror1').click(function(){
           $('#player-embed').html($('<div />').append($('#video1').clone()).html());
    });
});

This is the code for the button 这是按钮的代码

function mirror1( $atts, $content = null ) {
return '<a class="wpb_button_a" title="Mirror 1" href="#mirror1" id="mirror1">
<spanclass="wpb_button  wpb_btn-primary wpb_regularsize">Mirror 1</span></a>
<div id="video1" class="video1">' . $content . '</div>';

My problem is that the output gives excessive " quotations So all I'm seeing is (on page, not in code) 我的问题是输出给出了过多的引号,所以我所看到的是(在页面上,而不是在代码中)

<iframe frameborder=”0″ width=”480″ height=”270″ src=”videourltest” allowfullscreen>    </iframe>

And not the actual video itself. 而不是实际的视频本身。

Thanks in advance. 提前致谢。

Your code: 您的代码:

<iframe frameborder=”0″ width=”480″ height=”270″ src=”videourltest” allowfullscreen>    </iframe>

Your and are typographic quotes and not code quotes, code quotes are straight like " 您的是印刷引号,而不是代码引号,代码引号与"

Try: 尝试:

<iframe frameborder="0" width="480" height="270" src="videourltest" allowfullscreen>    </iframe>

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

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