Commits

camlspotter committed f334373

fix

  • Participants
  • Parent commits c5cde50

Comments (0)

Files changed (3)

File chart0/chart.ml

         
 class type dataTable = object
   method addColumn : js_string t -> js_string t-> unit meth
-  method addRows : js_string t js_array t js_array t -> unit meth
+  method addRows : 'a t js_array t js_array t -> unit meth
 end
 
 class type chart = object

File chart3/OMakefile

 FILES[] =
+    xJs
     google
     chart
 

File chart3/chart.ml

 open Js
+open XJs
 open Lwt
 
 open Google
    has no effect after eval_string.
 *)
 
-let http_get url =
-  let open XmlHttpRequest in
-  get url >>= fun r ->
-  match r.code with
-  | 0 | 200 -> Lwt.return (Some r.content)
-  | _ -> Lwt.return None
-
-let alert s =
-  ignore (Unsafe.fun_call (Unsafe.variable "alert") [| Unsafe.inject (Js.string s) |])
-
 module Data = struct
   let get_line s pos =
     try 
           end) s;
     !items
 
-  let http_get url =
-    http_get url >>= function
+  let get url =
+    Http.get url >>= function
       | None -> return []
       | Some s -> return (parse_rows s)
 end
   chart##draw(data, options);
 
   ignore begin
-    Data.http_get "data.txt" >>= fun rows ->
+    Data.get "data.txt" >>= fun rows ->
     data##addRows(Js.array (Array.of_list (List.map (fun (x,y) -> 
       Js.array [| Obj.magic x;
                   Obj.magic y; |]) rows)));