将代码收藏到浏览器收藏夹以便快速打开。(运行环境chrome)
代码
data:text/html;charset=utf-8,<html><head><title>html%E6%89%B9%E9%87%8F%E4%B8%8B%E8%BD%BD%E7%94%9F%E6%88%90%E5%99%A8</title><script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-2.1.4.min.js"></script><style> * { margin: 0; padding: 0; } body { width: 95%; margin: 0 auto; } input, button { padding: 5px 8px; margin: 10px; background-color: #FFF; border: 1px #ccc solid; } button { cursor: pointer; } #runDownHrefVal > a { display: inline-block; }</style></head><body> %E6%9B%BF%E6%8D%A2%E7%AC%A6(*)<input style="width: 90%" id="demo_input" placeholder="url" /><br /> %E5%BC%80%E5%A7%8B%E5%80%BC<input id="start" type="number" />-%E7%BB%93%E6%9D%9F%E5%80%BC<input id="end" type="number" />%E5%8C%B9%E9%85%8D%E9%95%BF%E5%BA%A6%E5%B0%8F%E4%BA%8E%E9%95%BF%E5%BA%A6%E8%87%AA%E5%8A%A8%E5%A1%AB%E5%85%850<input id="min_len" type="number" min="1" value="1" onblur="if ($(this).val().length<=0) {$(this).val('1')}" /><button onclick="runDownHref()">%E7%94%9F%E6%88%90</button><div id="runDownHrefVal" style="height: 60%; width: 100%; overflow: auto; border: 1px #cccccc solid"></div><form onsubmit="return false"><button onclick="downLoadAll()" id="downLoadAllBtn"> %E4%B8%8B%E8%BD%BD%E5%85%A8%E9%83%A8</button><button onclick="story.select();document.execCommand(%26quot%3BCopy%26quot%3B);">%E5%A4%8D%E5%88%B6</button><textarea name="story" rows="12" style="width: 1px; height: 1px; overflow: hidden;opacity: 0"></textarea></form><script> function lenck(strObj){if(strObj==null||strObj.length<=0){return true;}return false;}var tmp="";function runDownHref(){$("#runDownHrefVal").html("");$("textarea[name='story']").val("");var demoInputVal=$("#demo_input").val();if(lenck(demoInputVal)){alert("url%E4%B8%8D%E8%83%BD%E4%B8%BA%E7%A9%BA");return;}var start=parseInt($("#start").val());var end=parseInt($("#end").val());var min_len=parseInt($("#min_len").val());if(lenck(start)||lenck(end)){return;}if(start>end){alert("%E5%BC%80%E5%A7%8B%E5%80%BC%E4%B8%8D%E8%83%BD%E5%A4%A7%E4%BA%8E%E7%BB%93%E6%9D%9F%E5%80%BC");return;}for(var i=start;i<=end;i++){tmp="";for(var j=(i+"").length;j<parseInt(min_len);j++){tmp="0"+tmp;}tmp=demoInputVal.replace(/\(\*\)/g,tmp+i);$("#runDownHrefVal").append($("<a/>",{href:tmp,download:""}).html(tmp));$("#runDownHrefVal").append($("<br/>"));$("textarea[name='story']").val($("textarea[name='story']").val()+tmp+"\n");}}function downLoadAll(){if(confirm("%E6%82%A8%E7%9C%9F%E7%9A%84%E7%A1%AE%E5%AE%9A%E8%A6%81%E4%B8%8B%E8%BD%BD%E5%90%97%EF%BC%9F\n\n%E8%AF%B7%E7%A1%AE%E8%AE%A4%EF%BC%81(%E6%96%87%E4%BB%B6%E9%87%8F%E8%BF%87%E5%A4%A7%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%85%8D%E7%BD%AE%E4%BD%8E%E7%9A%84%E5%8F%AF%E8%83%BD%E4%BC%9A%E5%88%B0%E8%87%B3%E7%B3%BB%E7%BB%9F%E5%8D%A1%E6%AD%BB)")==true){var downLoadList=$("#runDownHrefVal>a");for(var i in downLoadList){downLoadList[i].click();}}}</script></body></html>
效果图片