My project is hosted in a local web server.
Scenario A
When I try to access my test.html
file via file://
it gives me
XMLHttpRequest cannot load http://127.0.0.1:8887/images/main/2.jpg. No 'Access-Control-Allow-Origin' header is test.html:1 present on the requested resource. Origin 'null' is therefore not allowed access.
in chrome console but photo is rendered properly in the modal
Scenario B
But when I try to access test.html via http://127.0.0.1:8887
it doesn't log any console error and it prints
����JFIF���Photoshop 3.08BIM}720120601<�130528-0500Z Baltimore_ MD - MarylandeUSA - United States detbal-crime2 PKarl Merton FerronUBaltimore Sun Staffn Baltimore SunsNA.1zNA.1xbA Baltimore Police officer stands behind crime scene tape at the scene of a police-involved shooting following a dispatch for a burglary in progress, reported near S. Chester Street and Bank Street in southeast Baltimore. A suspect was shot, while another was taken into custody as investigators pore through evidence. (Karl Merton Ferron/Baltimore Sun) iPOLICE INVOLVED SHOOTINGgBAL1206011517048420�0:0:0:-00001� 8BIM�8BIM ��hhttp://ns.adobe.com/xap/1.0/ Baltimore MD - Maryland USA - United States Baltimore Sun Staff Baltimore Sun NA.1 NA.1 POLICE INVOLVED SHOOTING BAL1206011517048420 2012-06-01T13:05:28-05:00 A Baltimore Police officer stands behind crime scene tape at the scene of a police-involved shooting following a dispatch for a burglary in progress, reported near S. Chester Street and Bank S
instead of rendering the image in the modal.
I actually don't really understand what's happening. I am trying to debug my gallery viewer jQuery plugin using bootstrap. The proper rendering of image only happens in Scenario A using chrome.
Other Findings:
- When bootstrap css is not used, image is rendered properly
HTML (Scenario A)
<div class="modal-content">
<div class="modal-header" style="height: 41.79px;">
<h4>Case Media</h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close" aria-hidden="true"><span aria-hidden="true">×</span></button>
</div>
<div class="modal-body">
<div id="infopsy">
<div class="row iv-frame row-centered embed-responsive"><img class="img-responsive col-centered fadeIn" src="http://127.0.0.1:8887/demo/images/main/2.jpg"></div>
<div class="row col-height-equal">
<div class="vertical-align col-xs-1 col-sm-1 col-md-1 col-lg-1 iv-thumbcaret" data-iv-direction="left"><i class="fa fa-angle-left fa-4x" id="icon-angle"></i></div>
<div class="col-xs-10 col-sm-10 col-md-10 col-lg-10 iv-thumbnails row-centered">
<div class="col-xs-4 col-sm-3 col-md-2 col-lg-2 col-centered center-cropped"><a href="http://127.0.0.1:8887/demo/images/main/1.jpg"><img src="http://127.0.0.1:8887/demo/images/thumbnail/1.jpg" class="iv-thumbnail-current img-responsive" data-iv-index="0"></a></div>
<div class="col-xs-4 col-sm-3 col-md-2 col-lg-2 col-centered center-cropped"><a href="http://127.0.0.1:8887/demo/images/main/2.jpg"><img src="http://127.0.0.1:8887/demo/images/thumbnail/2.jpg" class=" img-responsive" data-iv-index="1"></a></div>
<div class="hidden-xs col-xs-4 col-sm-3 col-md-2 col-lg-2 col-centered center-cropped"><a href="http://127.0.0.1:8887/demo/images/main/3.jpg"><img src="http://127.0.0.1:8887/demo/images/thumbnail/3.jpg" class=" img-responsive" data-iv-index="2"></a></div>
<div class="hidden-sm hidden-xs col-xs-4 col-sm-3 col-md-2 col-lg-2 col-centered center-cropped"><a href="http://127.0.0.1:8887/demo/images/main/4.jpg"><img src="http://127.0.0.1:8887/demo/images/thumbnail/4.jpg" class=" img-responsive" data-iv-index="3"></a></div>
<div class="hidden-md hidden-sm hidden-xs col-xs-4 col-sm-3 col-md-2 col-lg-2 col-centered center-cropped"><a href="http://127.0.0.1:8887/demo/images/main/5.jpg"><img src="http://127.0.0.1:8887/demo/images/thumbnail/5.jpg" class=" img-responsive" data-iv-index="4"></a></div>
<div class="hidden-lg hidden-md hidden-sm hidden-xs col-xs-4 col-sm-3 col-md-2 col-lg-2 col-centered center-cropped"><a href="http://127.0.0.1:8887/demo/images/main/6.jpg"><img src="http://127.0.0.1:8887/demo/images/thumbnail/6.jpg" class=" img-responsive" data-iv-index="5"></a></div>
</div>
<div class="vertical-align col-xs-1 col-sm-1 col-md-1 col-lg-1 iv-thumbcaret" data-iv-direction="right"><i class="fa fa-angle-right fa-4x" id="icon-angle"></i></div>
</div>
</div>
</div>
</div>
I need to fix this rendering of image. If I know how google chrome manage to render the image despite of the warning, that would help