Ajax Call to Service produces Error ==> "Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https."

I'm trying to connect to a service outside our firewall but on our servers and I'm getting the following error:

Here is the code:

Not sure how I get around this? This is all new to me?

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Dave BaldwinFixer of ProblemsCommented:
I think it's saying that you need a "protocol scheme" in your URL like:
var url = "http://d53bhbweb001t0w:1001/,,,,,

Open in new window

And that's because it's not a "local file".
894359Author Commented:
Yes, I understand that but is that legal to do?
Dave BaldwinFixer of ProblemsCommented:
I think it is required for the AJAX code to know how to connect to a non-local file or program.  If it was 'local', it would normally use the same 'scheme' that was used to load the page it is on.
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

Brian DayhoffSenior Full Stack DeveloperCommented:
Ajax requires http protocol. So you need
var url = "http://..."

Open in new window

However this will choke on ssl. The safest way to sent ajax is to use this sort of prefix:

var url = "://..."

Open in new window

Which means "Use the same protocol I originated from.". If the remote host is using SSL, they will upgrade the insecure request automatically. If not, they will just take the http request as is.

The other protocols in the error body are for chrome-specific internal requests, and are not relevant to your issue unless you are writing a browser plugin that does not make external requests to anything other than google.
Julian HansenCommented:
If the service is outside your firewall - how is http://d53bhbweb001t0w:1001/ going to resolve - there is no tld in your URL?

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
894359Author Commented:
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.