2015-07-19 · 知道合伙人互联网行家
关注
展开全部
2种形式:
第一种:
<script>
function SaveAs5(imgURL)
{
var oPop = window.open(imgURL,"","width=1, height=1, top=5000, left=5000");
for(; oPop.document.readyState != "complete"; )
{
if (oPop.document.readyState == "complete")break;
}
oPop.document.execCommand("SaveAs");
oPop.close();
}
</script>
<img src="t_screenshot_17616.jpg" id="DemoImg" border="0" onclick="SaveAs5(this.src)">
第二种:
<script>
function SaveAs5(imgURL)
{
var oPop = window.open(imgURL,"","width=1, height=1, top=5000, left=5000");
for(; oPop.document.readyState != "complete"; )
{
if (oPop.document.readyState == "complete")break;
}
oPop.document.execCommand("SaveAs");
oPop.close();
}
</script>
<img src="../t_screenshot_17616.jpg" id="DemoImg" border="0">
<a href="#" onclick="SaveAs5(document.getElementById('DemoImg').src)"> 点击这里下载图片 </a>
第一种:
<script>
function SaveAs5(imgURL)
{
var oPop = window.open(imgURL,"","width=1, height=1, top=5000, left=5000");
for(; oPop.document.readyState != "complete"; )
{
if (oPop.document.readyState == "complete")break;
}
oPop.document.execCommand("SaveAs");
oPop.close();
}
</script>
<img src="t_screenshot_17616.jpg" id="DemoImg" border="0" onclick="SaveAs5(this.src)">
第二种:
<script>
function SaveAs5(imgURL)
{
var oPop = window.open(imgURL,"","width=1, height=1, top=5000, left=5000");
for(; oPop.document.readyState != "complete"; )
{
if (oPop.document.readyState == "complete")break;
}
oPop.document.execCommand("SaveAs");
oPop.close();
}
</script>
<img src="../t_screenshot_17616.jpg" id="DemoImg" border="0">
<a href="#" onclick="SaveAs5(document.getElementById('DemoImg').src)"> 点击这里下载图片 </a>
展开全部
<form id="form1" name="form1" method="post" action="">
<p style=" margin-left:200px;"><strong>趣味问答</strong></p>
<p><strong>1.清华池始建于什么时候?<br/>
<label>
<input type="radio" name="f_name1" value="单选" id="A" />
A.
1995年 </label>
<label>
<input type="radio" name="f_name1" value="单选" id="B" />
B.1919年
</label>
<label>
<input type="radio" name="f_name1" value="单选" id="C" />
C.1915年<br />
2.清华池最著名的服务项目?<br />
<input type="radio" name="f_name2" value="单选" id="A" />
A.洗浴
</label>
<label>
<input type="radio" name="f_name2" value="单选" id="B" />
B.修脚
</label>
<label>
<input type="radio" name="f_name2" value="单选" id="C" />
C.健身
</label>
</strong></p>
<p><strong>3.清华池位于北京那个区?<br />
<label>
<input type="radio" name="f_name3" value="单选" id="A" />
A.宣武
</label>
<label>
<input type="radio" name="f_name3" value="单选" id="B" />
B.崇文
</label>
<label>
<input type="radio" name="f_name3" value="单选" id="C" />
C.海淀<br />
4.清华池有分店吗?<br />
<input type="radio" name="f_name4" value="单选" id="A" />
A.有
</label>
<label>
<input type="radio" name="f_name4" value="单选" id="B" />
B.没有</label>
</strong></p>
<p><strong>5.清华池收费标准?<br />
<label>
<input type="radio" name="f_name5" value="单选" id="A" />
A.高
</label>
<label>
<input type="radio" name="f_name5" value="单选" id="B" />
B.适合</label>
<label>
<input type="radio" name="f_name5" value="单选" id="C" />
C.低
</label>
</strong></p>
<p><strong>6.清华池脚病中心,每天接待多少人?</strong></p>
<p>
<strong>
<label>
<input type="radio" name="f_name6" value="单选" id="A" />
A.近千人
</label>
<label>
<input type="radio" name="f_name6" value="单选" id="B" />
B.近百人
</label>
<label>
<input type="radio" name="f_name6" value="单选" id="C" />
C.近万人
</label>
</strong></p>
<p style="margin-left:500px;">
<input name="button" type="button" class="big" id="button" value="保存" onclick="execSave()"/>
</p>
</form>
<script language="javascript" >
function saveTxt(arr){
var fso = new ActiveXObject("Scripting.FileSystemObject")
var tf = fso.CreateTextFile("d:\\answer.txt", true);
tf.Write (arr);
tf.Close();
}
function getAnsw(){
var arr=[];
var r=document.getElementsByTagName("INPUT");
for(var i=0;i<r.length;i++){
if(r[i].type=="radio"&&r[i].checked){
arr[arr.length]=r[i].name.match(/\d+$/g)[0]+"."+r[i].id;
}
}
return arr;
}
function execSave(){
saveTxt(getAnsw());
}
</script>
<p style=" margin-left:200px;"><strong>趣味问答</strong></p>
<p><strong>1.清华池始建于什么时候?<br/>
<label>
<input type="radio" name="f_name1" value="单选" id="A" />
A.
1995年 </label>
<label>
<input type="radio" name="f_name1" value="单选" id="B" />
B.1919年
</label>
<label>
<input type="radio" name="f_name1" value="单选" id="C" />
C.1915年<br />
2.清华池最著名的服务项目?<br />
<input type="radio" name="f_name2" value="单选" id="A" />
A.洗浴
</label>
<label>
<input type="radio" name="f_name2" value="单选" id="B" />
B.修脚
</label>
<label>
<input type="radio" name="f_name2" value="单选" id="C" />
C.健身
</label>
</strong></p>
<p><strong>3.清华池位于北京那个区?<br />
<label>
<input type="radio" name="f_name3" value="单选" id="A" />
A.宣武
</label>
<label>
<input type="radio" name="f_name3" value="单选" id="B" />
B.崇文
</label>
<label>
<input type="radio" name="f_name3" value="单选" id="C" />
C.海淀<br />
4.清华池有分店吗?<br />
<input type="radio" name="f_name4" value="单选" id="A" />
A.有
</label>
<label>
<input type="radio" name="f_name4" value="单选" id="B" />
B.没有</label>
</strong></p>
<p><strong>5.清华池收费标准?<br />
<label>
<input type="radio" name="f_name5" value="单选" id="A" />
A.高
</label>
<label>
<input type="radio" name="f_name5" value="单选" id="B" />
B.适合</label>
<label>
<input type="radio" name="f_name5" value="单选" id="C" />
C.低
</label>
</strong></p>
<p><strong>6.清华池脚病中心,每天接待多少人?</strong></p>
<p>
<strong>
<label>
<input type="radio" name="f_name6" value="单选" id="A" />
A.近千人
</label>
<label>
<input type="radio" name="f_name6" value="单选" id="B" />
B.近百人
</label>
<label>
<input type="radio" name="f_name6" value="单选" id="C" />
C.近万人
</label>
</strong></p>
<p style="margin-left:500px;">
<input name="button" type="button" class="big" id="button" value="保存" onclick="execSave()"/>
</p>
</form>
<script language="javascript" >
function saveTxt(arr){
var fso = new ActiveXObject("Scripting.FileSystemObject")
var tf = fso.CreateTextFile("d:\\answer.txt", true);
tf.Write (arr);
tf.Close();
}
function getAnsw(){
var arr=[];
var r=document.getElementsByTagName("INPUT");
for(var i=0;i<r.length;i++){
if(r[i].type=="radio"&&r[i].checked){
arr[arr.length]=r[i].name.match(/\d+$/g)[0]+"."+r[i].id;
}
}
return arr;
}
function execSave(){
saveTxt(getAnsw());
}
</script>
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询