Remove Local Storage Item

Definition:

NDLLibrary.removeLocalStorageItem(itemName)

 

Description:

Delete an item of local HTML5 storage.

 

Parameters:

This function has one parameter:

itemName - Required

The name of the local HTML5 storage item whose contents you want to retrieve. The name is case-sensitive.

Note: This function does not use the default ndlParams object.

 

Returns:

true if local HTML5 storage is supported by the user's browser.

false if local HTML5 storage is not supported by user's browser.

 

Code Sample:

var itemName = "myStore";

return NDLLibrary.removeLocalStorageItem(itemName);

 

Notes:

The return value doesn't indicate whether the item has been deleted or not, only whether local HTML5 storage is supported.

 

Using as Predefined Action in Event:

When assigned to an Event as a predefined action, you will need to generate a JavaScript function and then edit the skeleton script created to specify the name of the storage item. Edit the automatically generated code:

return NDLLibrary.removeLocalStorageItem(ndlParams);

so it matches the two lines shown in the code sample above, replacing myStore with the storage item's name, leaving the double quotes around it.

Alternatively you can enter the item's name, in double quotes, directly in the original code, in place of ndlParams, e.g.:

return NDLLibrary.removeLocalStorageItem("myStore");

 

 


See also:

Set Local Storage Item

Get Local Storage Item