0

I have create a simple web site using angularjs and bootstrap. In one page, I load a static image and I set some botton on this using bootbox.

When I run in local my site using

grunt serve

I see the image with the button on this. When I try to run my site using

http-server -p 9000

I can't see the image, I see only the bottom.

This is my code that load image and button in the HTML page:

<div class="row">
    <div class="col-lg-12">
        <img src="../maps/MappaWifi.jpg" alt="img_source" title="img_source" style='height: 100%; width: 100%; object-fit: contain'>
        <button class="btn btn-primary btn-xs Arduino1ZN" alt="Arduino1ZN" ng-click="mapsPageCtrl.Arduino1ZNCtrl()">Arduino1</button>
        <button class="btn btn-primary btn-xs Arduino2ZN" alt="Arduino2ZN" ng-click="mapsPageCtrl.Arduino2ZNCtrl()">Arduino2</button>

    </div>
</div>

I think that the problem is where I set the path. Thanks all for help.

2
  • Where is your root folder located? Where is the maps folder located in relation to the root folder of your server? Commented Oct 17, 2016 at 16:17
  • My root folder is /home/jarvis/documents/server and my folder that contains the map is /home/jarvis/documents/server/app/iot/maps, map is in the folder of the project Commented Oct 17, 2016 at 16:22

1 Answer 1

1

I think you are pointing your folder to the wrong path. So, you can try setting your src like the below code and it should work fine. As you mentioned your maps folder is /home/jarvis/documents/server/app/iot/maps I'm suposing it's your root folder is /home/jarvis/documents/server, then in relation to your root the maps folder should look like:

<img src="iot/maps/MappaWifi.jpg" ...
Sign up to request clarification or add additional context in comments.

6 Comments

Thanks, it return me the 404 error , image not found.
Where is the index.html file located?
It is in the folder /home/jarvis/documents/server/app
Can you try this path instead iot/maps/MappaWifi.jpg?
Which path? if i use /home/jarvis/documents/server/app, image is not load because it isnt define
|

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.