下面的html代碼顯示了用戶的基本註冊/登錄表單,我想在使用jquery移動庫構建的頁面中使用它。jquery mobile中的HTML代碼兼容性
目前它不工作,我是新來jquery移動,並不確定如果我打破了基本法,不能簡單地將其放入頁面,並期望它的工作。
我想我可能需要更改按鈕的代碼,使它們正常工作?
我已經研究過這個問題,但是我找不到100%的答案。
<script type="text/template" id="login-template">
<header id="header"></header>
<div class="login">
<form class="login-form">
<h2>Log In</h2>
<div class="error" style="display:none"></div>
<input type="text" id="login-username" placeholder="Username" />
<input type="password" id="login-password" placeholder="Password" />
<button>Log In</button>
</form>
<form class="signup-form">
<h2>Sign Up</h2>
<div class="error" style="display:none"></div>
<input type="text" id="signup-username" placeholder="Username" />
<input type="password" id="signup-password" placeholder="Create a Password" />
<button>Sign Up</button>
</form>
</div>
</script>
不應該將HTML代碼放在腳本標記中 – AtanuCSE
@AtanuCSE:HTML5允許將_data_插入到文檔中 - 「type」必須不能被解釋爲腳本語言。 (也應該是一個有效的MIME類型。) – CBroe
你在哪裏放置該代碼?在頭部,身體......? – Omar