-
Sorry for this stupid question, but my experience with MDX is small. :-( I'm trying to integrate a Donation button into a .mdx page in Docusaurus, using the PayPal generated code:
I tried it in the Playground page and the error is Is there a way to fix this code to make it compile as .mdx? Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 4 replies
-
Your question seems to be more about adding arbritrary JavaScript via a <div id="donate-button-container">
<div id="donate-button"></div>
</div>
<script src="https://www.paypalobjects.com/donate/sdk/donate-sdk.js" charset="UTF-8"></script>
<script>{`
PayPal.Donation.Button({
env:'production',
hosted_button_id:'5MFRG9ZRBETQ8',
image: {
src:'https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif',
alt:'Donate with PayPal button',
title:'PayPal - The safer, easier way to pay online!',
}
}).render('#donate-button');
`}</script>
</div> |
Beta Was this translation helpful? Give feedback.
-
Using the fixed syntax made the code compile, however there probably must be another trick to make the code also run, since the Playground does not render the button. Since the above suggested code had a misplaced
Only the elements up to the violet rectangle are displayed. |
Beta Was this translation helpful? Give feedback.
-
The test was not performed in a website, but in the MDX Playground page. So the correct answer is that the Donation button generated by the PayPal page cannot be used as-is in a .mdx page. |
Beta Was this translation helpful? Give feedback.
The test was not performed in a website, but in the MDX Playground page.
So the correct answer is that the Donation button generated by the PayPal page cannot be used as-is in a .mdx page.