javascript - Troubleshooting css background-image not loading -
i have code snippet below. expecting div have background logo. it's not happening. js files loaded correctly other parts of page work fine.
two questions:
1- using network sniffer don't see request logo.png. possible reasons why?
2- there way know url path browser using without using network sniffer? wanted know if should use ./
or ../
or whatever correct full path.
<script type="text/javascript"> $(document).ready(function() { $("#test").css("background-image", "somelongmultilevelpath/logo.png" ); }); </script> <div id="test"> </div>
try this:
$("#test").css("background-image", "url(somelongmultilevelpath/logo.png)" );
... assuming image path right.
Comments
Post a Comment