Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/79.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
HTML img src格式?_Html - Fatal编程技术网

HTML img src格式?

HTML img src格式?,html,Html,我有一个API,我可以从我的IP摄像头获取“快照”。如果我使用此行,我的浏览器将返回和图像 http://my_NAS_IP:PORT/webapi/entry.cgi?camStm=1&version="8"&cameraId=1&api="SYNO.SurveillanceStation.Camera"&preview=true&method="GetSnapshot"&_sid=SESSION_ID 但是,当我试图将其转换为html时,它不

我有一个API,我可以从我的IP摄像头获取“快照”。如果我使用此行,我的浏览器将返回和图像

http://my_NAS_IP:PORT/webapi/entry.cgi?camStm=1&version="8"&cameraId=1&api="SYNO.SurveillanceStation.Camera"&preview=true&method="GetSnapshot"&_sid=SESSION_ID
但是,当我试图将其转换为html时,它不起作用

<!DOCTYPE html>
<html>
<body>

<img src="my_NAS_IP:PORT/webapi/entry.cgi?camStm=1&version="8"&cameraId=1&api="SYNO.SurveillanceStation.Camera"&preview=true&method="GetSnapshot"&_sid=SESSION_ID" 
/>

</body>
</html>


对于行中的许多
”?我如何设置格式以在页面上显示图像?

是的,在被
包围的引号内不能使用
字符。对于外部字符串,请使用单引号

只需将
img
标记括在单引号内即可

<img src='my_NAS_IP:PORT/webapi/entry.cgi?camStm=1&version="8"&cameraId=1&api="SYNO.SurveillanceStation.Camera"&preview=true&method="GetSnapshot"&_sid=SESSION_ID'/>



在…中使用单引号。

使用单引号替换其中一组双引号。请研究HTML编码。是否在位置栏中包含
http://
,但希望在HTML源代码中自动检测,或者这只是一个输入错误?相机是否返回图片或完整网站?只是
http://
<img src="my_NAS_IP:PORT/webapi/entry.cgi?camStm=1&version='8'&cameraId=1&api='SYNO.SurveillanceStation.Camera'&preview=true&method='GetSnapshot'&_sid=SESSION_ID" 
/>