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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T07:00:51+00:00 2026-06-05T07:00:51+00:00

Language: PHP and jQuery What I’m trying to do is pop up a dynamic

  • 0

Language: PHP and jQuery

What I’m trying to do is pop up a dynamic link when a user clicks on it.
I don’t want the page to be opened in a new window though, but in a modal one which overlays on the current page.

So with javascript, when a user clicks on this link, the action is to find the link’s attr href and make a code for THAT link to be inside an iframe within the modal window.

The HTML with dynamic PHP link:

 <a href="http://www.facebook.com/share.php?u=<?php echo $root_url; ?>?id=<?php echo $rows['id']; ?>&title=<?php echo urlencode($rows['keyword']); ?>" style="border: none;" onclick="return false;" class="fblink" target="iframe"><img src="./img/Facebook.png" style="float: right; margin-top: 0px;" title="Share on Facebook" alt="Share on Facebook" id="<?php echo $rows['id']; ?>"></a>

The jQuery script:

    var makePop = function() {
    link = $(this).attr('href');
    return '<div class="the_box" id="box" style="display: block;"><a class="boxclose" id="boxclose"></a>
    <iframe src="' + link + '" height="500px" width="600px" id="" name="iframe"></iframe></div>';
    } // End of Function.

    $("a.fblink").click(makePop);

I don’t know how to make this happen… This is not working.
Anybody? :o)

  • 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-05T07:00:52+00:00Added an answer on June 5, 2026 at 7:00 am

    The following should provide what your looking for. However would need to consider issues such as same origin policy for the XHR ‘load’ call.

    See example at: http://jsfiddle.net/qeXea/2/
    Note: Due to same origin policy the iframe isn’t able to populate with the content, simply setup your own page on your website and use your own urls to view.

    HTML

    <a href="http://www.yoururl.com" onclick="launchUrl(this); return false;">Click Here</a>
    <div id="fade"></div>
    <iframe id="dialog" src=""></iframe>
    <script type="text/javascript">
    function launchUrl(owner) {
        $('#fade').show();
        var link = $(owner).attr('href');
        $('#dialog').load(link, function(response) {
            $('#dialog').show();
        });
    }
    </script>
    

    CSS

    #fade {
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 100;
        display: none;
        position: absolute;
        background-color: rgba(255, 255, 255, 0.5);
    }
    
    #dialog {
        top: 100px;
        left: 100px;
        width: 200px;
        height: 200px;
        z-index: 101;
        display: none;
        position: absolute;
    }
    

    Alternative

    HTML

    <a href="" onclick="launchUrl('http://www.yoururl.com'); return false;">Click Here</a>
    <div id="fade"></div>
    <iframe id="dialog" src=""></iframe>
    <script type="text/javascript">
        function launchUrl(link) {
            $('#fade').show();
            $('#dialog').load(link, function(response) {
                $('#dialog').show();
            });
        }
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Language: OO PHP 5+ DB: MySQL I am trying to insert data from a
I use the PHP language for file upload and want to know that the
I have a php page on which I show a jQuery alert when a
I'm currently trying to get my head around the jQuery language. I'm trying to
Language: PHP I have a form which asks users for their educational details, course
In an interpreted language like PHP it is possible in theory to set up
I came from PHP language(codeigniter), but now I learning ASP.Net MVC :) In PHP
I'm not familiar with this programming language,in PHP it's getcwd() .
After one week searching and converting many algorithm from other language into php to
i've been making web app's and working with various server side language like php,

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.