Rumah  >  Artikel  >  hujung hadapan web  >  一个不错的应用,用于提交获取文章内容,不推荐用_javascript技巧

一个不错的应用,用于提交获取文章内容,不推荐用_javascript技巧

WBOY
WBOYasal
2016-05-16 19:18:24942semak imbas
复制代码 代码如下:

<script> <BR> function showlist(vtype) <BR> { <BR> with (document.listform) <BR> { <BR> w_type.value=vtype; <BR> } <BR> document.listform.submit(); <BR> return; <BR> } <BR> function showout(vid) <BR> { <BR> with (document.showform) <BR> { <BR> id.value=vid; <BR> } <BR> document.showform.submit(); <BR> return; <BR> } <BR>function showmenu(buyok,img) <BR>{ <BR> if(buyok.style.display=="none") <BR> { <BR> buyok.style.display=""; <BR> img.src="images/bclass2.gif"; <BR> } else { <BR> buyok.style.display="none"; <BR> img.src="images/bclass1.gif"; <BR> } <BR>} <BR></script>
<script> <BR> function page(vpage){ <BR> document.pageform.page.value=vpage; <BR> document.pageform.submit(); <BR> return false; <BR> } <br><br> function trimpos(s) { <BR> return s.replace(/(^[\s]*)|([\s]*$)/g, ""); <BR> } <br><br> function isnum( tmp ){ <BR> if ( tmp >= '0' && tmp <= '9' ) <BR> return true; <BR> return false; <BR> } <br><br> function mysubmit(){ <BR> if (event.keyCode=='13') <BR> gosubmit(); <BR> } <br><br> function gosubmit(){ <BR> var str=trimpos(vpos.value); <BR> if (str == "") { <BR> alert("请输入页码!"); <BR> vpos.focus(); <BR> return; <BR> } <BR> for ( var i=0; i < str.length; i++ ){ <BR> if(isnum( str.charAt(i)) == false){ <BR> alert("页码必须由数字组成!"); <BR> vpos.focus(); <BR> vpos.value=""; <BR> return; <BR> } <BR> } <BR> if ( ( parseInt(str)<1 ) || ( parseInt(str) > 2) ){ <BR> alert("页码超出范围!"); <BR> vpos.focus(); <BR> vpos.value=""; <BR> return; <BR> } <BR> page(str); <BR> } <br><br></script>

Kenyataan:
Kandungan artikel ini disumbangkan secara sukarela oleh netizen, dan hak cipta adalah milik pengarang asal. Laman web ini tidak memikul tanggungjawab undang-undang yang sepadan. Jika anda menemui sebarang kandungan yang disyaki plagiarisme atau pelanggaran, sila hubungi admin@php.cn