Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8694717
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T00:51:04+00:00 2026-06-13T00:51:04+00:00

I am trying to figure out exactly why this script wont work. I first

  • 0

I am trying to figure out exactly why this script wont work. I first thought it might be because of the div and the following ul, but it still wont work after assigning an additional ID to the ul. Really need to figure this out tonight, so all help is highly appreciated.

HTML

<div id="Home-Image">   

    <h1>Images</h1>
    <ul id="Home-Images">
        <li><a href="#"><img src="" width=100 height=100/></a></li>
        <li><a href="#"><img src="" width=100 height=100/></a></li>
        <li><a href="#"><img src="" width=100 height=100/></a></li>
        <li><a href="#"><img src="" width=100 height=100/></a></li>
        <button id="toggle-two">View more Images</button>
    </ul>

JavaScript

$(document).ready(function() {
var files = {'jpg':4};
var pageName = "d";
for (var ext in files){
for (var i = 0; i < files[ext]; i++){
var src = "../Images/D/allimages" + pageName + "-" + (i+1) + "." + ext;}
var img = new Image(); 
img.src = src;
var container = document.getElementById('Home-Images');
container.appendChild(img);
}});    
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T00:51:05+00:00Added an answer on June 13, 2026 at 12:51 am

    Maybe you want something like this

    $(document).ready(function() {
        var files = {'jpg':4}, pageName = "d", container = $('#Home-Images');
        for (var ext in files)
        {
            for (var i = 0; i < files[ext]; i++)
            {
                var src = "../Images/D/allimages" + pageName + "-" + (i+1) + "."+ext ;
                var img = $('<img src="'+src+'" width=100 height=100 />'); 
                container.append($('<li/>').html($('<a/>', {'href':'#'}).html(img)));
            }
        }
    }); 
    

    But make sure this path http://yourDomain/Images/D/allimagesd-1.jpg ​is right for all images.
    Here is a demo but images are not available but you can see the source by browser inspection tool.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So, I've been trying to figure out exactly why this isn't working but I
I'm trying to figure out what exactly Dependency Properties are, but when I look
I am trying to figure out what exactly is being processed in this simple
This isn't my code; I am trying to figure out what exactly this does.
I am trying to figure out how exactly arithmetic bit-shift operators work in C,
I am trying to figure out exactly what these new fangled data stores such
I am trying to figure out exactly how to implement a callback function which
I've been trying to figure out what exactly is happening here. I'm just trying
Just out of curiosity, I'm trying to figure out which exactly is the right
Trying to figure out how I can do this properly. The print_r looks like

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.