[問題] htm button執行後無反應 500P已刪文

看板Web_Design作者時間5年前 (2018/12/25 18:45), 編輯推噓1(1011)
留言12則, 3人參與, 5年前最新討論串1/1
如題 近日再改一支前輩給的htm 當使用手機或是PC chrome登入 第一次輸入數值欲計算 Button都無反應 需要F5更新重整網頁才能正常 以下是部分htm <form name="Cal"> <font face="新細明體"><font color="blue" size="3">每月存入:</font><br> 新臺幣 <input name="Money" type="text" size="18" maxlength="18"></font> <font face="新細明體">元<br> 年利率 <input name="YRate" type="text" size="10" maxlength="10">%<br> 期限: <input name="Year" type="text" size="2" maxlength="2">年後 <input type="button" value="試算"onClick="Cal_mon()" name="button" > </font> </p> <hr> <p><font face="新細明體"><font color="blue" size="3">就擁有:</font><br> 新臺幣 <input name="Sum_Mon" type="text" size="18" maxlength="18"></font> <font face="新細明體"> 元 <input type="button" value="清除" onClick="Clear()" name="button"> </font> </p> </form> 而呼叫的JavaScript函式就省略 head部分 所呼叫的幾支meta 標籤 <script src="jq/jquery-1.11.3.min.js"></script> <script src="jq/jquery.mobile-1.4.5.min.js"></script> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv='Expires' content='-1' /> <meta http-equiv='Pragma' content='no-cache' /> <meta http-equiv='Cache-Control' content='no-cache' /> 再請各位前輩幫debug 如有提供問題解決點 願奉上微薄的500p感謝 謝謝 -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 123.192.95.211 ※ 文章網址: https://www.ptt.cc/bbs/Web_Design/M.1545734713.A.277.html

12/25 18:55, 5年前 , 1F
是不是該貼個codepen啊XD
12/25 18:55, 1F

12/25 18:59, 5年前 , 2F

12/25 19:03, 5年前 , 3F
再麻煩一下 謝謝
12/25 19:03, 3F

12/25 21:02, 5年前 , 4F
js請寫在html後面如果還不行請使用$(document).ready()
12/25 21:02, 4F

12/25 21:07, 5年前 , 5F
請問 是指<script language="JavaScript"> 不包覆在<html>裡
12/25 21:07, 5F

12/25 21:07, 5年前 , 6F
?
12/25 21:07, 6F

12/25 21:08, 5年前 , 7F
^^^此段函式
12/25 21:08, 7F

12/25 21:13, 5年前 , 8F
把整個<script>...</script>放在</body>前
12/25 21:13, 8F

12/25 21:14, 5年前 , 9F
不要把js寫在html網頁實際元素表格那些前面就是了
12/25 21:14, 9F

12/25 21:16, 5年前 , 10F
好的 明天我到公司再試試 謝謝
12/25 21:16, 10F

12/25 21:17, 5年前 , 11F
因用PC無法測試是否可行 再次感謝:)
12/25 21:17, 11F

12/26 10:15, 5年前 , 12F
謝謝pkro12345提點 已解決!! 500p已奉上 感謝
12/26 10:15, 12F
文章代碼(AID): #1S8Wev9t (Web_Design)