反应加载功能

问题描述

I was trying to embed something from a different website but what happened is when I'm embedding the code on my react js app it send an error saying expect }

<script type="text/javascript">
        rec_embed_js.load({
            widget_id:"rec_job_listing_div",page_name:"Careers",source:"CareerSite",site:"https://bsa-solutions-inc.zohorecruit.com",empty_job_msg:"No current openings"
        });
</script>

我在 jsx 文件添加了它,但它在加载函数后使用大括号向我发送了一个错误,我也尝试将括号更改为括号,但仍然没有

解决方法

将其更改为以下内容:

<script type="text/javascript">
    __html: 'rec_embed_js.load({
              widget_id:"rec_job_listing_div",page_name:"Careers",source:"CareerSite",site:"https://examplesite",empty_job_msg:"No current Openings"
            });
            `,</script>