From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by sympa.inria.fr (Postfix) with ESMTPS id 390377F2AA for ; Thu, 20 Dec 2012 21:31:58 +0100 (CET) Received-SPF: None (mail4-smtp-sop.national.inria.fr: no sender authenticity information available from domain of pierreetienne.meunier@gmail.com) identity=pra; client-ip=74.125.82.182; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="pierreetienne.meunier@gmail.com"; x-sender="pierreetienne.meunier@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail4-smtp-sop.national.inria.fr: domain of pierreetienne.meunier@gmail.com designates 74.125.82.182 as permitted sender) identity=mailfrom; client-ip=74.125.82.182; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="pierreetienne.meunier@gmail.com"; x-sender="pierreetienne.meunier@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail4-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-we0-f182.google.com) identity=helo; client-ip=74.125.82.182; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="pierreetienne.meunier@gmail.com"; x-sender="postmaster@mail-we0-f182.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AksCAHh101BKfVK2k2dsb2JhbABFg0i6KBYOAQEBAQkJCwkUBCOCHgEBBAFAARsRDAEDDAYFCzsjEQEFARwGiBMBAwkGBAiaZ4wzgnuFIAoZJw1ZiHYBBQyMS4NiYQOSWIMzgRyET4NihRs/hBY X-IronPort-AV: E=Sophos;i="4.84,326,1355094000"; d="scan'208,217";a="166460906" Received: from mail-we0-f182.google.com ([74.125.82.182]) by mail4-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 20 Dec 2012 21:31:57 +0100 Received: by mail-we0-f182.google.com with SMTP id u54so1832168wey.27 for ; Thu, 20 Dec 2012 12:31:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:subject:mime-version:content-type:from:in-reply-to:date :cc:content-transfer-encoding:message-id:references:to:x-mailer; bh=Lbu6NbpNhAfBYnuo5j+VucP7OyaMkWdU2rAeayJh5qU=; b=oPbKFwkwxhL4gqlRI0eM4KcRPxMUBMRhd7WpNbiG1smfdMc090lzKq08vyVtaP/lVT WFx5HPXCG5dTaQ9WSGyB1n3qxFIUy1e+HnewbayDVzexz8PRMjVl9PgnwKNPIRN6cAQu tFbD5jEyNWftDm3T1FFMtDU4HR1KyV+5e2cF+TYHAsmj/w+cqFelF3QEno3F//wrJ/XN 1DMy790yhnu0wh1oWroG+/qBLweADBU7QO/M+wbZ5Jty+dlJRcf6dLH4xhe+JuFiqd6I 43GSIPT8vxhLROYPJH8VDeCkCvnqF2xDZahgbmHjHQWsfwttnYpT0lzLh7Wd8P5IUntM YiJQ== X-Received: by 10.195.13.11 with SMTP id eu11mr13587429wjd.39.1356035517369; Thu, 20 Dec 2012 12:31:57 -0800 (PST) Received: from [192.168.1.50] (msl73-1-82-247-167-128.fbx.proxad.net. [82.247.167.128]) by mx.google.com with ESMTPS id p3sm26784525wic.8.2012.12.20.12.31.55 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 20 Dec 2012 12:31:56 -0800 (PST) Mime-Version: 1.0 (Apple Message framework v1085) Content-Type: text/plain; charset=iso-8859-1 From: Pierre-Etienne Meunier In-Reply-To: Date: Thu, 20 Dec 2012 21:31:54 +0100 Cc: O Caml Content-Transfer-Encoding: quoted-printable Message-Id: <65E30EED-7FB4-44C6-B1EC-F304E55CAD77@gmail.com> References: To: bob zhang X-Mailer: Apple Mail (2.1085) Subject: Re: [Caml-list] An easy tutorial to js_of_ocaml? Hi, Personally, I learnt js_of_ocaml by first learning javascript using firebug= in firefox. They have something called the console, similar to a toplevel,= where you can directly manipulate the DOM to see what you are supposed to = do with javascript, and immediately see the results on the webpage. Make a = simple webpage, the most important point is that your elements all have a p= roperty called "id", and try to play with this toplevel before understandin= g it. A typical example is :
Blabla

Blibli

Then, in order : - try to make a table programmatically (using the Mozilla Developper Librar= y). - use httprequests. - animate svg pictures - use canvas. Then if you learn about what javascript calls "prototypes", you're done lea= rning javascript, and you can do all this in ocaml. Good luck Pierre Em 20/12/2012, =E0s 17:41, bob zhang escreveu: >=20 > Dear List, > I tried several times using js_of_ocaml, but did not get a working exa= mple yet, it always gives me some error message like missing some primitiv= es. > I am absolutely a newbie in javascript, is there some simple working e= xamples online? >=20 > I followed this thread, http://toss.sourceforge.net/ocaml.html, but th= e output JsClient.js does not work as I expected > Thanks in advance! >=20 > --=20 > Regards > -- Bob