TechNet Script Center logo

Welcome to the TechNet Script Center Gallery!

Each contribution is licensed to you under a License Agreement by its owner, not Microsoft. Microsoft does not guarantee the contribution or purport to grant rights to it.

imageloop

(Community)
  • Average Rating (1)
  • Created by imageloop
  • Published on 11/8/2009
  • Tags: fun
Rate it:
 
 
 
 
 
Script Code
JavaScript
var kernelUrl = "http://widgets.clearspring.com/o/4af6b8c6a723f6a9/4af6b8c6a723f6a9/-/-TRK/1/lib.v3.js?onLoad=onLibLoad";
var kernel;

function trace(message)
{
	alert(message);
}


/**
* Callback for Clearspring share services; since sharing is asynchronous,
* we need to specify a callback function to interpret the results.
* 
* In this example, we're using share.get() below to return an embed tag.
*
* @see http://www.clearspring.com/docs/tech/apis/in-widget/share#share.get
*/
function shareCallback(status, result)
{
	if (status) {
		trace('An error occurred: ' + status);
	} else if (result.tag) {
		trace('Got embed tag: ' + escape(result.tag));
	} else {
		trace('No embed tag returned');
	}
}


function onLibLoad(k)
{
	kernel = k;

	
	// Send a custom event
	// @see http://www.clearspring.com/docs/tech/apis/in-widget/track
        kernel.track.event('Kernel loaded');
	

	
	// @see http://www.clearspring.com/docs/tech/apis/in-widget/context
	trace('You have viewed this widget ' + kernel.context.user.WIDGET_VIEWS + ' times');
	trace('You seem to be in ' + kernel.context.user.geo.getCountry());
	

	
	// Retrieves a new embed tag for this widget
	// @see http://www.clearspring.com/docs/tech/apis/in-widget/share
	// Uncomment the following line to see how it works:
	// kernel.share.get('tag', {}, shareCallback);
	

	

	
	// WARNING:
	// Do not publicly deploy a widget containing your user ID, as it can
	// be used to modify any of your widgets. Treat it like your password.

	// Updates widget's content template permanently. Use wisely!
	// @see http://www.clearspring.com/docs/tech/apis/in-widget/widget-1
	// To use this call, modify the following line to contain
	// 1. your own Clearspring user ID
	// 2. your desired content
	// and then uncomment it:
	// kernel.widget.update(YOUR-USER-ID, 4af6b8c6a723f6a9, {content: '<h1>insert your own content</h1>'});
	
}

document.write('<scr'+'ipt type="text/javascript" src="' + kernelUrl + '"></scr'+'ipt>');
Platforms
Windows Server 2008 R2 No
Windows Server 2008 No
Windows Server 2003 No
Windows 7 Yes
Windows Vista Yes
Windows XP Yes
Windows 2000 No
For online peer support, join The Official Scripting Guys Forum! To provide feedback or report bugs in sample scripts, please start a new discussion on the Discussions tab for this script.
Disclaimer The sample scripts are not supported under any Microsoft standard support program or service. The sample scripts are provided AS IS without warranty of any kind. Microsoft further disclaims all implied warranties including, without limitation, any implied warranties of merchantability or of fitness for a particular purpose. The entire risk arising out of the use or performance of the sample scripts and documentation remains with you. In no event shall Microsoft, its authors, or anyone else involved in the creation, production, or delivery of the scripts be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary loss) arising out of the use of or inability to use the sample scripts or documentation, even if Microsoft has been advised of the possibility of such damages.
Be the first to create a discussion.