-2

I am loading image dynamically in javascript

<img src="adimg/autos/1393d702-ba09-47f9-9409-c8b904f370ed.jpg" style="width:50px;">

idimg is at the root of my app.

I an creating it like this

      for (i = 0; i < v.length; i++) {
            //" + v[i] + "
            //  $("#tr1 tbody").append($("<tr><td><img src='" + v[i] + "' style='width:50px;' /></td></tr>"));
            $('#tr1').append("<tr><td><img src='adimg/autos/1393d702-ba09-47f9-9409-c8b904f370ed.jpg' style='width:50px;' /></td></tr>");

        }

I have no idea why it's not displaying image. it's only displaying img placeholder

fc123
  • 898
  • 3
  • 16
  • 40

2 Answers2

0

Now try with this path :

  for (i = 0; i < v.length; i++) {
            $('#tr1').append("<tr><td><img src='/listhell/adimg/autos/1393d702-ba09-47f9-9409-c8b904f370ed.jpg' style='width:50px;' /></td></tr>");

        }
Vaibhav J
  • 1,316
  • 8
  • 15
0

If I'm correct, Internet Explorer 8 can't use the JavaScript .append function if the element is still being rendered. If you're testing if it works on IE8, try putting your entire script in $(document).ready(function(){ ... });. More info on this here

Community
  • 1
  • 1
Droes
  • 65
  • 1
  • 8