Problem with ajax calling for dns redundant url resolution

Problem with ajax calling for dns redundant url resolution

Hi, 
I've this code:

  1. var PUBLIC_URL = "http://localhost/smailer";

and appart of this, I call to jQuery ajax method as this:
  1. $.ajax(PUBLIC_URL + "/admin/ws/insertNewNode", .....);

But the ajax call is never done, due tries to connecto to http://<AN IP>/admin/ws/inserNewNode. Excepts localhost as shown in the code. Why jQuery or JS tries to solve the url before send the calling? Then the calling is never done due it fails de CORS (crossDomain, and I don't want to enable it). How can to correct this if I want still use for navigate my url as http://localhost? I have no entries in hosts windows files, so that's not the problem.
Many thanks,

Dani