Uncaught SyntaxError: '' string literal contains an unescaped line break

I am using Ruby on Rails.

create.js.erb

$('#my_re_ap').html('<%= recaptcha_element('signup')%>');

but I am getting a Uncaught SyntaxError: '' string literal contains an unescaped line break error.

My view helper looks like this. I am using the recaptcha gem.

helper

  def recaptcha_element(event_name)
    if @show_checkbox_recaptcha
      content_tag :div, class: "pb-2" do
        recaptcha_tags
      end
    else
      recaptcha_v3(action: event_name, site_key: 'key123')
    end
  end

What is wrong with my syntax?

177 thoughts on “Uncaught SyntaxError: '' string literal contains an unescaped line break”

  1. I know this if off topic but I’m looking into starting my own weblog and was
    curious what all is required to get set up? I’m assuming having a blog like yours would cost
    a pretty penny? I’m not very web smart so I’m
    not 100% positive. Any tips or advice would be greatly
    appreciated. Cheers

    Reply
  2. My brother suggested I would possibly like this web site.
    He used to be totally right. This put up actually made my day.
    You can not believe just how so much time I had spent for this info!
    Thanks!

    Reply
  3. I do believe all of the concepts you have presented in your post.
    They are really convincing and will definitely work.
    Nonetheless, the posts are too short for beginners. May just you
    please extend them a bit from next time? Thank you for the post.

    Reply
  4. Having read this I believed it was extremely informative.

    I appreciate you taking the time and energy to put this informative article together.
    I once again find myself spending way too much time both reading and posting comments.
    But so what, it was still worth it!

    Reply
  5. After looking at a number of the blog articles on your web site, I honestly like
    your way of writing a blog. I saved as a favorite it
    to my bookmark website list and will be checking back in the near future.

    Take a look at my website too and let me know what you think.

    Reply
  6. After looking into a few of the articles on your
    web page, I honestly appreciate your way of blogging.
    I bookmarked it to my bookmark website list and will be checking back soon. Please check
    out my web site as well and tell me how you feel.

    Reply
  7. After exploring a handful of the blog posts on your website,
    I seriously appreciate your way of writing a blog. I book marked it to
    my bookmark website list and will be checking back in the
    near future. Please check out my website
    too and tell me your opinion.

    Reply
  8. Pingback: generic for viagra
  9. Pingback: viagra buy
  10. Pingback: sildenafil 50mg
  11. Pingback: canadian viagra
  12. Pingback: cialis tadalafil
  13. Pingback: viagra alternative
  14. Pingback: cialis generic
  15. Pingback: viagra connect
  16. Pingback: female viagra
  17. Pingback: cialis 10mg
  18. Pingback: viagra 100 price
  19. Pingback: free cialis
  20. Pingback: cialis pills
  21. Pingback: viagra pills
  22. Pingback: visual viagra
  23. Pingback: sildenafil citrate
  24. Pingback: viagra tablets uk
  25. Pingback: viagra substitute
  26. Pingback: viagra boys
  27. Pingback: herb viagra
  28. Pingback: viagra dosage
  29. Pingback: sildenafil tablets
  30. Pingback: viagra sildenafil
  31. Pingback: generic viagra
  32. Pingback: cialis alternative