2

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

Shown here

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.

garyh
  • 2,782
  • 1
  • 26
  • 28

1 Answers1

1

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.

chloe784
  • 609
  • 3
  • 15
  • 1
    Okay thank you so much. This really helps a lot and I will keep that in mind. Does that also apply to scripts that are downloaded from Github (like PXU). Would you have to change the HTML tags in those as well? I was asking because I downloaded a carousel slider a while back and tried to move the file to static tumblr and got the same error message. – shuntuationatseirin Jun 28 '17 at 14:05
  • 1
    It applies to anything you try to upload. The PXU Photoset script has HTML tags in it for captions so yes you would need to change those before uploading. Please accept this answer if it has answered your question :) – chloe784 Jun 28 '17 at 14:08
  • 1
    I will definitely take this into consideration. Thank you so much for your help. I learned a lot. – shuntuationatseirin Jun 28 '17 at 15:49