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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T09:39:50+00:00 2026-06-03T09:39:50+00:00

I am using the code below for loading an external page into a lightbox.

  • 0

I am using the code below for loading an external page into a lightbox. How could I pass from the href tag, a variable named ‘page’ to the javascript (line 1) containing the value of a page link = ‘country.php’. I am wanting to use this script call several times without having to have additional javascript lines for each link.

<script>
$("a#selector").live("click", function(){$(".overlayInner").load("/country.php"); })
$("a#selector").live("click", function(){$(".overlayOuter").fadeIn(300); })
$("a#selector").live("click", function(){$(".overlayInner").fadeIn(500); })
$("a#selector").live("click", function(){$(".closepop").fadeIn(500); })
</script>


<a id="selector" href="#"><img src="/images/somegraphic.gif"></a>

Any help is much appreciated.

  • 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-03T09:39:51+00:00Added an answer on June 3, 2026 at 9:39 am

    Try this:

    $("a.selector").live("click", function() {
        var url = $(this).attr('href'); 
        $(".overlayInner").load(url);
        return false;
    });
    
    <a class="selector" href="/country.php">Country</a>
    <a class="selector" href="/pigs.php">Pigs</a>
    

    If you want to get the inner text that says “Country”, or an image you can do:

    $("a.selector").live("click", function() {
        var url = $(this).attr('href'); 
        var img = $(this).html(); // But what do you want to do with it?
        $(".overlayInner").load(url);
        return false;
    });
    
    <a class="selector" href="/country.php"><img src="img.jpg" /></a>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am loading a cell from a xib directly using code below but the
Using the code below (from a console app I've cobbled together), I add seven
I have a UITableView which loads data from XML using the below code. It
When my application is loading. I display a progress bar using the code below.
I am using the code below to get information from a database and make
I have a loading image that works using the code below. It shows the
I am using below code to display web page Uri uri = Uri.parse(http://myurl); Intent
I am loading url in android webview using below code webviewShowPost.loadUrl(URL); I want to
I am using the below code to use xml loading in jsfiddle.net $.ajax({ type:
I'm querying rows from my sqlite database using Fetch and loading the results into

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.