1

In my form (form links are below, currently talking about form1) I have jquery.js included and it causes an error. Error is that it does not load doAjax and getIP functions which I have them in a js file called func - you may find it in source code (could not post more hyperlinks).

doAjax supposed to retrieve First and Lastname according to the input in the 1st field. getIP retrieves location based on IP

I also have Anytime date picker included in my form which I needed jQuery for.

When you open the form either in IE, in the first form, you will see that the location is not automatically picked and username field does not even say it is invalid which supposed to.

Forms seem not to work in FF right now which is BAD!

However, in this second form where I have not included jQuery.js, it actually returns IP and username. So, it works in the second one, but I can not use Anytime date picker since I don't have a jQuery.js included in the html.

Both of the forms will throw Done with an error on the left bottom side in IE which is solved when I don't include neither jQuery.js nor Anytime.js.

First form works well once F5 is clicked to refresh. But it is not how it supposed to work.

Any ideas how may I solve this?

makalele
  • 79
  • 1
  • 2
  • 10

1 Answers1

0

Have you looked at the error console in Developer Tools (F12)? It's reporting security exceptions:

SEC7118: XMLHttpRequest for http://www.yourdomain.com/resource required Cross Origin Resource Sharing (CORS). it.html

SEC7120: Origin http://www.yourdomain.com/resource not found in Access-Control-Allow-Origin header.

The problem appears to be that returnBuilding.php, which I assume makes the Ajax request, is coming from a different host than the Ajax request. Keep in mind that without CORS, the origin must be exactly the same, it is not simply the domain that is checked but the actual server name, scheme and port. If that's the case you'll have to either place the requesting URL and the requested URL on the same server, or add the Access-Control-Allow-Origin header to the response of your Ajax calls.

Davin Tryon
  • 66,517
  • 15
  • 143
  • 132
Andrew M. Andrews III
  • 1,989
  • 18
  • 23
  • Even though same form without jquery lib works well without CORS in IE? There are two files making ajax requests at the moment and they both do not work when jquery is included. UNTIL REFRESH – makalele Jul 24 '12 at 19:42