var str = "<div style='border-right: #455690 1px solid; border-top: #a6b4cf 1px solid; z-index: 99999; left: 0px; border-left: #a6b4cf 1px solid; width: " + w + "px; border-bottom: #455690 1px solid; position: absolute; top: 0px; height: " + h + "px; background-color: #c9d3f3'>"
        str += "<table style='border-top: #ffffff 1px solid; border-left: #ffffff 1px solid' cellspacing=0 cellpadding=0 width='100%' bgcolor=#cfdef4 border=0>"        str += "<tr>"
        str += "<td style='font-size: 12px;color: #0f2c8c' width=30 height=24></td>"
        str += "<td style='padding-left: 4px; font-weight: normal; font-size: 12px; color: #1f336b; padding-top: 4px' valign=center width='100%'>" + this.caption + "</td>"
        str += "</tr>"
        str += "<tr>"
        /*height:设置里面内容区域的高度 */
        str += "<td style='padding-right: 1px;padding-bottom: 1px' colspan=3 height=" + (h - 50) + ">"
        str += "<div style='border-right: #b9c9ef 1px solid; padding-right: 8px; border-top: #728eb8 1px solid; padding-left: 8px; font-size: 12px; padding-bottom: 8px; border-left: #728eb8 1px solid; width: 100%; color: #1f336b; padding-top: 8px; border-bottom: #b9c9ef 1px solid; height: 100%'>" + this.title + "<br><br>"
        str += "<div style='word-break: break-all' align=left><a href='javascript:void(0)' hidefocus=false id='btcommand'><font color=#ff0000></font></a>  <a href='tencent://message/?uin=35501547&site=http://hi.baidu.com/lupeng0527&menu=yes' hidefocus=false id='ommand'><font color=#ff0000></font></a></div>"
        str += "</div>"
        str += "</td>"
        str += "</tr>"
        str += "<tr align=center>"
        str += "<td colspan=3>"
        str += "<div style='padding: 2 0 2 0;'><embed src='js/03.wav' autostart='true'  loop='false' hidden='true'></embed>"
        str += "<span id='buttonClose'><input type='button' title=关闭 value=确认 style='width:60px; height:20px; border-right: #002D96 1px solid; padding-right: 2px; border-top: #002D96 1px solid; padding-left: 2px; FONT-SIZE: 12px; filter: progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr=#FFFFFF, EndColorStr=#9DBCEA); border-left: #002D96 1px solid; CURSOR: hand; color: black; padding-top: 2px; border-bottom: #002D96 1px solid;'></span>"
        str += "</div>"
        str += "</td>"
        str += "</tr>"
        str += "</table>"
        str += "</div>"
        oPopup.document.body.innerHTML = str;我就是做了一个右下角提示框的功能,然后提示框弹出来的时候有声音,声音的路径就是红色字的地方,在本地VS调试的时候都是可以播放声音的,但是当我发布到iis,然后通过ie去访问,就没有声音了 这个是为什么啊?

解决方案 »

  1.   

    声音文件有吗,发布上去的路径正确吗?设置iis 的MiME类型了吗?
      

  2.   


    IIS是7.5 的 我看过mime 是有这个wav的  然后因为这个是生成的一个popup的innerhtml,所以那个上面代码里面的src就是相对于生成popup的页面的地址,我在本地都是可以的 就是在服务器上面不行
      

  3.   


    有可能是路径的问题,先做一个页面,不用生成的,页面地址和popup的一样,里面方式能播放的代码,看能不能正常播放,再进一步往下做
      

  4.   


    原来用的embed标签里面嵌入声音文件  后来改用bgsound标签了 可以听到了..但是还有其他的问题..不过谢谢你了
      

  5.   

    给楼主个方法       public static string wma(string url, int width, int height)
            {
                System.Text.StringBuilder sb = new System.Text.StringBuilder();            sb.Append("<object   id=\"WMPlay\"   classid=\"clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95\"   style=\"Z-INDEX:   101;   LEFT:   40px;   WIDTH:   240px;   POSITION:   absolute;   TOP:   32px;   HEIGHT:   248px\"   >");
                sb.Append("<param   name=\"Filename\"   value=\"" + url + "\">");
                sb.Append("<param   name=\"PlayCount\"   value=\"1\">");
                sb.Append("<param   name=\"AutoStart\"   value=\"0\">");
                sb.Append("<param   name=\"ClickToPlay\"   value=\"1\">");
                //sb.Append("<param   name=\"DisplaySize\"   value=\"0\">"); 
                sb.Append("<param   name=\"ShowControls\" value=\"0\">");  //<!--是否显示控制,比如播放,停止,暂停-->
                sb.Append("<param   name=\"EnableFullScreen   Controls\"   value=\"1\">");
                sb.Append("<param   name=\"ShowAudio   Controls\"   value=\"1\">");
                sb.Append("<param   name=\"EnableContext   Menu\"   value=\"1\">");
                sb.Append("<param   name=\"ShowDisplay\"   value=\"1\">");
                sb.Append("</object>");
                return sb.ToString();        }