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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T20:10:23+00:00 2026-05-25T20:10:23+00:00

I have a great modal script I’m using, that loads a page via ajax.

  • 0

I have a great modal script I’m using, that loads a page via ajax. However the href is left blank. This means I’ll need to create a new id for each link. Is their a way to use this with just one script and have it load the correct link via ajax and have the title be the title in the link.
Here’s the script.

    <a id="ajax2" href="#" onClick="self.location=this.href; return false">
    $('#ajax2').click(function(){
        lightbox.alert({
            width: '400px',
            title: 'Gamerholic.com Sign Up/Log In',
            rightButtons: ['Close'],
            background: 'black',
            fade: 'false',

            opened: function(){
                $('<span />').load('./login.php').appendTo('#lbContent');
            },
            buttonClick: function(button){
                console.log(button);
            }
        });
    });
  • 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-05-25T20:10:23+00:00Added an answer on May 25, 2026 at 8:10 pm

    I dont really get your question. You want a dynamic link which gives a url and a title?

    i created a click on the class which grabs the href + title of the link and uses it in your code, is this what you mean?

    <a class="classname" href="./login.php" title="your title">
    

    you js:

    $('.classname').click(function(){
            var url = $(this).attr('href'); //get the attribute href
            var title = $(this).attr('title'); //get the attribute href
    
            lightbox.alert({
            width: '400px',
            title: title,
            rightButtons: ['Close'],
            background: 'black',
            fade: 'false',
    
            opened: function(){
                $('<span />').load(url).appendTo('#lbContent');
            },
            buttonClick: function(button){
                console.log(button);
            }
        });
        return false;
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a page which dynamically brings in a form via ajax and displays
I have a modal window that works great, and a jquery form that validates
I'm using a modal plugin ( colorbox ) that has an option onComplete .
I'm using the SimpleModal Jquery plugin and it works great! However, there are times
hi all i have this great code that i love that will display the
I have a fb.ui modal popup on my page to let users update their
I have implemented the Ajax Autocomplete feature in my application using a web service
I have a form that when the submit is hit i want a modal
1st post on stackoverflow, hope to have great feedback :) I'm currently trying to
I have a great deal of data to keep synchronized over 4 or 5

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.