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:

error
Here is the code:

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

Thanks!
894359Asked:
Who is Participating?

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

x
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".
1
894359Author Commented:
HI,
Yes, I understand that but is that legal to do?
0
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.
0
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.
0
Julian HansenCommented:
If the service is outside your firewall - how is http://d53bhbweb001t0w:1001/ going to resolve - there is no tld in your URL?
0

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:
Thanks!
0
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
JavaScript

From novice to tech pro — start learning today.