views:

10

answers:

0

Below is the Javascript code used.

 google.load("elements", "1", {packages : ["newsshow"]});  
 function loadNews(newsQuery)
        {
            //Load the news feed according to the topic selected
            var options = 
            {
                "format": "300x250",
                "queryList" : 
                [
                    {
                        "title" : newsQuery,  
                        "q"     : newsQuery
                    }
                ]
            }
            var content = document.getElementById('content');
            var newsShow = new google.elements.NewsShow(content, options);
        }

The newsAddress value is a text box value entered by user. And based on the textbox value, the div element 'content' gets updated with a new element.

My problem is, every-time when I enter a value in text box (newsAddress), a news item in 'content' element is getting inserted one below the other. My requirement is to update the same news element based on the new search criteria.

How can this be done?