The cause of the problem is in the following line, in the jquery library
f (s.open(t.type, t.url, t.async, t.username, t.password), t.xhrFields)
t.url is where the difference occurs.
Understanding why that occurs is next. The t variable is from a closure, when w.ajaxTransport is called.
I can’t do this with minified jQuery anymore. It’s time to use the <base>
keyword to run code as if it was on your own website.
<base href="https://cms.ucd.ie/geary2020/research/">
...
<!-- webste_jquery-3.3.1.min.js / 413892 -->
<script src="https://code.jquery.com/jquery-3.3.1.js"></script>
That’s better.
Now with the uncompressed jQuery the error stems from line 9490, which is the options.url parameter
xhr.open(
options.type,
options.url,
options.async,
options.username,
options.password
);
The options are received when the jQuery ajaxTransport command is executed. Here is the definition of the ajaxTransport command.
jQuery.ajaxTransport( function( options ) {
The options come from line 8609:
var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );
Where we find originalOptions which also contains the host url.
That comes from line 8599:
// Base inspection function for prefilters and transports
function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {
Which come as options on line 9077
// Apply prefilters
inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
Where do those options come from?
The subscribe button has several event handlers associated with it, one being from webste_custom.js
$.ajax({
type: 'POST',
url: 'php/mailchimp-action.php',
data: {url:url},
dataType: 'json',
success: function(data){
$('#msg').html(data);
},
That is where the mailchimp url is coming from. Mailchimp is correctly doing what it should be doing, and is taking over the form submit event.
When plugin_path is enabled, you an error of:
jquery-3.3.1.js:3827 Uncaught TypeError: POTENZA.mailchimp is not a function
at HTMLDocument.<anonymous> (webste_custom_geary.js:1022)
That code among other things tries to run mailchimp, but it doesn’t exist.
//Document ready functions
$document.ready(function () {
POTENZA.megaMenu(),
POTENZA.counters(),
POTENZA.accordion(),
POTENZA.carousel(),
POTENZA.mailchimp(),
POTENZA.contactform(),
The custom geary code has the mailchimp function commented out of it.
/*************************
mailchimp
*************************
POTENZA.mailchimp = function () {
$(document).on('click','#mc-embedded-subscribe',function(event){
event.preventDefault();
...
And that is the cause of the problem.
If you intend for the mailchimp code to not execute, instead of commenting out the whole function, I recommend that you instead comment out the code that executes the function, which is found in the previous code block.