首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > JavaScript >

大家帮帮忙啊快被老板骂死了!解决方案

2012-03-02 
大家帮帮忙啊!快被老板骂死了!地址:http://www.uniea.com/images_index/for-iphone.asp在ie浏览器下,点击d

大家帮帮忙啊!快被老板骂死了!
地址:http://www.uniea.com/images_index/for-iphone.asp

在ie浏览器下,点击download   就会弹出另存为的对话框,
但是在firefox下,就不好用了。
谁知道在firefox下,怎么做这种效果阿?
代码:
<!DOCTYPE   HTML   PUBLIC   "-//W3C//DTD   HTML   4.01   Transitional//EN "
"http://www.w3.org/TR/html4/loose.dtd ">
<html>
<head>
<meta   http-equiv= "Content-Type "   content= "text/html;   charset=gb2312 ">
<title> UNIEA   |   Images   for   iPhone </title>
<style   type= "text/css ">
body{text-align:center;background-image:url(../images/line.jpg)}
h2{font-family:Georgia,   "Times   New   Roman ",   Times,   serif}
h3{font-family:Georgia,   "Times   New   Roman ",   Times,   serif}
#container{width:802px;   background-color:#FFFFFF;margin:auto;}
a:link{color:#0033FF;}
.middle{text-align:center;}
.t2{float:left;text-align:right;width:50%;font-size:12px;line-height:15px;font-family:Arial,   Helvetica,   sans-serif;}
.t3{float:right;font-size:12px;line-height:40px;font-family:Arial,   Helvetica,   sans-serif;   width:50%}
#top{padding:0;margin:0}
#bottom{padding-top:15px;}
.title{text-align:center;padding-top:6px}
.type{font-family:Arial,   Helvetica,   sans-serif;   font-weight:800;font-size:12px;text-align:center}
.modelnumber{font-family:Arial,   Helvetica,   sans-serif;   font-size:12px;text-align:center}
.color{font-family:Arial,   Helvetica,   sans-serif;   font-size:12px;text-align:center}
.hand{cursor:pointer;}
</style>
<script   type= "text/javascript ">
<!--
function   runSave(){
if   (saveImg.location   !=   "about:blank ")window.saveImg.document.execCommand( "SaveAs ");
}
function   saveImgAs(url){
if(window.saveImg   &&   url)window.saveImg.location=url;
}
//-->
</script>
</head>
               
<body>


<div   id= "container ">
<div   id= "top "> <!--#include   file= "../logo.htm "--> </div>
<div   id= "middle ">

<div   class= "title ">
<h2> PRODUCT     IMAGES </h2>
</div>
<h3> For   iPhone </h3> </div>
<table   width= "96% "   align= "center "   >

                                            <tr   bgcolor= "#FFFFFF ">
                                                <%
While   Not   rs.EOF
if       i   mod       4=0       then    

%>

                                                <td> <table   cellspacing= "1 "   bgcolor= "#CCCCCC "   >
  <tr   bgcolor= "#ffffff "> <td> <div   class= "type "> <%=rs( "type ")%> </div> <div   class= "modelnumber "> <%=rs( "modelnumber ")%> </div> <div   class= "color "> <%=rs( "color ")%> </div> </td> </tr>


<tr   bgcolor= "#ffffff "> <td> <a   href= "images/bigpic_iphone/ <%=rs( "bigpic ")%> "   target= "_blank "> <img   src= "images/smallpic_iphone/ <%=rs( "smallpic ")%> "     border= "0 "width= "184 "   height= "99 "   /> </a> </td> </tr>
 
    <tr   bgcolor= "#ffffff "> <td> <br>
<div   class= "t2 "> 300dpi   Hi   Res </div>
<a   href= " "   > <div   class= "t3 "> <input   type= "submit "   class= "hand "   value= "download "       onclick= "saveImgAs( 'images/bigpic_iphone/ <%=rs( "bigpic ")%> ') "style= "   BORDER-TOP-STYLE:   none;text-decoration:underline;   BORDER-RIGHT-STYLE:   none;   BORDER-LEFT-STYLE:   none;   color:#0033FF;   BACKGROUND-COLOR:#FFFFFF;   BORDER-BOTTOM-STYLE:   none "   > </div> </a>
<br> <br> </td> </tr> </table> </td>
                                          </td>
                                            </tr>
 
                                            <tr   bgcolor= "#FFFFFF ">
                                                <%else

%>
                                            <td   > <table   cellspacing= "1 "   bgcolor= "#CCCCCC "   >
        <tr   bgcolor= "#ffffff "> <td> <div   class= "type "> <%=rs( "type ")%> </div> <div   class= "modelnumber "> <%=rs( "modelnumber ")%> </div> <div   class= "color "> <%=rs( "color ")%> </div> </td> </tr>
    <tr   bgcolor= "#ffffff "> <td> <a   href= "images/bigpic_iphone/ <%=rs( "bigpic ")%> "   target= "_blank "> <img   src= "images/smallpic_iphone/ <%=rs( "smallpic ")%> "     border= "0 "width= "184 "   height= "99 "   /> </a> </td> </tr>

    <tr   bgcolor= "#ffffff "> <td>
    <br>
<div   class= "t2 "> 300dpi   Hi   Res </div>
<a   href= " "   > <div   class= "t3 "> <input   type= "submit "   class= "hand "   value= "download "       onclick= "saveImgAs( 'images/bigpic_iphone/ <%=rs( "bigpic ")%> ') "style= "   BORDER-TOP-STYLE:   none;text-decoration:underline;   BORDER-RIGHT-STYLE:   none;   BORDER-LEFT-STYLE:   none;   color:#0033FF;   BACKGROUND-COLOR:#FFFFFF;   BORDER-BOTTOM-STYLE:   none "   > </div> </a>


<br> <br> </td> </tr> </table> </td>
                                         
   
                                                <%
  end   if
  rs.MoveNext
i=i+1

Wend
'end   if
%>
                                            </tr>
                                            <%
end   if
rs.close

Set   rs   =   Nothing

%>
</table>
<br>
<table   width= "96% "   align= "center "   >
    <%

Set   conn   =   Server.CreateObject( "ADODB.Connection ")
conn.open "driver={mysql   odbc   3.51   driver};database=uniea;server=p41mysql53.secureserver.net;uid=uniea;password=Website8 "        
Set   rs   =   Server.CreateObject( "ADODB.Recordset ")
sql=     "select   *   from   iphonefolioimages   "  
rs.open   sql,conn
i=1

if   Not   rs.EOF   then

%>
    <tr   bgcolor= "#FFFFFF ">
        <%
While   Not   rs.EOF
if       i   mod       4=0       then    

%>
        <td> <table   cellspacing= "1 "   bgcolor= "#CCCCCC "   >
                <tr   bgcolor= "#ffffff ">
                    <td> <div   class= "type "> <%=rs( "type ")%> </div>
                            <div   class= "modelnumber "> <%=rs( "modelnumber ")%> </div>
                            <div   class= "color "> <%=rs( "color ")%> </div> </td>
                </tr>
                <tr   bgcolor= "#ffffff ">
                    <td> <a   href= "images/bigpic_iphone/ <%=rs( "bigpic ")%> "   target= "_blank "> <img   src= "images/smallpic_iphone/ <%=rs( "smallpic ")%> "     border= "0 "width= "184 "   height= "99 "   /> </a> </td>
                </tr>
                <tr   bgcolor= "#ffffff ">
                    <td> <br>


                            <div   class= "t2 "> 300dpi   Hi   Res </div>
                            <a   href= " "   >
                            <div   class= "t3 ">
                                <input   name= "submit "   class= "hand "   type= "submit "style= "   BORDER-TOP-STYLE:   none;text-decoration:underline;   BORDER-RIGHT-STYLE:   none;   BORDER-LEFT-STYLE:   none;   color:#0033FF;   BACKGROUND-COLOR:#FFFFFF;   BORDER-BOTTOM-STYLE:   none "       onclick= "saveImgAs( 'images/bigpic_iphone/ <%=rs( "bigpic ")%> ') "     value= "download "   >
                            </div>
                            </a>   <br>
                            <br> </td>
                </tr>
        </table> </td>
    </tr>
    <tr   bgcolor= "#FFFFFF ">
        <%else

%>
        <td   > <table   cellspacing= "1 "   bgcolor= "#CCCCCC "   >
                <tr   bgcolor= "#ffffff ">
                    <td> <div   class= "type "> <%=rs( "type ")%> </div>
                            <div   class= "modelnumber "> <%=rs( "modelnumber ")%> </div>
                            <div   class= "color "> <%=rs( "color ")%> </div> </td>
                </tr>
                <tr   bgcolor= "#ffffff ">
                    <td> <a   href= "images/bigpic_iphone/ <%=rs( "bigpic ")%> "   target= "_blank "> <img   src= "images/smallpic_iphone/ <%=rs( "smallpic ")%> "     border= "0 "width= "184 "   height= "99 "   /> </a> </td>
                </tr>
                <tr   bgcolor= "#ffffff ">
                    <td>   <br>
                            <div   class= "t2 "> 300dpi   Hi   Res </div>


                            <a   href= " "   >
                            <div   class= "t3 ">
                                <input   name= "submit2 "   class= "hand "   type= "submit "style= "   BORDER-TOP-STYLE:   none;text-decoration:underline;   BORDER-RIGHT-STYLE:   none;   BORDER-LEFT-STYLE:   none;   color:#0033FF;   BACKGROUND-COLOR:#FFFFFF;   BORDER-BOTTOM-STYLE:   none "       onclick= "saveImgAs( 'images/bigpic_iphone/ <%=rs( "bigpic ")%> ') "     value= "download "   >
                            </div>
                            </a>   <br>
                            <br> </td>
                </tr>
        </table> </td>
        <%
  end   if
  rs.MoveNext
i=i+1

Wend
'end   if
%>
    </tr>
    <%
end   if
rs.close

Set   rs   =   Nothing

%>
</table>
<iframe   src= "about:blank "   name= "saveImg "   onload= "runSave() "   style= "display:none; "> </iframe>

</div>
</div>
<div   id= "bottom "> <!--#include   file= "../bottom.htm "--> </div>

</body>
</html>



[解决办法]
firefox过于 "标准 "以至不能实现
[解决办法]
哪个说的,可以实现
你只需要改变ContentType就可以了,ie是通过自身属性来自动判定的,而firefox呢稍微笨了点
要你来指示 :)

热点排行