0

I am now able to replace html text dynamically (How can I replace html text dynamically?), but I need the tweets to refresh when the inputQuery val replaces the text/caption/heading, too. IOW, I can change the text from, say, "jquery" to "html5" but the tweets I've got displaying remain the jquery tweets. How can I get that div to refresh? The content is in a jqueryUI tab, but that probably doesn't matter.

UPDATE

This is what I have:

$("#inputQuery").keyup(function (e) {
    if (e.keyCode == 13) {
        $("#Twitterpated h3").text(this.value);
        inputQueryText = this.value; 
        loadTweets(); // this concatenates the bits necessary, with inputQueryText in the middle (the "screen name" part)
    }
});

...and it doesn't work. That is to say, the text gets changed, and the concatenated twitterUrl is correct, but the page does not refresh.

I got to thinking - maybe the problem is that I'm not clearing the previous entries. How can I clear the html on the call to loadTweets()? I tried:

$("#Twitterpated h3").html("");

...and:

$("#Twitterpated h3").html().val("");

...to no avail.

Community
  • 1
  • 1
B. Clay Shannon-B. Crow Raven
  • 8,547
  • 144
  • 472
  • 862

1 Answers1

1

Not sure I understand but here's what I am thinking of...

When the value in inputQuery changed, refresh your tweets DIV the same way you first load it. Something like this should do the trick:

$('#inputQueryId').change(function () {
    // your code here, let's say:
    RefreshTweets($(this).val());
});
Baral
  • 3,103
  • 2
  • 19
  • 28