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

  • SEARCH
  • Home
  • 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 362509
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T13:15:11+00:00 2026-05-12T13:15:11+00:00

Okay this is frustrating me to no end. I recently coded a page in

  • 0

Okay this is frustrating me to no end. I recently coded a page in JS for a buddy of mine who wants to display wedding pictures to a family to see which ones they’d like to purchase.

I used a for loop to count 1-904:

for (beginnum=1;beginnum<=904;beginnum++) { yada yada...

Then, I used adobe bridge to rename the camera files to be 1-904 and their thumbnails (1-904 + _thumb) and used the loop number to display 904 image spaces, and the correctly numbered picture:

[note:using <) in place of the usual open tag since the site wont display it]

IE…

document.write(beginnum + ":" + "<img src='pictures" + beginnum + "_thumb.jpg' />");

Opera…

document.write("<div>" + beginnum + ":" + "<img src='pictures" + beginnum + "_thumb.jpg' /></div>")

This all works perfectly in IE and Opera (with external CSS modifying the div to not line break).

I then created a function to call up the large version of the picture when clicked on.

The problem is, when I try and nest this function into the JavaScript generated HTML I would need four delimiters. I’ve heard ”’ or “”” or the &+numeric; work in some cases as a third and fourth but I can’t seem to get them to work… where I run into a problem is here…

[note:again using <) for open tag]

document.write("<a href='javascript:void(0); onClick=

Since I’ve already used up ” and ‘ I now have nothing left to use to call the function when a picture is clicked.

I usually don’t ask for any help, but this time I can’t think of anything else that should work… I assume maybe using JS to generate the HTML leaves me with ONLY 2 delimiters that will be recognized by the browser but I am not sure, anyone know for sure? Any fixes anyone can think of?

Thanks,
~Z~

  • 1 1 Answer
  • 3 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-05-12T13:15:11+00:00Added an answer on May 12, 2026 at 1:15 pm

    Maybe this will work

    for (i=0; i<904;i++)
    {
        document.write("<div class=\"DivClassName\"><img src=\"pictures_" + i + "thumb.jpg\" onclick=\"OpenAWindowAndDisplayTheBigPhoto(" + i + ")\"></div>");
    }
    

    Another approach: Suppose you put everything inside a <DIV id="mainDIV">

    var mainDIV = document.getElementByID("mainDIV");
    var div, img, a;
    for (i=0; i<904; i++)
    {
       div = document.createElement("DIV");
       div.className = "DivClassName";
       a = document.createElement("A");
       a.href = "javascript:void(0)";
       a.onclick = function() {OpenAWindowAndDisplayTheBigPhoto(i);};
       img = document.createElement("IMG");
       img.src = "pictures_" + i + "thumb.jpg";
       mainDIV.appendChild(div);
       div.appendChild(a);
       a.appendChild(img);   
    };
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Okay this question is very simple: I have a facebook page, and a website.
Okay this one's pretty straightforward. I'm creating a checkbox in my Page.xaml.cs file, and
Okay this is the css code I put on the master page so it
Okay, this is so frustrating now. I have a GridView with 9 columns. I
Okay this is going to be hard to explain. I have a page with
Okay this is definitely a n00b question but here goes. The way I understand
Okay this is definitley an easy question and a stupid one but since I
Okay this may be a simple question but I have yet to come with
Okay this is my 4th question today on Scheme, still pretty new to Scheme,
Okay this is werid, i keep getting the error, randomly. ValueError: matrix must be

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.