[KDE Dot News]
 faq
 flatforty
 contribute
 subscribe
 configure
 search
 rdf

 main
 parent
 thread


Re: Javascript?
by Olivier LAHAYE on Sunday 30/Sep/2001, @04:37
javascript can use libs just like serverside javascript does, and you can include new javascript objects. You can create some objects and classes just like java.(even in html you can do that by including .js files defining classes using the <SCRIPT SRC="xxx.js"></SCRIPT> syntax)

Concerning dcop or otherthing access, it would be done the same way you access activeX objects or java applet. The extention extends the local DOM with objects and functions.

let suppose we want to load a new document called "foo.doc" in kword

then a document.open("foo.doc") would do the job.
you could also let the user choose the document with the following line:
document.menu.file.open.select();
or you could rename that menu:
document.menu.open.rename("Open a File");

Now let say you want to include a picture:
oMyPic=document.createElement("IMG")
oMyPic.src="foo.png";
document.appendChild(oMyPic);

Now, more complex thing: you want to include a speadsheet:
oMyEmbedSpreadSheet=document.createElement("EMBED");
oMyEmbedSpreadSheet.src="foo.xls";
document.appendChild(oMyEmbedSpreadSheet);

Now you want to create an empty embeded kspread object:
oMyEmptySheet=new Kspread("Sheet1","Sheet2");
oMyEmbedEmptySheet=document.createElement("EMBED");
oMyEmbedSpreadSheet.nodeValue=oMyEmptySheet;
document.appendChild(oMyEmbedEmptySheet);

Now you want to set the background of the 1st cell of the first sheet to red:
oMyEmptySheet.sheet[0].cells[0][0].style.background="red";

As you see, oMySpreadSheet would just behave as a standard html object with datas and methods.
And by that way, exporting thoses pages to the net with scripting would be possible.

Javascript also include security concepts.

that was just my 2 cents.

PS: don't try to think in terms of netscrape 4.x javascript, its DOM is so poor that of cours almost nothing complex is possible and most of its usage is reserved to string computation and document.write().
  Related Links
 ·   Articles on Developer
 ·   Also by Olivier LAHAYE
 ·   Contact author

Thread Threshold:

The Fine Print: The following comments are owned by whomever posted them.
( Reply )

  "KDE: The news ticker with integrated desktop environment." -- Frerich Raabe
KDE®, "K Desktop Environment", "KDE Dot News", "got the dot?" and the KDE Logo® are trademarks or registered trademarks of KDE e.V. in the European Union, the United States and other countries. All other trademarks and copyrights on this page are owned by their respective owners. Comments are owned by the poster. The rest: Copyright © 2000-2008 KDE e.V. for The KDE Project. For further information or comments on this site, please contact the Webmaster.
[ home | post article | flat forty | subscribe | search | rdf ]