在javascript返回类似base64_encode(atob)的ajax结果

时间:2016-01-14 03:11:59

标签: ajax

我有一个像这样的html文件,我想通过ajax将编码字符串发送到返回解码字符串的php文件。请帮我解决。谢谢 P / s:对不起,我的英语很差

function encode(value){     
    var data = 'data=' + value;
    $.ajax({
        type: "POST",
        url: "/encode.php",
        data: data,
        success: function(data) {
            return data; 
        }
    });
}
jwplayer.key = "FtQ+ubCVmOF2aj8ALHMi/lGfO4o7Oy7xpKmePA==";
jwplayer("media-player").setup({
    sources: [{file: encode("an encode string"),type:"mp4",label: "720p"}],
    width: "100%",
    height: "100%",
    skin: "vapor",
    autostart: "true",
    abouttext: "HxPlugin v1.0"
 });
<script src="http://code.jquery.com/jquery-2.1.4.min.js"></script>
<script src="http://www.yan.vn/scripts/jwplayer.js" type="text/javascript"></script>
<div id="media-player"></div>

0 个答案:

没有答案