Note that there are some explanatory texts on larger screens.

plurals
  1. POLoad Twitter Box in Jquery box via Ajax
    text
    copied!<p>I would like to load a twitter popup box in jquery using (ajax?)</p> <p>Here is my original code, which loads the twitter box in a new window: </p> <pre><code>function twitter_click() { var twtTitle = document.title; var twtUrl = location.href; var maxLength = 140 - (twtUrl.length + 1); if (twtTitle.length &gt; maxLength) { twtTitle = twtTitle.substr(0, (maxLength - 3)) + '...'; } var twtLink = 'http://twitter.com/home?status=' + encodeURIComponent(twtTitle + ' ' + twtUrl); window.open(twtLink,'','width=565, height=540'); } </code></pre> <p>Here is the code for the jquery popup box.</p> <pre><code> function showUrlInDialog(url, options){ options = options || {}; var tag = $("&lt;div&gt;&lt;/div&gt;"); //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" &amp;&amp; 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) &amp;&amp; (options.success)(data, textStatus, jqXHR); } }); } &lt;a href="#" onclick="showUrlInDialog('/feedback-form', {error: function() { alert('Could not load form') }}); return false;"&gt;&lt;img src="twitter_button.jpg&gt;&lt;/a&gt; </code></pre> <p>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</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload