jQuery causing error on form submit

Hi everyone

I’m using some jQuery to build an action url on a form element. The code can be seen here:

The code works successfully to build the url but when I click submit I get the following error:

Uncaught Error: Syntax error, unrecognized expression: .
    at Function.b.error (footScripts.min.js:24)
    at b.tokenize (footScripts.min.js:24)
    at b.compile (footScripts.min.js:24)
    at b.select (footScripts.min.js:24)
    at b (footScripts.min.js:24)
    at Function.b.matches (footScripts.min.js:24)
    at Function._.filter (footScripts.min.js:24)
    at d (footScripts.min.js:14)
    at _.fn.init.filter (footScripts.min.js:24)
    at Object.success (footScripts.min.js:8813)

I have the following jQuery referenced in the head of the document:

<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>

But the errors mentioned above relate to another .js file (footScripts.min.js) located at the foot of the document. The jQuery code shown in the js fiddle is located before the footScripts.min.js on the page so I don’t know if there could be some conflict.

I did notice that the jQuery in footScripts.min.js is jQuery JavaScript Library v2.1.3, whereas the reference in the head of my page is 3.2.1. I tested with the lower version but I’m still getting the same error.

I wondered if someone could help troubleshoot this?

Thanks in advance.

The jsfiddle code that you showed us doesn’t seem to result in that error.

Where might we take a look at footscripts?

Actually we don’t need to look at footscripts.

After the code that uses the first jquery, use noconflict to remove the first jquery so that it won’t confict with the footscripts code.

<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script><script>
  // scripting code from the jsfiddle page
</script>
<script>
$.noConflict();
</script>
<script srcf="footscripts.min.js"></script>

Thanks for the reply,

Unfortunately the noConflict line didn’t help. I’m still getting the following error:

footScripts.min.js:24 Uncaught Error: Syntax error, unrecognized expression: .
    at Function.b.error (footScripts.min.js:24)
    at b.tokenize (footScripts.min.js:24)
    at b.compile (footScripts.min.js:24)
    at b.select (footScripts.min.js:24)
    at b (footScripts.min.js:24)
    at Function.b.matches (footScripts.min.js:24)
    at Function._.filter (footScripts.min.js:24)
    at d (footScripts.min.js:14)
    at _.fn.init.filter (footScripts.min.js:24)
    at Object.success (footScripts.min.js:8813)
b.error	@	footScripts.min.js:24
b.tokenize	@	footScripts.min.js:24
b.compile	@	footScripts.min.js:24
b.select	@	footScripts.min.js:24
b	@	footScripts.min.js:24
b.matches	@	footScripts.min.js:24
_.filter	@	footScripts.min.js:24
d	@	footScripts.min.js:14
filter	@	footScripts.min.js:24
success	@	footScripts.min.js:8813
k	@	footScripts.min.js:24
fireWith	@	footScripts.min.js:24
c	@	footScripts.min.js:25
(anonymous)	@	footScripts.min.js:26
load (async)		
send	@	footScripts.min.js:26
ajax	@	footScripts.min.js:25
submitForm	@	footScripts.min.js:8800
(anonymous)	@	footScripts.min.js:9015
dispatch	@	footScripts.min.js:25
q.handle	@	footScripts.min.js:24

Are you able to determine anything from the above information?

Nope. What will help is for us to be able to experience in our own browser, so that we can investigate the problem more fully.

Hi, I’ll just need to find out if I can show the page. I’m actually wondering if it has anything to do with the Ajax as it references this in the form element.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.