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 8906739
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T02:43:58+00:00 2026-06-15T02:43:58+00:00

I have a list of files being displayed on a webpage. (browser based Python

  • 0

I have a list of files being displayed on a webpage. (browser based Python app using Cherrypy and Jinja2) What I would like is when a user clicks on one item of the list, for a nice little Jquery dialog box to pop up and provide them with additional information on whichever item they clicked on. I have the dialog box set-up and functioning, minus the specific information to go inside. This is where I need help.

I have written a Python script to create HTML files for each item in the list displayed on the page. How can I load, for example, foo.html when the user clicks on foo.pdf in the displayed list?

I have the following Javascript code (Courtesy of @Sander Roes):

$(document).ready(function(){
  $("#selectable").children("li").each(function() {
      $(this).mouseover(function(){
          $(this).css("background-color","#FECA40");
      });
      $(this).mouseout(function(){
          $(this).css("background-color","white");
      });
      $(this).click(function(){
          if (!$(this).data('dialog')) {
              $(this).data('dialog', 
                  $('<div />')
                      .load('whatever.html')    // <-- This HTML file should  
                      .dialog({autoOpen: false, // coordinate with user selection
                   show: "slide",
                               hide: "fade",
                       width: 500,
               height: 500})
              );
          }
          var dlg = $(this).data('dialog');
          dlg.dialog( "open" );
          return false;
    });
  });
});

My thought was to assign each item in the list a unique id then load the .html file based on that id, but I’m not sure about how to do it in Javascript, or if I even can/should do it in Javascript? Thank you!

Update:

The code provided by @user1598086 worked great. I also threw in that HTML5shiv for good measure. Not sure if it is needed or not, but figured it couldn’t hurt.

  • 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-15T02:43:59+00:00Added an answer on June 15, 2026 at 2:43 am

    You can use a data- attribute, instead of an id:
    http://ejohn.org/blog/html-5-data-attributes/

    For example:

    <li data-externalfile="whatever.html">Whatever</li>
    

    and then (assuming from your code you’re using jQuery),
    instead of .load('whatever.html') in your example, use

    .load(($this).attr("data-externalfile"))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a list of files that I would like analyze. They are all
I have a list of files on a server and would like to load
I have a long list of files and file extensions which I would like
I have a list of files like this: wgEncodeCaltechRnaSeqGm12878R1x75dFastqRep1.fastq.trim.tags.sam wgEncodeCaltechRnaSeqGm12878R1x75dFastqRep2.fastq.trim.tags.sam wgEncodeCshlLongRnaSeqGm12878CellPapFastqRd1Rep1.fastq.trim00.tags.sam wgEncodeCshlLongRnaSeqGm12878CellPapFastqRd1Rep1.fastq.trim01.tags.sam wgEncodeCshlLongRnaSeqGm12878CellPapFastqRd1Rep1.fastq.trim02.tags.sam wgEncodeCshlLongRnaSeqGm12878CellPapFastqRd1Rep2.fastq.trim00.tags.sam
I have a list of files that I'm trying to copy and move (using
i have a list of products that are being displayed in particular order. store
I have a list of data or quotes that are being displayed, I only
I have list of files which contain particular patterns, but those files have been
Let's imagine that I have list of files at host1 find /path/to -name *.jpg
I have a list of files in an array where the filename is the

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.