JavaScript的表导出到Excel表 [英] JavaScript table export to excel

查看:135
本文介绍了JavaScript的表导出到Excel表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经找到一种方法,以HTML表格导出到Excel,但我有问题,从网站到Excel导出的JavaScript表格导出。请帮我找到一种方法,该表导出到Excel中。

页,从那里我需要的信息:

www.jalgpall.ee/ players.php年= 2012&放大器;团队= 84&安培;球员= 28469和b = ML

本页面的JavaScript的示例表函数:

  JavaScript的:函数showPlayers(){
    XMLHTTP = GetXmlHttpObject();
    如果(XMLHTTP == NULL){
        警报(您的浏览器忽略了最低支持AJAX);
        返回;
    }
    VAR URL =?DB / getplayergame.php章= ellermaasoft;
    URL =网址+&放大器;球员=+的document.getElementById(客户)的价值。
    URL =网址+&放大器; SID =+的Math.random();
    URL =网址+&放大器;同期=+的document.getElementById(年)的价值;
    如果(的document.getElementById('焊接设备')。焊接设备){
        URL =网址+&放大器;网页=+的document.getElementById('焊接设备)tabber.activetab;
    }
    否则URL = URL +&放大器;网页= 0;
    xmlhttp.onreadystatechange = stateChanged;
    xmlhttp.open(GET,URL,真正的);
    xmlhttp.send(空);
 

解决方案

我发现自己的答案。

JavaScript函数得到了来自网页的信息:

<一个href="http://www.jalgpall.ee/db/getplayergame.php?reg=ellermaasoft&player=28469&&sid=0.1&year=2012&page=0" rel="nofollow">http://www.jalgpall.ee/db/getplayergame.php?reg=ellermaasoft&player=28469&&sid=0.1&year=2012&page=0

和从该页面我可以将数据导出直接到Excel,应用Excel>数据 - >从网络导出数据。

I have found a way to export HTML tables to Excel, but I'm having problem with exporting JavaScript table export from website to excel. Please help me to find a way, to export this table to Excel.

Page, from where i need the info:

www.jalgpall.ee/players.php?year=2012&team=84&player=28469&b=ML

Example of this page javascript table function:

JavaScript: function showPlayers() {
    xmlhttp = GetXmlHttpObject();
    if (xmlhttp == null) {
        alert("Your browser dosen't support AJAX");
        return;
    }
    var url = "db/getplayergame.php?reg=ellermaasoft";
    url = url + "&player=" + document.getElementById("customers").value;
    url = url + "&sid=" + Math.random();
    url = url + "&year=" + document.getElementById("year").value;
    if (document.getElementById('tabber').tabber) {
        url = url + "&page=" + document.getElementById('tabber').tabber.activetab;
    }
    else url = url + "&page=0";
    xmlhttp.onreadystatechange = stateChanged;
    xmlhttp.open("GET", url, true);
    xmlhttp.send(null);

解决方案

I found the answer myself.

The javascript function got its information from page:

http://www.jalgpall.ee/db/getplayergame.php?reg=ellermaasoft&player=28469&&sid=0.1&year=2012&page=0

and from this page I can export data straight to Excel, using Excel->Data->Export Data from Web

这篇关于JavaScript的表导出到Excel表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