You could probably start loading the TweetBox immediately on first visit but
hide it with CSS so it is quick loading when a user actually clicks on the
tweet button.

Abraham

On Wed, Apr 28, 2010 at 02:32, Adi <aditya.sa...@gmail.com> wrote:

> Hi all,
>
> I've got this use case:
>
> I have a button, clicking which opens up a tweet box with text
> defaulted by my application. Here's how I've implemented:
>
> 1. Have a "tweet" button.
> 2. On clicking tweet, call javascript method showTweetBox which
>  - 2.1 Makes ajax call to my application to fetch some text (default
> tweet text)
>  - 2.2 on successful ajax calls this (copied and modified from
> @anywhere documentation)
> -------------------------------------------------------------------
> twttr.anywhere(function (T) {
>            T(boxid).tweetBox({
>                  height: 40,
>                  width: 480,
>                  defaultContent: msg, // this is my default text
> obtained through ajax call dynamically
>                  label: "Tweet this video",
>                  onTweet: removeTweetBox
>                });
> -----------------------------------------------------------------------
>
> This whole thing takes quite some time (>15 seconds) for the "first
> time" to display the tweet box. In subsequent calls this thing is as
> fast as expected.
>
> The wait between pressing "tweet" and watching the tweet box appear
> for the first time when someone presses tweet is extremely long, and
> almost entirely taken up the anywhere function call (I checked with my
> ajax call - doesn't take any time).
>
> I understand this post has quite a few subjective elements (my
> browser, my net speed etc) but is there a way to speed up the
> "anywhere" call which replaces a <div> tag with the <iframe>
> containing the tweet box? Do you recommend some other way?
>



-- 
Abraham Williams | Developer for hire | http://abrah.am
@abraham | http://projects.abrah.am | http://blog.abrah.am
This email is: [ ] shareable [x] ask first [ ] private.

Reply via email to