Don't talk nonsense, go directly to the dry goods:
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title></title> <script src="http://code.jquery.com/jquery-latest.js"></script> <script type="text/javascript"> $(function () { //Display Word online $("#btn1").click(function () { $("#iframe1").attr("src", "http://view.officeapps.live.com/op/view.aspx?src=http://djk8888.3vdo.net/Doc/1.docx"); }); //Display Excel online $("#btn2").click(function () { $("#iframe1").attr("src", "http://view.officeapps.live.com/op/view.aspx?src=http://djk8888.3vdo.net/Excel/1.xls"); }); //Display PPT online $("#btn3").click(function () { $("#iframe1").attr("src", "http://view.officeapps.live.com/op/view.aspx?src=http://djk8888.3vdo.net/PPT/1.pptx"); }); }); </script> </head> <body> <form id="form1" runat="server"> <input type="button" id="btn1" value="在线显示Word" /> <input type="button" id="btn2" value="在线显示Excel" /> <input type="button" id="btn3" value="在线显示PPT" /> <br /> <br /> <div> <iframe id="iframe1" width="800" height="600" frameborder='no' border='0' marginwidth='0' marginheight='0' scrolling='no' allowtransparency='yes' src="http://view.officeapps.live.com/op/view.aspx?src=http://djk8888.3vdo.net/Doc/1.docx"></iframe> </div> <h3>Simple description:</h3> <p> Use the Office Online platform provided by Microsoft to view xls, doc, ppt and other documents online with only one URL<br /> <a style="color: blue; text-decoration:none;" href="http://view.officeapps.live.com/op/view.aspx" target="_blank"> http://view.officeapps.live.com/op/view.aspx?src=<span style="color: red;">Document address to view</span> </a> </p> <p> <b>This example document address:</b><br /> <a>http://djk8888.3vdo.net/Doc/1.docx</a><br /> <a>http://djk8888.3vdo.net/Excel/1.xls</a><br /> <a>http://djk8888.3vdo.net/PPT/1.pptx</a><br /> <a>No need to convert to Flash, PDF files, no swf player required</a> </p> </form> </body> </html>
Source code download: https://download.csdn.net/download/djk8888/10387384
Source code download: https://download.csdn.net/download/djk8888/10387384
Source code download: https://download.csdn.net/download/djk8888/10387384