顯示具有 jquery 標籤的文章。 顯示所有文章
顯示具有 jquery 標籤的文章。 顯示所有文章

2016年4月19日 星期二

ckeditor 取得textarea欄位值

var str=CKEDITOR.instances.textname.getData();
alert(str);

textname為textarea欄位id或是name

2016年4月18日 星期一

Highcharts 好用的圖表套件

官方網站:http://www.highcharts.com/
官方說明文件:http://api.highcharts.com/highcharts#global
中文化說明文件:http://www.hcharts.cn/api/#yAxis.ceiling

可先至官方網站看想要用的樣式,點選進去後可以直接在線上觀看demo

2016年4月14日 星期四

filesaver.js 將html table的資料匯出成Excel

參考網址:http://kyleap.blogspot.tw/2015/08/filesaverjs-html-tableexcel.html

另外補充若需要將匯出文件(word)改成橫向,可增加  html-docx-js  這個js

參考網址1:https://github.com/evidenceprime/html-docx-js
參考網址2:http://evidenceprime.github.io/html-docx-js/


作法如下:
在<html>標籤增加一個id,之後js寫法如下

<script type="text/javascript">
    function Output()
    {
        var strFile = "檔案名稱.doc";
        var content = $('#id').html();
        var converted = htmlDocx.asBlob(content, { orientation: "landscape" });//此處參數請參考官網說明
        saveAs(converted, strFile);//輸出    
    }
</script>