Arc Forumnew | comments | leaders | submit | revorad's commentslogin

javascript because you can do fun internetty things with it.

-----

3 points by thaddeus 5498 days ago | link

Good point. Although I didn't stipulate this in my original post I kinda assumed no matter what language I pick I will have to continue increasing my js knowledge to continue building web apps. I already do already use js and jquery often.

-----

2 points by aw 5498 days ago | link

That's actually not a bad idea. Server side languages are fundamentally equivalent in the sense that what one can do another can do, though it may be easier or more fun in one language or another. Javascript lets you program the user interface in the browser. Check out http://jquery.com/ for a useful Javascript client-side library.

-----

3 points by revorad 5549 days ago | link | parent | on: Arc3.1 setuid problem on Windows

ah thanks. i had the same problem but didn't know how to fix it. it kept me from messing around with arc at work but no longer....

-----


Ok, now that I've gotten around to give this a serious try, I'm having trouble displaying anything. It seems arc has a problem using .js files because I tried doing something very basic with jquery and it didn't work. Even generating the following html as an arc op doesn't work, even though saving it as a plain html page works perfectly fine. Can anyone enlighten me please?

  <html>
  <head>
  <script type="text/JavaScript" src="jquery-1.3.2.min.js"></script>
  <script type="text/JavaScript">
  $(document).ready(function(){
   $("#generate").click(function(){
  alert('hello');
  });
  });
  </script>
  </head>
  <body>
  <div id="wrapper">
  <div id="quote">
  </p></div>
  <input type="submit" id="generate" value="Generate!">
  </div>
  </body>
  </html>

-----

4 points by fallintothis 5553 days ago | link

srv.arc isn't configured to serve static Javascript. You'll need to patch it:

  $ diff -u old-srv.arc new-srv.arc                           
  --- old-srv.arc      2009-08-04 11:51:09.000000000 -0700
  +++ new-srv.arc     2009-10-10 16:11:21.000000000 -0700        
  @@ -152,10 +152,11 @@                                      
   Connection: close"))                                      
                                                             
   (map (fn ((k v)) (= (type-header* k) (gen-type-header v)))
  -     '((gif       "image/gif")                            
  -       (jpg       "image/jpeg")                           
  -       (png       "image/png")                            
  -       (text/html "text/html; charset=utf-8")))           
  +     '((gif             "image/gif")                      
  +       (jpg             "image/jpeg")                     
  +       (png             "image/png")                      
  +       (text/html       "text/html; charset=utf-8")       
  +       (text/javascript "text/javascript")))              

   (= rdheader* "HTTP/1.0 302 Moved")

  @@ -242,6 +243,7 @@
              "htm"  'text/html
              "html" 'text/html
              "arc"  'text/html
  +           "js"   'text/javascript
              ))))

   (def respond-err (str msg . args)
Then it should work.

-----

3 points by revorad 5553 days ago | link

Ah thanks! I did try the second change but missed the first one. Finally, I can use js properly with arc. Joy to the world.

-----


This is awesome. Thanks thaddeus.

-----


I tried that but it still doesn't solve the problem that my ISP blocks port 80 by default.

-----


You're right, I think I fixed it now. Thanks!

-----

2 points by revorad 5813 days ago | link | parent | on: Where are we going?

Hey thanks for that, conanite. I just posted the link on HN. Could you please answer this question? - http://news.ycombinator.com/item?id=446346

-----

1 point by conanite 5813 days ago | link

Hey, thanks for that, revorad! It looks like stefano got there before me ... but yes, it's a complete arc, with ccc and tail-call optimisation. Unfortunately the JVM doesn't do this stuff natively so there's a whole arc VM running inside the jvm which as you can imagine slows things down a bit.

-----