What does include_plotlyjs=“cdn” do?

My goal is to generate an interactive html file from plotly fig and embed this html in my website. I was previously using fig.write_html(‘name.html’) , but in the generated HTML, there are some unwanted symbols like ampersands(&&). Now, I tried adding cdn like fig.write_html(‘name.html’, include_plotlyjs=“cdn”) , which solves the && problem but I have some questions about this:

  1. On using cdn, is my data still secured/private, and can there be some possible complications on embedding this html to my website?
  2. Is there any better/alternate way of removing the && symbols/cleaning the initial html file generated by plotly?

including cdn will just include js library to your html and apprently reduce size of file from 3.X MB to few KBs.
it is secure . you just need to make sure that you have internet connection on when viewing the html file as it will load plotly cdn from internet.

1 Like