從文本框特定蛞蝓我完全陌生的餘燼,所以請好:)重定向到燼
我有灰燼的應用程序,我想重定向到從文本框輸入採取特定的蛞蝓。在我的.hbs中,我有以下代碼:
<div class="liquid-container">
<div class="liquid-child">
<div class="desktop-layout-scroll-container">
<div class="overlay-info-layout">
<div class="overlay-info-layout-content">
<h1 class="expired-overlay-status">{{t 'code.title'}}</h1>
<h2 class="expired-overlay-explanation">
{{t 'code.description'}}<br>
</h2>
<div class="row">
<div class="col-xs-offset-3 col-xs-6">
<input name="txtSlug" type="text" id="txtSlug" class="field" />
<input type="submit" name="btnGo" value="" id="btnGo" class="btn" onclick="javascript:SubmitForm()" />
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script type="text/javascript">
function SubmitForm(){
var Slugtxt = document.getElementById("txtSlug").value;
window.location = "http://www.google.com/" + Slugtxt;
}
</script>
你這麼做太錯誤了......不想太卑鄙或粗魯,但請在編寫代碼之前閱讀官方指南(https://guides.emberjs.com/v2.8.0/)。 –