+ Start a Discussion
Akanksha CullenAkanksha Cullen 

HTTP Javascript Error

Hey,

I had a question and I was hoping that someone could help me with it. I am trying to develop a custom a visualforce page and design the elements I am using in it such as, Charts, Tabs, etc. In my code, I am using a javascript which is hosted here : http://d3js.org/d3.v3.min.js

and using it in my code like this :
<apex:includeScript value="//d3js.org/d3.v3.min.js"/>

As it is on http and not on https, it's throwing me an error in the background as the attached picture says. Apparently, salesforce doesn't allow us to access scripts on "unsecure connection." 
User-added image

Is there any solution for this ?
Best Answer chosen by Akanksha Cullen
Rahul Sangwan7341Rahul Sangwan7341
Hi you have to add the url of website

Setup---> Security Controls -------> Remote Site Settings

and then add new Remote Site and in Remote Site URL provide your site url .If this still shows error as that particular url is not hosted on https

then save you code in js file and add it to static resources in salesforce. and then access that static resources on your vf page.


Please Select this as Best Answer if it helps to solve your issue.

All Answers

Rahul Sangwan7341Rahul Sangwan7341
Hi you have to add the url of website

Setup---> Security Controls -------> Remote Site Settings

and then add new Remote Site and in Remote Site URL provide your site url .If this still shows error as that particular url is not hosted on https

then save you code in js file and add it to static resources in salesforce. and then access that static resources on your vf page.


Please Select this as Best Answer if it helps to solve your issue.
This was selected as the best answer
Akanksha CullenAkanksha Cullen
I didn't want to download a js file as a static resourse and just wanted the url as it is even though it is not on https. Sadly, I had to download the js file in the end. Thanks for your answer.