I am currently trying to externalize some scripts to keep the clutter off my code. I put it in Notepad++ with no problems but every time I try to upload them on the static Tumblr uploader or the theme assets page I always come up with this message
Which is basically a message telling me that Tumblr uploader does not accept HTML files, where clearly the script is not an HTML and it's saved as a .js
file. I really don't understand what I am doing wrong, especially when other people seem to get it right and I know how it's preferable it is to externalize scripts.
For the record .css
files work perfectly without issue but it's always the .js
files where I run into problems.
Tumblr's way of checking for HTML is by looking for any kind of HTML tags. To work around this you just need to change anything that is like "<div>"
to "<" + "div" + ">"
and do the same for closing tags as well.
It's annoying but it's the only way around it.