Hello,
(1) After searching on the web I have see that the following are two
valid ways to link to an image in the static/images folder. However,
the first way is not working for me. Could this be because I deleted
all css files and js files (except jquery) that come with the Welcome
app? Please let me know if I should post more information.
background-image: url("{{=URL('static', 'images/roughcloth.png')}}");
/*This does not work*/
/*background-image:
url('/microeconslides/static/images/roughcloth.png');*/ /*This works
for me*/
For the option that does not work, Developer Tools in Chrome shows the
following error:
Failed to load resource: the server responded with a status of 400
(BAD REQUEST)
http://localhost:8000/microeconslides/static/css/%7B%7B=URL('static',%20'images/roughcloth.png')%7D%7D
(2) I use jquery to add some html images to the html file. The working code is:
$("section").each(function(index){
idtag = 's' + (index + 1)
$(this).attr('id', idtag);
$(this).append("<div class='nav'>\
<img
class='prev' src='/microeconslides/static/images/left_arrow.png'/>\
<img
class='next'
src='/microeconslides/static/images/right_arrow.png'/>\
</div>");
$(this).css('display', 'none' );
});
Is there a way to use {{=URL(...)}} to add links to the images instead
of the way I have done. I am not sure how to deal with the inverted
commas if the URL method is used. It seems one cannot use triple
quotes here and other ones are already used and will conflict.
Thanks for your help.