加載的iframe源這裏是我的jQuery我想從一個輸入值
$(".load-link").click(function() {
$link = $('.sermon-link').val();
$(".embed-responsive-item").attr("src", '" + link + "');
});
這是我的HTML代碼。
<div class="form-group">
<label>Youtube Video Link</label>
<div class="input-group">
<div class="input-group-addon">
<i class="fa fa-unlink"></i>
</div>
<input type="text" class="sermon_link form-control pull-right" name="sermon_link" value="$sermon_link" placeholder="https://youtu.be/pZT-FZqfxZA" />
<span class="input-group-btn">
<button class="load-link btn btn-success" type="button">Preview</button>
</span>
</div>
<!-- /.input group -->
</div>
<!-- /.form group -->
<!-- 4:3 aspect ratio -->
<div class="thumbnail" style="background: url('assets/img/video_shot_placeholder.png'); background-style: cover;">
<div class="embed-responsive embed-responsive-4by3">
<iframe class="embed-responsive-item"></iframe>
</div>
</div>
在點擊預覽插件,將IFRAME SRC將加載預覽視頻
_I正在調用錯誤的ID _......在那裏我沒有找到指代** ID **的代碼。 – Jai