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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T22:20:31+00:00 2026-05-23T22:20:31+00:00

I have a click function that has a popup window that I need to

  • 0

I have a click function that has a popup window that I need to open once the ajax call is successful. I have tried setting async: false. I tried putting the popup in the ajax call but that makes the popup blocked by the browser. And my last attempt was to set a timeout until the ajax call completes and each with no luck. Any suggestions???

var currentStatus = "false";
var success = "false";

function waitForSuccess(){
    if (success == "false"){
        var t = setTimeout("waitForSuccess()", 300);
    }
    else{
        stopTimer(t);
        return "true";
    }
}
function stopTimer(t){
    clearTimeout(t);
}

 function checkReps(clicked){
$.ajax({
            cache: false,
            url: "chat_new_files/chat_new.php",
            success: function(data){
                       success = "true";
                    }
      });

$('#chatT').live('click', function (event) {
         success = "false";
             checkReps("true");
         var changed = waitForSuccess();
        if(changed == "true"){
                  BG.startChatWithIssueId('0', true);    //THIS IS THE POPUP
        }
});

I am thinking that my logic for this last attempt with the setTimeout is messed up. So any ideas on how to fix this or a brand new idea? Thanks!

  • 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-23T22:20:32+00:00Added an answer on May 23, 2026 at 10:20 pm

    You are over-complicating things:

    $('#chatT').live('click',function(){
        $.ajax({
            cache: false,
            url: "chat_new_files/chat_new.php",
            success: function(data){
                BG.startChatWithIssueId('0', true);
            }
        });
    });
    

    As far as the browser popup blocker issue, a simple work-around is to create a div which acts as a popup container, like <div id="popup"></div>. Inside that div you can add an iframe with the url being the same of what your oldskool popup was. Initially, give that div the CSS #popup { display:none; position:relative; z-index:99999; /* etc...*/ } Then in your click event, you simply show() or fadeIn() that div.

    Example, check out Colorbox – on the demo page, click the link that reads “Outside Webpage (Iframe)”

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

$('input[type=checkbox]').unbind().click(function(e){ $(this).attr('checked', true) return false; }); I NEED to return false because I have
I have this piece of code: $(#faq).click(function () { var url = $.get(faq, {
I have this jQuery which works fine $(li[id^='shop_id']).click( function () { alert(I clicked on
I have the following code making a GET request on a URL: $('#searchButton').click(function() {
I have the following code: <script type=text/javascript> $(document).ready(function() { $(#Save).click(function() { $.post(url, { data:
We have a client requirement that has stumped me, embarrassingly enough. The client has
I have a simple jQuery code that runs on a web page that has
I have a site that has a div with content and a navbar (looks
I have a UserControl that has some javascript I'd like to inject into a
I have a button that has its location generated dynamically via jquery: <a id=final_location

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.