473,811 Members | 2,971 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Please explain difference in ways to construct a javascript editor

I've compared some open-source javascript editors, and found different
techniques for constructing the code. Two examples:

CodePress.run = function() {
new CodePress(t[i]);
}

CodePress = function(obj) {
self.initialize = function() {}
self.toggleLine Numbers = function() {}
self.getCode = function() {}
}
-----------------------------------------------
function widgInit() {
new widgEditor(text area.id)
}

function widgEditor(id) {
this.theToolbar = new widgToolbar(thi s);
}

function widgToolbar(the Editor) {}
widgToolbar.pro totype.addButto n = function() {}
widgToolbar.pro totype.setState = function() {}
-----------------------------------------------

Could somebody explain to me the difference in the first method, which
defines one object that holds all methods in one class (as I
understand it) and the second method, which uses prototype functions.
I am confused because I thought that prototype functions were only
used to extend methods on strings and arrays. Please enlighten me :-)
All help is greatly appreciated.
Dec 30 '07 #1
1 1472
Thomas 'PointedEars' Lahn said the following on 12/30/2007 8:04 PM:

<snip>
Much you have to learn, young apprentice.[tm]
<URL: http://en.wikipedia.or g/wiki/Idiot>

--
Randy
Chance Favors The Prepared Mind
comp.lang.javas cript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Dec 31 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
1794
by: Tank | last post by:
I have had this post up here when i was trying to figure out how to make leading zeros and have been able to fudge that to work. I am now have trouble getting the loop that makes the folders to start fresh after the .jpg section of the move images code. this will be essential to make the whole thing work. Please help. Even if you just write out the solution. I am beggin. I am desperate. Please help. <!DOCTYPE HTML PUBLIC...
8
2165
by: Chris Sharman | last post by:
See the bottom of http://www.prestonbridge.pwp.blueyonder.co.uk/index2.htm (4th line of the club officers section). The mark-up's validated html 4 & css, but in ie5.0/Win2000 my surname disappears, leaving just "web author: chris (big space) <myemail.gif>". It's ok (afaik) in other browsers, and even other versions of ie. I tried a lot of variations, and eventually found a workaround (at index.htm) which appears to work, but I'd really...
21
3026
by: b83503104 | last post by:
Hi, Can someone tell me the difference between single quote and double quote? Thanks
5
3615
by: KathyB | last post by:
If someone could just explain this to me...I just don't get it! I have an aspx page where I retrieve several session variables and use xmlDocument to transform xml file with xsl file into an instruction document (not data based) - same as using an xml web control. The resulting html is on the client? but what about the server side of things? Trying to figure out how to change and save the xmlDocument. It I put a button OUTSIDE of the...
39
2620
by: gtippery | last post by:
Newbie-ish questions - I've been away from C for a _long_ time. It seems to me that there ought to be easier (or at least shorter) ways to do what this does. It does compile & run for me (with PowerC, a 16-bit DOS compiler); if there are nonstandard or "accidentally-works" aspects, please let me know. {This is the sort of situation where if I knew *what* to Google for, I wouldn't *need* to... <grin>}
1
9667
by: David Van D | last post by:
Hi there, A few weeks until I begin my journey towards a degree in Computer Science at Canterbury University in New Zealand, Anyway the course tutors are going to be teaching us JAVA wth bluej and I was wondering if anyone here would be able to give me some tips for young players such as myself, for learning the language. Is this the best Newsgroup for support with JAVA?
118
6761
by: 63q2o4i02 | last post by:
Hi, I've been thinking about Python vs. Lisp. I've been learning Python the past few months and like it very much. A few years ago I had an AI class where we had to use Lisp, and I absolutely hated it, having learned C++ a few years prior. They didn't teach Lisp at all and instead expected us to learn on our own. I wasn't aware I had to uproot my thought process to "get" it and wound up feeling like a moron. In learning Python I've...
2
1422
by: HopfZ | last post by:
Is there a way to make a (cross-browser) javascript function that will open an existing webpage (for example, www.google.com) in a new window (or in some part of _self) and then load a specified user script? like this way: openWithUserScript( 'http://www.google.com', 'http://www.my_homepage.com/my_script.js' );
6
1350
by: blue | last post by:
The following is from http://developer.yahoo.com/yui/examples/dragdrop/dd-ontop.html What does the (function(){ })(); syntax actually do? I'm going to guess that is creates an unnamed function?! Many thanks. <script type="text/javascript"> (function() {
0
9730
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9605
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10651
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10392
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9208
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6893
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5555
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3868
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3020
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.