JavaScript多圖片上傳案例_javascript技巧

來源:互聯網
上載者:User

JS多圖片上傳小小執行個體:

<html xmlns="http://www.w3.org/1999/xhtml"><head>  <title>上傳多圖片</title>  <script type="text/javascript">    function JM_wu(ob) {      ob.style.display = "none";    }    function JM_you(ob) {      ob.style.display = "";    }    function createForm(textN, number) {      data = "";      inter = "'";      if (number < 11 && number > -1) {        for (i = 1; i <= number; i++) {          if (i < 10) spaces = " ";          else spaces = " ";          data = data + " <input name=" + textN + i + " type=text value='' size='30' maxlength='100'>"          + "<INPUT TYPE='button' value='上傳" + i + "' onclick=javascript:uppic('more" + i + "','more" + i + "')>";        }        if (document.layers) {          document.layers.cust.document.write(data);          document.layers.cust.document.close();        }        else {          if (document.all) {            cust.innerHTML = data;          }        }      }      else {        window.alert("請不要超過10張圖片.");      }    }</script></head><body>  <form name="prodtable" action="">  <input type="radio" name="more_pic" checked value="0" onclick="JM_wu(s1)">無  <input type="radio" name="more_pic" value="1" onclick="JM_you(s1)">有 <span id="s1" style="display:none">    <input name="more" type="text" value='1' size='5' maxlength='2'>    <input type="button" value="張大圖" onclick="createForm('more',document.prodtable.more.value);">    <span id="cust" style="position: relative;"></span></span>  </form></body></html>

這隻是一個指引的小例子,同學們可以把按鈕換成瀏覽圖片按鈕。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.