28
Views
7
Comments
Solved
[HTML To MS Word Converter] Why $ is not defined?
html-to-ms-word-doc-convertor
Reactive icon
Forge asset by Benjith Sam
Application Type
Reactive

Hi there,

I use this component HTMLtoDOc

Unfortunately got this error:

where did i go wrong?

regards and thanks

2019-01-07 16-04-16
Siya
 
MVP
Solution

The error "$ is not defined" typically occurs in JavaScript when you're trying to use jQuery, but the jQuery library has not been properly loaded or initialized.

This problem specifically occurs in OutSystems environments due to the removal of jQuery from the OutSystems UI framework starting with version 2.14.0. For more details on how this affects your projects and possible workarounds, refer to the discussion on OutSystems' forum: OutSystems UI Upgrade jQuery Issue.

2025-01-09 14-56-57
IQ78

Thank, Sir.

So, what i have to do to make it work.

regards

2019-01-07 16-04-16
Siya
 
MVP
Solution

One workaround is to integrate an earlier version of jQuery, like the one linked, into the 'HTML To MS Word Converter' library. After updating the library with this jQuery version, reference this script in 'Block' and republish.

This workaround is working for me in the test application bundled with this component.

Documents created with this method open in Microsoft Word, but not in Pages or Google Docs.



2025-01-09 14-56-57
IQ78

thanks, Sir.

 It works, but why one image is not shown (youtube logo), but the Neo Image is shown?

i also found if there in an image by HTML tag <img, like, the image is not found as well:

<img src='https://xxxxxx.com/uploads/docs-repo/MTA2Mg==/1681279082_24042211821681279081358.jpg' width='993' height='661'>

i am still confused, for other src: 

<p style='text-align: center;'><img crossorigin='anonymous' src='https://farm3.staticflickr.com/2220/1572613671_7311098b76_z_d.jpg' width='993' height='661'></p> 

it works only if i put the attribute: crossorigin='anonymous' - it is displayed and shown in the downloaded doc; if not put the crossorigin, it will be shown in the screen, but not in downloaded doc.

But for this one:

src='https://xxxxxx.com/uploads/docs-repo/MTA2Mg==/1681279082_24042211821681279081358.jpg' 

if i put that attribute, neither it is displayed in the Screen nor the downloaded doc. 

when try by putting directly in the chrome url, the first one only display the image (the xxxx), not downloaded, but  the second one (farm3) do download directly, may be it is a matter of:

Content-Disposition: attachment


regards

2019-01-07 16-04-16
Siya
 
MVP
Solution

It appears the YouTube logo, an SVG file, wasn't properly managed by the plugin. Opening the output in Notepad revealed a mismatch: the Content-Type was incorrectly listed as `image/png` for the SVG file, and the encoding is incorrect. 

To confirm this, the "ReactiveTestApp_UI.YoutubeLogo.svg" was downloaded, and its Base64 encoding was regenerated using an online converter. After updating the file with the new Base64 string and correcting the Content-Type to `image/svg+xml`, the file then displayed correctly in Microsoft Word.



Within the plugin, there's a file named "jquery_wordexport" where, regardless of the actual file type, it defaults to "image/png". For SVG files, it should instead specify "data:image/svg+xml".



The image at "https://xxxxxx.com/uploads/docs-repo/MTA2Mg==/1681279082_24042211821681279081358.jpg" appears to have been removed from the website, which is why it's not displaying.

The question, "Instead of having the document open when the button is clicked, can we place the document in a table for additional processing?" isn't entirely clear to me. btw you can customise the plugin to fit your need.

2025-01-09 14-56-57
IQ78

thanks, Sir

can we make the toDataURL to accept ("image/png", "image/jpg", etc)?

regards

2019-01-07 16-04-16
Siya
 
MVP
Solution

The error "$ is not defined" typically occurs in JavaScript when you're trying to use jQuery, but the jQuery library has not been properly loaded or initialized.

This problem specifically occurs in OutSystems environments due to the removal of jQuery from the OutSystems UI framework starting with version 2.14.0. For more details on how this affects your projects and possible workarounds, refer to the discussion on OutSystems' forum: OutSystems UI Upgrade jQuery Issue.

2025-01-09 14-56-57
IQ78

Thank, Sir.

So, what i have to do to make it work.

regards

2019-01-07 16-04-16
Siya
 
MVP
Solution

One workaround is to integrate an earlier version of jQuery, like the one linked, into the 'HTML To MS Word Converter' library. After updating the library with this jQuery version, reference this script in 'Block' and republish.

This workaround is working for me in the test application bundled with this component.

Documents created with this method open in Microsoft Word, but not in Pages or Google Docs.



2025-01-09 14-56-57
IQ78

thanks, Sir.

 It works, but why one image is not shown (youtube logo), but the Neo Image is shown?

i also found if there in an image by HTML tag <img, like, the image is not found as well:

<img src='https://xxxxxx.com/uploads/docs-repo/MTA2Mg==/1681279082_24042211821681279081358.jpg' width='993' height='661'>

i am still confused, for other src: 

<p style='text-align: center;'><img crossorigin='anonymous' src='https://farm3.staticflickr.com/2220/1572613671_7311098b76_z_d.jpg' width='993' height='661'></p> 

it works only if i put the attribute: crossorigin='anonymous' - it is displayed and shown in the downloaded doc; if not put the crossorigin, it will be shown in the screen, but not in downloaded doc.

But for this one:

src='https://xxxxxx.com/uploads/docs-repo/MTA2Mg==/1681279082_24042211821681279081358.jpg' 

if i put that attribute, neither it is displayed in the Screen nor the downloaded doc. 

when try by putting directly in the chrome url, the first one only display the image (the xxxx), not downloaded, but  the second one (farm3) do download directly, may be it is a matter of:

Content-Disposition: attachment


regards

2025-01-09 14-56-57
IQ78

Hi, Sir.

Instead of opening when the button is clicked, can we put the doc in table to further processing?

regards and thanks

2019-01-07 16-04-16
Siya
 
MVP
Solution

It appears the YouTube logo, an SVG file, wasn't properly managed by the plugin. Opening the output in Notepad revealed a mismatch: the Content-Type was incorrectly listed as `image/png` for the SVG file, and the encoding is incorrect. 

To confirm this, the "ReactiveTestApp_UI.YoutubeLogo.svg" was downloaded, and its Base64 encoding was regenerated using an online converter. After updating the file with the new Base64 string and correcting the Content-Type to `image/svg+xml`, the file then displayed correctly in Microsoft Word.



Within the plugin, there's a file named "jquery_wordexport" where, regardless of the actual file type, it defaults to "image/png". For SVG files, it should instead specify "data:image/svg+xml".



The image at "https://xxxxxx.com/uploads/docs-repo/MTA2Mg==/1681279082_24042211821681279081358.jpg" appears to have been removed from the website, which is why it's not displaying.

The question, "Instead of having the document open when the button is clicked, can we place the document in a table for additional processing?" isn't entirely clear to me. btw you can customise the plugin to fit your need.

2025-01-09 14-56-57
IQ78

thanks, Sir

can we make the toDataURL to accept ("image/png", "image/jpg", etc)?

regards

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.