如何在React组件JSX中嵌入Eventbrite iframe /脚本

时间:2019-08-20 05:15:40

标签: reactjs jsx eventbrite

以下是Eventbrite提供的“嵌入代码”。 如何在我的React组件中使用它?

<div id="eventbrite-widget-container-12345678901"></div>

<script src="https://www.eventbrite.com/static/widgets/eb_widgets.js"></script>

<script type="text/javascript">
    var exampleCallback = function() {
        console.log('Order complete!');
    };

    window.EBWidgets.createWidget({
        // Required
        widgetType: 'checkout',
        eventId: '12345678901',
        iframeContainerId: 'eventbrite-widget-container-69831741619',

        // Optional
        iframeContainerHeight: 425,  // Widget height in pixels. Defaults to a minimum of 425px if not provided
        onOrderComplete: exampleCallback  // Method called when an order has successfully completed
    });
</script>

0 个答案:

没有答案