Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
430 views
in Technique[技术] by (71.8m points)

javascript - 我想在加载时在我的网站上显示特定的Microsoft Excel数据(I want to display specific Microsoft Excel data on my website on load)

I want my webpage to display specific Microsoft excel data inside a div on my website on load.

(我希望我的网页在加载时在我的网站上的div内显示特定的Microsoft Excel数据。)

So when the paged loads it displays the text of A1 inside DIV1.

(因此,在分页加载时,它会在DIV1中显示A1的文本。)

The way i have it now is as followed:

(我现在拥有的方式如下:)

<script type="text/javascript">
  function ReadData(cell, row) {
  var excel = new ActiveXObject("Excel.Application");
  var excel_file = excel.Workbooks.Open("C:\webdata\test.xls");
  var excel_sheet = excel.Worksheets("Sheet1");
  var data = excel_sheet.Cells("A,1").Value;
  document.getElementById('DIV1').innerHTML = data;
}
</script>

and it should display the data in the following div

(它应该在以下div中显示数据)

<div id="DIV1">
</div>

Hope someone can help me out and i can learn a thing or two :)

(希望有人可以帮助我,我可以学习一两件事:))

  ask by Jpvdo translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...