weixin_33720078 2017-09-15 13:58 采纳率: 0%
浏览 89

带问号的图片网址

In the following script the url of some video source are gotten from a json and played on a web interface.

The urls are like this: http://ip:port/resource?user=blabla&pwd=blablabla when the page is loaded in the firefox console i find:

GET http://ip:port/resource

the question mark and all following chars are omitted.

So the device do not receive the well formed url and the streaming do not starts.

function getData(){

    var deviceParams = {};

    $.ajax({

        url: "cameras.json",

        //dataType: 'json',

    dataType: 'json',

        success: function(data) {

        /* Dinamically adding cams div */

    var camsList = $("#cams_ul");

        var availableCams = formatDeviceParams(data.deviceParams);

        var videoSrc = "";

        availableCams.forEach(function(cam, index){ 

            videoSrc = "http://" + cam.ip + ":" + cam.port + cam.video_url;


        camsList.append('<div class="panel-video panel panel-primary col-md-3 col-xs-5 col-xxs-10">'
               +cam.device_name+
            '<div class="panel-body"><img class="videovid" src="'+videoSrc+'"/></div></div>');
    });



        /* ======= jQuery Modal section ======= */

        var images = document.getElementsByClassName('videodiv');
        for (var i = 0; i < images.length; i++) {
            images[i].onclick = function(){
                openNav();
                $("#modal-image").attr("src", this.src);
            }
        }
        /* ====== END Modal section ===== */
        }
    });
}
  • 写回答

1条回答 默认 最新

  • weixin_33739646 2017-09-18 12:06
    关注

    Solved: The problem was only on firefox visualizzation. Executing the script, the firefox's console showes only the main address http://ip:port/resource omitting the cars after the question mark, but the GET generated includes the well formed url: http://ip:port/resource?admin=blabla&pwd=blablabla

    评论

报告相同问题?

悬赏问题

  • ¥15 运筹学排序问题中的在线排序
  • ¥30 求一段fortran代码用IVF编译运行的结果
  • ¥15 深度学习根据CNN网络模型,搭建BP模型并训练MNIST数据集
  • ¥15 lammps拉伸应力应变曲线分析
  • ¥15 C++ 头文件/宏冲突问题解决
  • ¥15 用comsol模拟大气湍流通过底部加热(温度不同)的腔体
  • ¥50 安卓adb backup备份子用户应用数据失败
  • ¥20 有人能用聚类分析帮我分析一下文本内容嘛
  • ¥15 请问Lammps做复合材料拉伸模拟,应力应变曲线问题
  • ¥30 python代码,帮调试,帮帮忙吧