caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Re: [Caml-list] An easy tutorial to js_of_ocaml?
       [not found] <fa.FJUwiHb9MCpx1s04UJaSR5DeNOI@ifi.uio.no>
@ 2012-12-20 17:56 ` Barbara Lepage (db0)
  0 siblings, 0 replies; 8+ messages in thread
From: Barbara Lepage (db0) @ 2012-12-20 17:56 UTC (permalink / raw)
  To: fa.caml; +Cc: Caml List

Hi,

On Thursday, December 20, 2012 5:41:11 PM UTC+1, bob zhang wrote:
> I am absolutely a newbie in javascript, is there some simple working
> examples online?

You can find several examples of projects using js_of_ocaml on the
documentation page: http://ocsigen.org/js_of_ocaml/
The source code of these examples is availailable on the darcs
repository: http://ocsigen.org/darcsweb/?r=js_of_ocaml;a=tree;f=/examples

If you want to use javascript mixed with standard server-side web
actions, I recommend you to use Eliom too.
The tutorial page (http://ocsigen.org/tutorial/) is a good start. The
first tutorial (http://ocsigen.org/tutorial/application) explains
server and client interactions.

Let me know if that helps,

-- 
db0 sur http://db0.fr/

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Caml-list] An easy tutorial to js_of_ocaml?
  2012-12-21  9:45     ` Çagdas Bozman
  2012-12-21 16:56       ` Ashish Agarwal
  2012-12-21 17:05       ` Gabriel Scherer
@ 2012-12-21 20:55       ` bob zhang
  2 siblings, 0 replies; 8+ messages in thread
From: bob zhang @ 2012-12-21 20:55 UTC (permalink / raw)
  To: Çagdas Bozman; +Cc: caml-list, Pierre-Etienne Meunier

[-- Attachment #1: Type: text/plain, Size: 555 bytes --]

On Fri, Dec 21, 2012 at 4:45 AM, Çagdas Bozman
<cagdas.bozman@ocamlpro.com>wrote:

>  Hi !
> Are you aware of this page : http://try.ocamlpro.com/js_of_ocaml/
> We put some examples and you can try them online.
>
> You can also look at the source of TryOCaml, it can be a start :-
>
Actually I want to do something like this, with my customized toplevel, it
may be a bit hard for me, who
has little background in js. The problem for me is the js part, I will take
a look, though.
Thanks



>
> -- Çagdas
>
>


-- 
Regards
-- Bob

[-- Attachment #2: Type: text/html, Size: 1331 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Caml-list] An easy tutorial to js_of_ocaml?
  2012-12-21  9:45     ` Çagdas Bozman
  2012-12-21 16:56       ` Ashish Agarwal
@ 2012-12-21 17:05       ` Gabriel Scherer
  2012-12-21 20:55       ` bob zhang
  2 siblings, 0 replies; 8+ messages in thread
From: Gabriel Scherer @ 2012-12-21 17:05 UTC (permalink / raw)
  To: Çagdas Bozman; +Cc: caml-list, Hongbo Zhang, Pierre-Etienne Meunier

When I click "Reset" in the toplevel, the changes that were made to
the webpage are not reverted (I still see the moving square). This is
not what I would expect; I understand reverting this perfectly is
probably not easy or even possible, but some form of rollbacks that
allows to revert to a clean state if we didn't do anything really
crazy would be appreciated.

On Fri, Dec 21, 2012 at 10:45 AM, Çagdas Bozman
<cagdas.bozman@ocamlpro.com> wrote:
> Hi !
>
> On 12/21/2012 04:58 AM, Hongbo Zhang wrote:
>
> On 12/20/12 3:31 PM, Pierre-Etienne Meunier wrote:
>
> 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
> property called "id", and try to play with this toplevel before
> understanding it. A typical example is :
>
> Thanks for your message, it's really helpful ;-)
>
> <html>
> <body>
> <div id="example">
> Blabla
> </div>
> <p id="aparagraph">
> Blibli
> <p>
> </body>
> </html>
>
> Then, in order :
>
> - try to make a table programmatically (using the Mozilla Developper
> Library).
> - use httprequests.
> - animate svg pictures
> - use canvas.
>
> Then if you learn about what javascript calls "prototypes", you're done
> learning javascript, and you can do all this in ocaml.
>
> Good luck
> Pierre
>
>
> Em 20/12/2012, às 17:41, bob zhang escreveu:
>
> Dear List,
>     I tried several times using js_of_ocaml, but did not get a working
> example yet, it  always gives me some error message like missing some
> primitives.
>     I am absolutely a newbie in javascript, is there some simple working
> examples online?
>
>     I followed this thread, http://toss.sourceforge.net/ocaml.html, but the
> output JsClient.js does not work as I expected
>     Thanks in advance!
>
> --
> Regards
> -- Bob
>
>
>
> Are you aware of this page : http://try.ocamlpro.com/js_of_ocaml/
> We put some examples and you can try them online.
>
> You can also look at the source of TryOCaml, it can be a start :-)
>
> -- Çagdas

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Caml-list] An easy tutorial to js_of_ocaml?
  2012-12-21  9:45     ` Çagdas Bozman
