我有一个包含iFrame的div:
<div class="embed-responsive embed-responsive-16by9" id="camera_view_div">
<iframe allowfullscreen="true" class="embed-responsive-item container well well-small span6" frameborder="0" id="camera_view" mozallowfullscreen="true" msallowfullscreen="true" oallowfullscreen="true" src="" webkitallowfullscreen="true">
</iframe>
</div>
我有一个来自服务器的图像URL,并且我正在尝试将iFrame的src设置为该图像URL。但是它会在更新时开始下载图片网址。
cameraView.src = event.info.data['image_url'];
如何在iFrame上设置图片网址并显示它?
答案 0 :(得分:2)
如scrappedcola所说,这是iframe的奇怪用法,但我假设您对此有很强的论据。
我可以想到两种可能的解决方案:
https://jsfiddle.net/0ftobver/2/ <<检查占位符图像的标题
$ cat tmp.plt
set style data lines
plot \
"folder1/data" using 1:2,
"folder1/data" using 1:3,
"folder2/data" using 1:2,
"folder2/data" using 1:3,
"folder3/data" using 1:2,
"folder3/data" using 1:3,
"folder4/data" using 1:2,
"folder4/data" using 1:3
或注入html,例如: valid = 0
while valid ==0:
x = input('Enter 4 digits for X(0 or 1): ')
while len(x)!=4:
print('Try Again. Remember 4 digits and only use binary 1 or 0')
x = input('Enter 4 digits for X: ')
valid = 1
for i in x:
if i !='1' and i !='0':
print('Try Again. Remember 4 digits and only use binary 1 or 0')
valid=0
valid = 0
while valid ==0:
y = input('Enter 4 digits for Y(0 or 1): ')
while len(y)!=4:
print('Try Again. Remember 4 digits and only use binary 1 or 0')
y = input('Enter 4 digits for y: ')
valid = 1
for i in y:
if i !='1' and i !='0':
print('Try Again. Remember 4 digits and only use binary 1 or 0')
valid=0
https://jsfiddle.net/q3rvd418/2/
注入将类似,但要使用iframe的srcdoc
属性。