why jquery isn't working for one site but same code is for another?

Joined
12 Feb 2006
Posts
17,311
Location
Surrey
i've got the jquery files located at mayergroup website, and all the other sites use the same code that references the files at mayergroup.

locally this works fine, however when online, i can't get the jquery to always work properly.

for instance, there is a feedback form that when viewed from mayergroup, once you submit the form, it'll fade away and say thanks.

from mayercleaning it does nothing, however the form still gets sent to us, just it remains for the customer and they think it's not been submitted.

any clue why this might be?

i can link to the sites if easier for you to see?
 
Soldato
Joined
28 Oct 2006
Posts
12,456
Location
Sufferlandria
It should show you in the developer tools what's going on. Check the network tab to see if the script loaded correctly and check the console tab to see if there's any errors shown.
If it loads correctly and there's no errors shown, it'll probably be a the order that they load in (eg you load it before you've loaded jQuery or something like that)
 
Soldato
Joined
28 Oct 2006
Posts
12,456
Location
Sufferlandria
Not sure what I need to do on those links? Do I click the Place Order button? That seems to work for me (but loads another page with a success message, not a jquery function)
 
Soldato
OP
Joined
12 Feb 2006
Posts
17,311
Location
Surrey
Yes place order. Then it shows a RATE YOUR EXPERIENCE form straight after. It's this form that's the issue

It's a test order so nothing will happen.

Once you submit that it should auto hide the form and say thanks. On mayer group it does this. On mayer cleaning it doesn't.

The form is being submitted as I'm getting the feedback, however as on one site it doesn't disappear then customers end up hitting submit 5 times and 5 coming through
 
Soldato
Joined
28 Oct 2006
Posts
12,456
Location
Sufferlandria
I see. This is the error I get when I try to submit the feedback form:
SZwkXzp.png

So the problem is that you're not able to post the form data from one site to the other.
2 way to fix this would be:
-Copy the /book-online/ratingsMailer.php file to the mayercleaning site and use it there.
-Add an Access-Control-Allow-Origin header to the response that file gives, this is the php code:
header("Access-Control-Allow-Origin: https://www.mayercleaning.co.uk");
It can go anywhere in the file before the response is sent.
 
Back
Top Bottom