samedi 26 juin 2021

Image just won't load no matter what on HTML

What my dir looks like:

screenshot of dir

I've doubled checked the name, the location everything, but it just shows the default no image found icon image. My code for the picture is <img src="img.png">. I tried changing the image, still no fix. When I hover over the img.png is says [Follow link](file:///c:/Users/mathe/OneDrive/Documents/Data analysis/Python/CHAT-BOT/templates/img.png) (ctrl + click), so surely it should work?

Full html code:

<!DOCTYPE html>
<html lang="en" dir="ltr">
  <head>
    <meta charset="utf-8">

    <meta charset="utf-8">
    <meta http-equiv="x-ua-compatible" content="ie=edge">
    <meta name="description" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <title>MJChat Bot</title>

    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">

  </head>
  <body>
    <img src="img.png" alt="Italian Trulli">
    <div class="container">
      <h1>Welcome to MJ Chatbot</h1>
      <hr>
      <br>

        <div class="row">
          <div class="col-lg-9">
            <input class="form-control" type="text" name="question" id="question">
          </div>
          <div class="col-lg-3">
            <button class="btn btn-primary btn-block" id="submit-button">Send</button>
          </div>
        </div>
        <br>
        <div class="row">
          <div class="col">
            <p id="response"></p>
          </div>
        </div>

    </div>

    <script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
    <script>

      jQuery(document).ready(function() {

        $("#submit-button").click(function(e) {
          e.preventDefault();

          $.ajax({
            type: "POST",
            url: "/chatbot",
            data: {
                question: $("#question").val()
            },
            success: function(result) {
            $("#response").append("<br><br><img src='picture.jpg'/> You: "+$("#question").val()+ "<br><br><img src='picture.jpg'/> MJBot: "+result.response);
            $("#question").val("")
            },
            error: function(result) {
                alert('error');
            }
          });

        });

      });


    </script>
  </body>
</html>



Aucun commentaire:

Enregistrer un commentaire