Subj : Re: Equivalent in c/c++ to a simple javascript obj. To : netscape.public.mozilla.jseng From : Lau Lei Cheong Date : Sat Oct 23 2004 03:38 pm Sorry for overlooking the question. Basically, what you need is to Response.Write() the js code as string, or use RegisterStartupScript()/RegisterClientScript() to formally add it to the page. Note that by the first method, you'll need to add the code everytime the page is loaded/reloaded. With javascript, you can add/replace any properties/functions at runtime to fit your need. but beware to check is the object exist first so you won't overwrite any existing values. "Lau Lei Cheong" ¦b¶l¥ó news:clctbk$3g51@ripley.netscape.com ¤¤¼¶¼g... > Try to do it this way: > > > > By the above code, you have more or less the same as the following in C/C++: > > An object named 'myobj' is declared inherits 'obj_base' which has a property > 'x' as varient, which have a default value of 11. Then a function 'func1' > is added which will display the value of 'x' in the object. > > Javascript have no concept of private or public, and all variables are not > typed, so you can't set anything regarding these properties. > > "__PPS__" ??? > news:723debfe.0410201140.5688fe13@posting.google.com ???... > > Hi, > > could somebody post a simple c/c++ code (or explain in simple words > > which api needed) required to declare a js class, so that this class > > would be predeclared (like Array) > > for example simple js code: > > function MyClass(){ > > this.x; //public member; > > var y; //private member; > > z; //static member; > > } > > What is the equivalent c/c++ code? > > basicly each of the members might be a function, object, int etc, but > > for a simple example int (JS_Int or whatever) is ok. > > > > PS. I could execute a few strings of js code to make such a class > > declared, but I would like to know what is the code to make it in > > c/c++. > > > > > > Thanks > > .