1. I GUESS the reason you posted is that you got some error. You didn't say! We shouldn't have to guess.
2. Fix your file content. Your file content is NOT JSON:
- aliceblue #f0f8ff
- antiquewhite #faebd7
- aqua #00ffff
- aquamarine #7fffd4
- azure #f0ffff
- beige #f5f5dc
- bisque #ffe4c4
- black #000000
- blanchedalmond #ffebcd
- blue #0000ff
- blueviolet #8a2be2
- brown #a52a2a
- burlywood #deb887
3. Please don't use alert() to debug async code. Use console.log().
4. Inserting <style> in your document using Ajax will not do any good. The styles are read when the document is read. That train has left the station!
5. I don't get the point of this. Why not just make a CSS file, and load the CSS file at the top?
6. I can't guess what you are trying to accomplish here. Even were it possible to insert styles like this, it would just set the background color to the last one in the list. Each of your background-color rules overrides the previous.