I've created a simple calculator app using HTML, Javascript, JQuery, and CSS. I would like for other people to be able to embedd the calculator app in their own pages - that being said, I created a file called generate.js
The contents of this file are pretty much a bunch of document.write() commands that spit out the HTML code that the calculator is made of. However, I have several external sources that are hosted on my own server (some images, libraries, etc)...
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("");
This is what I came up with, but the issue is that this code gets appended to the body, which is bad practice....
I've never done anything like this before - is there an effective/clean way to access the headers of a document and append those lines to it? Am I going about this the completely wrong way?
Also, I purposely do not want to use an iframe for SEO purposes. Any help/pointers are appreciated...