I got a class (SiteLoader) that one of its properties is another class(LocalStorage_Helper).
I'm testing the small API I made, but I'm getting "LocalStorage_Helper is not defined" error, and I have no idea why.
Here is the class that uses LocalStorage_Helper and the parts that are using the object:
/// <reference path="localSotrageHelper.js" /> // -- refrence to the js file
function SiteLoder(_storageName) {
this.theList = new Array();
this.storageHelper = new LocalStorage_Helper(_storageName); --HERE is where i get the error
}
//Add_theList_ToStorage
SiteLoder.prototype.Add_theList_ToStorage = function () {
this.storageHelper.AddItem(this.theList);
}
//Get_theList_FromStorage
SiteLoder.prototype.Get_theList_FromStorage = function () {
this.theList = this.storageHelper.GetItem();
}
I'm using SiteLoader like so, on the html file:
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<script src="SiteLoader.js" type="text/javascript"></script>
<script>
var Loader = new SiteLoder("sites"); // Error is thrown when i open the html
function setStoregeTest() {
Loader.PupolateListFrom_UL("list");
Loader.Add_theList_ToStorage();
}
function showStoregeTest() {
Loader.Get_theList_FromStorage();
Loader.WriteListTo_UL("list");
}
</script>
</head>
<body>
<ul id="list" contenteditable="true">
<li></li>
</ul>
<input type="button" value="set" onclick="setStoregeTest()" />
<input type="button" value="get" onclick="showStoregeTest()" />
</body>
</html>
- Why I do get an error?
- Do I need to initiate LocalStorage_Helper in a different way?