An async C# method that checks a URL is well formed and that the server answers, using a HEAD request.
private async Task<bool> UriExists(string url)
{
try
{
// Validate whether url has a valid uri pattern
if (!Uri.IsWellFormedUriString(url, UriKind.RelativeOrAbsolute))
Reassign an existing SharePoint 2010 workflow task to a different user with SPWorkflowTask.AlterTask.
using (SPSite site = new SPSite("http://myteamsite:2012/"))
{
using (SPWeb web = site.OpenWeb())
{
SPUser user = web.SiteUsers["myad\\administrator"];
SPListItem taskItem = web.Lists["Shared Documents"].Items[0];
Look the function up on window using its name, check it is a function, then call it with apply.
var functiontocall = "HelloWorld";
var fn = window[functiontocall];
if (typeof fn !== 'function')
return;
var retvalue = fn.apply(window, ["Amal Hashim"]);