Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught SyntaxError: Invalid regular expression: /(^|\.)rails(\.|$)/: Stack overflow #490

Open
JohnMerlino2 opened this issue Apr 6, 2017 · 1 comment

Comments

@JohnMerlino2
Copy link

I have a select element which has a remote: true to my contacts controller. However, if one of the options is selected, then I want to cancel that remote call and invoke a different controller instead. In the ajax:beforeSend event, I check if the specific option is selected and then return false:

if( $select.val() == "1" ){
    $('.loading').hide();
    $select.find('option:selected') .trigger('change.rails');
   return false;

The return false works and the original ajax call is stopped. However, the selected option looks like this:

<option data-url="/contacts/edit_multiple" data-remote="true" data-type="html" data-method="post" data-params="filterable=Lead" data-toggle="modal" data-target="filterEdit" value="1">Edit/Delete Filter</option>

And when I trigger the change.rails event on it, I get the following error:

Uncaught SyntaxError: Invalid regular expression: /(^|.)rails(.|$)/: Stack overflow

Anyone know why this error occurs?

@wattry
Copy link

wattry commented Nov 1, 2019

I have the same problem it looks like a jQuery issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants