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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T18:05:16+00:00 2026-06-12T18:05:16+00:00

I would like to load a twitter popup box in jquery using (ajax?) Here

  • 0

I would like to load a twitter popup box in jquery using (ajax?)

Here is my original code, which loads the twitter box in a new window:

function twitter_click() {
    var twtTitle = document.title;
    var twtUrl = location.href;
    var maxLength = 140 - (twtUrl.length + 1);
    if (twtTitle.length > maxLength) {
        twtTitle = twtTitle.substr(0, (maxLength - 3)) + '...';
    }
    var twtLink = 'http://twitter.com/home?status=' + encodeURIComponent(twtTitle + ' ' + twtUrl);
    window.open(twtLink,'','width=565, height=540');
}

Here is the code for the jquery popup box.

    function showUrlInDialog(url, options){
  options = options || {};
  var tag = $("<div></div>"); //This tag will the hold the dialog content.
  $.ajax({
    url: url,
    type: (options.type || 'GET'),
    beforeSend: options.beforeSend,
    error: options.error,
    complete: options.complete,
    success: function(data, textStatus, jqXHR) {
      if(typeof data == "object" && data.html) { //response is assumed to be JSON
        tag.html(data.html).dialog({modal: options.modal, title: data.title}).dialog('open');
      } else { //response is assumed to be HTML
        tag.html(data).dialog({modal: options.modal, title: options.title}).dialog('open');
      }
      $.isFunction(options.success) && (options.success)(data, textStatus, jqXHR);
    }
  });
}


<a href="#" onclick="showUrlInDialog('/feedback-form', {error: function() { alert('Could not load form') }}); return false;"><img src="twitter_button.jpg></a>

I don’t know anything about coding so if someone can please combine these two scripts so that the twitter content of the first script loads into the jquery popup script that would make my day! Thanks. Pia

  • 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-12T18:05:17+00:00Added an answer on June 12, 2026 at 6:05 pm

    Start by changing this:

    window.open(twtLink,'','width=565, height=540');
    

    to this:

    showUrlInDialog(twtLink, {error: function() { alert('Could not load form') }});
    

    Then to run it, use this:

    <a href="#" onclick="twitter_click()"><img src="twitter_button.jpg></a>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to load some content using AJAX and Shadowbox Basically I would
I would like to load a new extension in a symfony2 project for twig
$('#selector').click(function() { // here I would like to load a javascript file // let's
I would like load a different than English language locale for jQuery UI, while
I load a page, saw on twitter, using a line like this: [self.webView loadRequest:[NSURLRequest
I would like to load HTML using c#'s webbrowser component. I looked up MSDN,
I have six twitter user names which I would like to display on my
I would like to load some data stored in a file into my mysql
I would like to load a HTML document and modify it's text in PHP.
i would like to load xml into dataset with only 2 columns (name, price)

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.