Undefined error when using jQuery word export plugin
<p>I am using a SAP UI5 application and trying to export table data into a word document but get an undefined error in document. I am using <code>jquery.wordexport.js</code> as in example <a href="http://www.jqueryscript.net/other/Export-Html-To-Word-Document-With-Images-Using-jQuery-Word-Export-Plugin.html" rel="nofollow">here</a>. My html code is as defined below</p>

<pre><code>&lt;head&gt;
    &lt;script src="FileSaver.js"&gt;&lt;/script&gt; 
    &lt;script src="jquery.wordexport.js"&gt;&lt;/script&gt; 
    &lt;script&gt;
        sap.ui.localResources("odataservice");
        var app = new sap.m.App({
            initialPage:"idodataservice1"
        });
        var page = sap.ui.view({
            id: "idodataservice1", 
            viewName: "odataservice.odataservice", 
            type: sap.ui.core.mvc.ViewType.XML
        });
        app.addPage(page);
        app.placeAt("content");
    &lt;/script&gt;
&lt;/head&gt;
&lt;body class="sapUiBody" role="application"&gt;
    &lt;div id="content"&gt;Hi&lt;/div&gt;
&lt;/body&gt;
</code></pre>

<p>The div content is having a table shown on screen and is not empty, on click of button I am calling below method</p>

<pre><code>onPressExport: function() {
    jQuery(document).ready(function($) {
        $("content").wordExport();
    });
},
</code></pre>

<p>I have added both files at the root level and export document does come in but with text 'undefined' written inside it. Tried checking the id at runtime in console and tried different sub div Ids as well but still get undefined error. Please suggest what could be wrong here or am I missing something.</p>