WStoreyII wrote:
it there as way to build class library's of functions and stuff that can be
used in javascript likein vb.net or c#
WStoreyII
Sure. Create your objects with their associated methods and properties, put
them in a .js file and include them on your page with:
<head>
<!-- other stuff -->
<script type="text/javascript" src="MyDictionary.js"></script>
</head>
Then in MyDictionary.js you might have:
function MyDictionary() {
this.RemoveAll();
}
MyDictionary.prototype.RemoveAll = function() {
this.obj = {};
this.Count = 0;
}
MyDictionary.prototype.Add = function(key, value) {
if (this.obj[key] != null) {
return null;
}
this.obj[key] = value;
this.Count++;
return value;
}
MyDictionary.prototype.Exists = function(key) {
return (this.obj[key] != null);
}
// etc
And you could use it in your page like this:
<script type="text/javascript">
var y = new MyDictionary();
y.Add ("a", "test");
if (y.Exists("a")) {
document.write("a exists in MyDictionary");
}
</script>
--
| Grant Wagner <gw*****@agricoreunited.com>
* Client-side Javascript and Netscape 4 DOM Reference available at:
*
http://devedge.netscape.com/library/...ce/frames.html
* Internet Explorer DOM Reference available at:
*
http://msdn.microsoft.com/workshop/a...ence_entry.asp
* Netscape 6/7 DOM Reference available at:
*
http://www.mozilla.org/docs/dom/domref/
* Tips for upgrading JavaScript for Netscape 7 / Mozilla
*
http://www.mozilla.org/docs/web-deve...upgrade_2.html