Displaying 3Dmol output using local .pdb files on html pages
Description
When c&p-ing the code on the page How to Embed a 3Dmol Viewer in an html document, the example works perfectly. However, when replacing data-pdb='2POR' with data-href='/link/to/pdbfiles/myprotein.pdb', the 3Dmol Viewer is not displayed. When just replacing 2POR with /link/to/pdbfiles/myprotein.pdb the webpage is blank as well. Is displaying local .pdb files supported?
data-pdb is for specifying a pdb code. To specify a file use data-href to specify the URL to the file.
I used data-href but it is still not displaying local .pdb files.
Make sure your URL is correct and check the console for error messages. Here is an example that uses data-href to load a local file: https://3dmol.org/tests/auto/generate_test.cgi?test=test6
Of course "local" in this case means local to the webserver. Javascript can not access arbitrary files on the user's machine - that would be a Very Bad Thing.