@ 2012-12-21 16:56       ` Ashish Agarwal
  2012-12-21 17:05       ` Gabriel Scherer
  2012-12-21 20:55       ` bob zhang
  2 siblings, 0 replies; 8+ messages in thread
From: Ashish Agarwal @ 2012-12-21 16:56 UTC (permalink / raw)
  To: Çagdas Bozman; +Cc: caml-list, Hongbo Zhang, Pierre-Etienne Meunier

[-- Attachment #1: Type: text/plain, Size: 166 bytes --]

On Fri, Dec 21, 2012 at 4:45 AM, Çagdas Bozman
<cagdas.bozman@ocamlpro.com>wrote:

 Are you aware of this page : http://try.ocamlpro.com/js_of_ocaml/
>

Nice!

[-- Attachment #2: Type: text/html, Size: 585 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Caml-list] An easy tutorial to js_of_ocaml?
  2012-12-21  3:58   ` Hongbo Zhang
@ 2012-12-21  9:45     ` Çagdas Bozman
  2012-12-21 16:56       ` Ashish Agarwal
                         ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Çagdas Bozman @ 2012-12-21  9:45 UTC (permalink / raw)
  To: caml-list, Hongbo Zhang, Pierre-Etienne Meunier

[-- Attachment #1: Type: text/plain, Size: 1874 bytes --]

Hi !
On 12/21/2012 04:58 AM, Hongbo Zhang wrote:
> On 12/20/12 3:31 PM, Pierre-Etienne Meunier wrote:
>> 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 property called "id", and try 
>> to play with this toplevel before understanding it. A typical example 
>> is :
> Thanks for your message, it's really helpful ;-)
>> <html>
>> <body>
>> <div id="example">
>> Blabla
>> </div>
>> <p id="aparagraph">
>> Blibli
>> <p>
>> </body>
>> </html>
>>
>> Then, in order :
>>
>> - try to make a table programmatically (using the Mozilla Developper 
>> Library).
>> - use httprequests.
>> - animate svg pictures
>> - use canvas.
>>
>> Then if you learn about what javascript calls "prototypes", you're 
>> done learning javascript, and you can do all this in ocaml.
>>
>> Good luck
>> Pierre
>>
>>
>> Em 20/12/2012, às 17:41, bob zhang escreveu:
>>
>>> Dear List,
>>>     I tried several times using js_of_ocaml, but did not get a 
>>> working example yet, it  always gives me some error message like 
>>> missing some primitives.
>>>     I am absolutely a newbie in javascript, is there some simple 
>>> working examples online?
>>>
>>>     I followed this thread, http://toss.sourceforge.net/ocaml.html, 
>>> but the output JsClient.js does not work as I expected
>>>     Thanks in advance!
>>>
>>> -- 
>>> Regards
>>> -- Bob
>
>
Are you aware of this page : http://try.ocamlpro.com/js_of_ocaml/
We put some examples and you can try them online.

You can also look at the source of TryOCaml, it can be a start :-)

-- Çagdas


