Click here to Skip to main content
13,097,012 members (67,384 online)
Click here to Skip to main content

Stats

205.3K views
4.3K downloads
33 bookmarked
Posted 14 May 2010

Chapter 5: Creating Web Widget with HTML, CSS, and JavaScript

, 16 May 2010
Free chapter from the book: Developing Web Widget with HTML, CSS, JSON and AJAX
HelloWorld
images
bg.png
Thumbs.db
widget.gif
function WidgetCallback(JSONobject) {
    var wHelloWorld = JSONobject[0];
    var wHTML = "";

    wHTML += ('<center><div id="MyWidget" style="background-image:url(images/bg.png);width:' + wWidth + ';Height:' + wHeight + ';" >');
    wHTML += ('<br><br><img border="0" width="221" height="82" src="' + wHelloWorld.image_url + '">');
    wHTML += ('<br><a target="_blank" href="' + wURL + '" style="font-size:x-large;text-decoration:none;color:' + wFColor + '">');
    wHTML += ( wTitle + ' ' + wHelloWorld.text + '</a><br>');
    wHTML += ('</div></center>');

    document.getElementById('myFirstWidget').innerHTML = wHTML;
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author


You may also be interested in...

Pro
Pro
Permalink | Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.170813.1 | Last Updated 16 May 2010
Article Copyright 2010 by Raj Lal
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid