I have developed a basic calculator application using HTML, JavaScript, JQuery, and CSS. My intention is to allow others to embed this calculator app on their own web pages by utilizing a file named generate.js.
Within this file, there are several document.write() commands that output the HTML code for the calculator. However, I am encountering an issue with external resources hosted on my server such as images and libraries...
document.write("");
document.write("<link href=\"http:\/\/website.com\/config\/bootstrap.css\" media=\"screen\" rel=\"stylesheet\">");
document.write("<link href=\"http:\/\/website.com\/config\/bootstrap.min.css\" rel=\"stylesheet\"><!-- web fonts -->");
document.write("<link href=\"http:\/\/website.com\/config\/font-awesome.min.css\" rel=\"stylesheet\">");
document.write("<link href=\"http:\/\/website.com\/config\/style.css\" rel=\"stylesheet\" type=\"text\/css\">");
document.write("");
Although this code works, appending it to the body is not ideal practice...
This is new territory for me - is there a more effective or cleaner method to access the document headers and append these lines to them? Am I approaching this task incorrectly?
Furthermore, I wish to avoid using iframes for SEO reasons. Any guidance or recommendations would be greatly appreciated...