[-- Attachment #2: Type: text/html, Size: 3502 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Caml-list] An easy tutorial to js_of_ocaml?
  2012-12-20 20:31 ` Pierre-Etienne Meunier
@ 2012-12-21  3:58   ` Hongbo Zhang
  2012-12-21  9:45     ` Çagdas Bozman
  0 siblings, 1 reply; 8+ messages in thread
From: Hongbo Zhang @ 2012-12-21  3:58 UTC (permalink / raw)
  To: Pierre-Etienne Meunier; +Cc: O Caml

On 12/20/12 3:31 PM, Pierre-Etienne Meunier wrote:
> 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 property called "id", and try to play with this toplevel before understanding it. A typical example is :
Thanks for your message, it's really helpful ;-)
> <html>
> <body>
> <div id="example">
> Blabla
> </div>
> <p id="aparagraph">
> Blibli
> <p>
> </body>
> </html>
>
> Then, in order :
>
> - try to make a table programmatically (using the Mozilla Developper Library).
> - use httprequests.
> - animate svg pictures
> - use canvas.
>
> Then if you learn about what javascript calls "prototypes", you're done learning javascript, and you can do all this in ocaml.
>
> Good luck
> Pierre
>
>
> Em 20/12/2012, às 17:41, bob zhang escreveu:
>
>> Dear List,
>>     I tried several times using js_of_ocaml, but did not get a working example yet, it  always gives me some error message like missing some primitives.
>>     I am absolutely a newbie in javascript, is there some simple working examples online?
>>
>>     I followed this thread, http://toss.sourceforge.net/ocaml.html, but the output JsClient.js does not work as I expected
>>     Thanks in advance!
>>
>> -- 
>> Regards
>> -- Bob


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Caml-list] An easy tutorial to js_of_ocaml?
  2012-12-20 16:41 bob zhang
@ 2012-12-20 20:31 ` Pierre-Etienne Meunier
  2012-12-21  3:58   ` Hongbo Zhang
  0 siblings, 1 reply; 8+ messages in thread
From: Pierre-Etienne Meunier @ 2012-12-20 20:31 UTC (permalink / raw)
  To: bob zhang; +Cc: O Caml

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 property called "id", and try to play with this toplevel before understanding it. A typical example is :

<html>
<body>
<div id="example">
Blabla
</div>
<p id="aparagraph">
Blibli
<p>
</body>
</html>

Then, in order :

- try to make a table programmatically (using the Mozilla Developper Library).
- use httprequests.
- animate svg pictures
- use canvas.

Then if you learn about what javascript calls "prototypes", you're done learning javascript, and you can do all this in ocaml.

Good luck
Pierre


Em 20/12/2012, às 17:41, bob zhang escreveu:

> 
> Dear List,
>    I tried several times using js_of_ocaml, but did not get a working example yet, it  always gives me some error message like missing some primitives.
>    I am absolutely a newbie in javascript, is there some simple working examples online?
> 
>    I followed this thread, http://toss.sourceforge.net/ocaml.html, but the output JsClient.js does not work as I expected
>    Thanks in advance!
> 
> -- 
> Regards
> -- Bob


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Caml-list] An easy tutorial to js_of_ocaml?
@ 2012-12-20 16:41 bob zhang
  2012-12-20 20:31 ` Pierre-Etienne Meunier
  0 siblings, 1 reply; 8+ messages in thread
From: bob zhang @ 2012-12-20 16:41 UTC (permalink / raw)
  To: Caml List

[-- Attachment #1: Type: text/plain, Size: 417 bytes --]

Dear List,
   I tried several times using js_of_ocaml, but did not get a working
example yet, it  always gives me some error message like missing some
primitives.
   I am absolutely a newbie in javascript, is there some simple working
examples online?

   I followed this thread, http://toss.sourceforge.net/ocaml.html, but the
output JsClient.js does not work as I expected
   Thanks in advance!

-- 
Regards
-- Bob

[-- Attachment #2: Type: text/html, Size: 582 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2012-12-21 20:55 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <fa.FJUwiHb9MCpx1s04UJaSR5DeNOI@ifi.uio.no>
2012-12-20 17:56 ` [Caml-list] An easy tutorial to js_of_ocaml? Barbara Lepage (db0)
2012-12-20 16:41 bob zhang
2012-12-20 20:31 ` Pierre-Etienne Meunier
2012-12-21  3:58   ` Hongbo Zhang
2012-12-21  9:45     ` Çagdas Bozman
2012-12-21 16:56       ` Ashish Agarwal
2012-12-21 17:05       ` Gabriel Scherer
2012-12-21 20:55       ` bob zhang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).