1

I want to load a placeholder image using holder.js in a static template. In static template index.html I have:

<img src="/static/holder.js/200x200">

I have handlers set in app.yaml for serving static files in a folder called static, so I know that's not a problem, but for some reason holder.js will not generate the 200x200 image I called for (the log files generate a 404 error). I bet this is some sort of handler issue; perhaps App Engine is treating my request as a directory and cannot find it. I need to configure the app.yaml file so that it treats requests to holder.js as a parameter for the file and not as a subdirectory of the file. Can someone point me in the right direction to help solve this problem?

6
  • Are you including the script as well? Commented Aug 28, 2014 at 17:04
  • Do I have to do add a script handler separately from the directory handler? Commented Aug 28, 2014 at 18:11
  • No, I meant in your template. Do you have <script src="/static/holder.js"></script>? Commented Aug 28, 2014 at 18:30
  • Yes, I do have the script included. Does its position in the document matter? Commented Aug 28, 2014 at 19:03
  • It shouldn't. What happens if you go directly to /static/holder.js in your browser? Commented Aug 28, 2014 at 19:05

1 Answer 1

1

When using Holder.js, the src attribute isn't meant to be used as a real URI. Instead, it's used as an identifier for Holder.js (specifically the domain option). Your code should look like this: <img src="holder.js/200x200"> or <img data-src="holder.js/200x200">. Make sure to include <script src="/static/holder.js"></script> in the document as well.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.