<script Language="javascript">
function file(filename){
  var   fso   =   new   ActiveXObject("Scripting.FileSystemObject");   
  if(fso.FileExists(filename))   
    return true;   
  return false;  
}function aaa(){
  filepath='1.jpg';  if(file(filepath))
    window.open(filepath,'mainFrame');
  else
    Response.write("没有相关信息");//这里能不能用response?不能的话应该怎么样呀?}
</script>

解决方案 »

  1.   

    <script   Language= "javascript " > 
    function   file(filename){ 
        var       fso       =       new       ActiveXObject( "Scripting.FileSystemObject ");       
        if(fso.FileExists(filename))       
            return   true;       
        return   false;     
    } function   aaa(){ 
        filepath= '1.jpg';;     if(file(filepath)) 
            window.open(filepath,'mainFrame'); 
        else 
            Response.write( "没有相关信息 ");//这里能不能用response?不能的话应该怎么样呀? 
    </script >
      

  2.   


            document.write( "没有相关信息 ");//这里能不能用response?不能的话应该怎么样呀? 或者在页面添加一个 <div id="myDiv"></div>
         document.getElementById("myDiv").innerText = "没有相关信息 ";