How to load the Page and Image using jQuery

Asked

Viewed 38 times

0

I already have the code to load the page itself but the image of the pages are in a different folder then does not click next to the page, that’s the problem.

inserir a descrição da imagem aqui

<html>
       <head>
           
            <title>AwesomeMods</title>
    
            <meta charset="UTF-8">
            <meta name="viewport" content="width=device-width, initial-scale=1.0">
            <link rel="stylesheet" href="../../../CSS/Index.css">
            <link rel="stylesheet" href="../../../CSS/ModsPage.css">
       <script src="//code.jquery.com/jquery-1.10.2.js"></script>
          <script>
             $(function () {
                $("#aside").load("../../../Aside.html");
                $("#footer").load("../../../Footer.html");
                $("#header").load("../../../Header.html");
             });
          </script>
    
        </head>
        <body>
         
           <header id="header">      
         
         </header>
       
            <section>
                <h1 id="ModsTitle">Age of Empires Definitive Edition</h1>
                
                 
    
                <h2>Mods Graphics</h2>
                
                   <p>It is page contain all mods for this game, select your preferred mod and download.</p>
                
                <h3>Shaders</h3>
    
             <ul>  
                 <li id="shaders"><a href="PhotorealisticAgeOfEmpiresDE/PhotorealisticAgeOfEmpiresDE.html" id="download">PhotorealisticAgeOfEmpiresDE</a></li>
               
             </ul>
                      
            </section>
            
                <aside  id="aside">
             
            </aside>

            <footer id="footer">
           
            </footer>
        </body>
    </html>

Header

<html>
    <head>
        <title>TODO supply a title</title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
  
    </head>
    <body>
      <span id="foto">
            <img src="Imagens/SiteFoto.png" id="logo"> 
        </span>
    
        <nav>
            <a href="Index.html" id="menu">Home</a>
            <a href="Mods.html" id="menu">Mods</a>
            <a href="Donate.html" id="menu">Donate</a>

        </nav>
    </body>
</html>

Footer

<html>
    <head>
        <title>TODO supply a title</title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        
    </head>
    <body>
      <div id="container-594f03cb0dacb4bf20ac3ac0f313fc6f"></div>
            <div id="footerstyle">
            <ol> 
                <li><h3 id="separar">Mods Links</h3></li>                     
                <li id="links"><a href="https://reshade.me/" target="_blank" id="modlink"><img src="Imagens/Reshade Button.png" id="modlogo"> Reshade</a></li>
                <li id="links"><a href="http://enbdev.com/" target="_blank" id="modlink"><img src="Imagens/ENBSeries Button.png" id="modlogo">EnbSeries</a></li>
                <li id="links"><a href="https://www.moddb.com" title="Game Mod Development Home" target="_blank" id="modlink"><img src="https://media.moddb.com/images/global/moddb.png" alt="Mod DB - Change the Game" border="0" width="42" height="44" id="modlogo">Moddb</a></li>
                <li id="links"><a href="https://www.nexusmods.com/" target="_blank" id="modlink"><img src="Imagens/kisspng-the-elder-scrolls-v-skyrim-nexus-mods-borderlands-5b3803b53afeb3.6385348015303976212417.png" id="modlogo">Nexus Mods</a></li>
            </ol>
            <a href="https://www.youtube.com/channel/UCcALwpmzS7rZ3w0VczM4OJw" target="_blank"> <img src="Imagens/BannerSite.png" id="banner"> </a>
            </div>
    </body>
</html>
  • 1

    Do not use greetings or greetings, see what kind of behavior is expected from users? and [Mre] to prepare a good question!

  • Add one of those htmls that are loaded via jQuery and the project folder structure, which makes it easier to understand what is happening.

  • @Ready, I just made it

  • @Douglaslopes puts the syntax like this src="./Imagens/SiteFoto.png" and see if it works.

  • @Fábiomiranda It didn’t work

  • @Douglaslopes the correct there would be a structural organization of files and folders, so that these problems do not occur.

  • @gleisin-dev and how I should organize them ???

  • put the index/paged files according to the location of the images/style and etc. Ex: "my-image images.png" and "images upload-images.html" and in upload-images.html src="minha-imagem.png", and so on..

  • @gleisin-dev Actually I solved the problem by passing the absolute path of the whole domain url, I don’t know if it’s better way more worked.

  • @Douglaslopes Best way isn’t! Because if you need a domain change, you’ll have a lot of work to change it in the source code (especially if your project is large, even my friend... it will take work)

  • @gleisin-dev until not, if it leaves the absolute path in the database just change in the database, use in a variable. Easy enough to get around this issue if the project is big and needs to change everything.

Show 6 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.