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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T14:25:56+00:00 2026-06-11T14:25:56+00:00

I know very well that this question is ask many time but some how

  • 0

I know very well that this question is ask many time but some how my problem is different and i didn’t find the solution.

Now comes on issue.

I have a an image,so whenever i click on to the image the pop up window is open and show the data.now i want to make this dynamic and wants that the data should be come according to the id.

here is my image code.:

<div id='contact-form'>

        <a href='#' class='contact'><img src="<?php echo base_url();?>/assets/images/pre.jpg" style="height:18px; width:18px"></a>
      </div>
        <!-- preload the images -->
        <div style='display:none'>
            <img src='<?php echo base_url();?>assets/images/img/contact/loading.gif' alt='' />
        </div>  


And on its click the ajax is called from js file here is the code of that js file:
//here the provider is controller and show_coupon_pre is a function which call the view having the data.
$.get("provider/show_coupon_pre", function(data){
                    // create a modal dialog with the data
                    $(data).modal({
                        closeHTML: "<a href='#' title='Close' class='modal-close'>x</a>",
                        position: ["15%",],
                        overlayId: 'contact-overlay',
                        containerId: 'contact-container',
                        onOpen: contact.open,
                        onShow: contact.show,
                        onClose: contact.close
                    });
                });

I have a table having no of records and each record having this type of image.where the user can click and get the preview in pop window.
But i want to show the data in pop up according to the row like for id=1 it should be show the data of id==1 and so on. now can you you guys please help me how can i pass this id to the js file by which i can fetch the required data.

I am working in codeignitor.

  • 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-11T14:25:57+00:00Added an answer on June 11, 2026 at 2:25 pm

    Simplest solution

    <table>
    <tr>
     <td><img class="banner" src="/image1.png" post_id="1"></td>
     <td>some other data 1</td>
    </tr>
    <tr>
     <td>
     <td><img class="banner" src="/image1.png" post_id="2"></td>
     <td>some other data 2</td>
    </tr>
    </table>
    

    Javascript:

    $('.banner').click(function() { 
      post_id = $(this).attr("post_id");
    
      // send your ajax with post_id
    } );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This question might seem very specific but I am in need of some ideas
Ok guys I know this question has been asked before but I am very
this question probably wont be explained very well and that's because I don't really
This is a stupid question, and I know it is, but for some reason
I know this code is super lame but it was working very well 'till
The title to this question isn't written very well. Sorry 'bout that. I'm curious
I just wanna ask this very trivial question, I do not know if this
I know this works very well: def locations(city, *other_cities): print(city, other_cities) Now I need
I have tried to ask a variant of this question before. I got some
This is a complete noob question, but I gotta ask it anyway I started

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.