PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.lang.ruby > Executing javascript from Ruby
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Executing javascript from Ruby

Réponse
 
LinkBack Outils de la discussion
Vieux 23/05/2008, 23h43   #1
bcparanj@gmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Executing javascript from Ruby

I need to execute a javascript from Ruby. The result of the javascript
is a URL. I could not find anything that bridge the gap between
javascript and Ruby. Does anyone know if there is something that I can
use for this problem? TIA.
  Réponse avec citation
Vieux 24/05/2008, 00h23   #2
Axel Etzold
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Executing javascript from Ruby


-------- Original-Nachricht --------
> Datum: Sat, 24 May 2008 07:45:00 +0900
> Von: "bcparanj@gmail.com" <bcparanj@gmail.com>
> An: ruby-talk@ruby-lang.org
> Betreff: Executing javascript from Ruby


> I need to execute a javascript from Ruby. The result of the javascript
> is a URL. I could not find anything that bridge the gap between
> javascript and Ruby. Does anyone know if there is something that I can
> use for this problem? TIA.


Hi ---

do you want to open the URL in Ruby ?
There are many possibilities: look eg. here:

http://www.juretta.com/log/2006/08/1..._and_open-uri/

Best regards,

Axel

--
Psssst! Schon vom neuen GMX MultiMessenger gehört?
Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger

  Réponse avec citation
Vieux 26/05/2008, 19h13   #3
Aaron Patterson
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Executing javascript from Ruby

On Sat, May 24, 2008 at 07:45:00AM +0900, bcparanj@gmail.com wrote:
> I need to execute a javascript from Ruby. The result of the javascript
> is a URL. I could not find anything that bridge the gap between
> javascript and Ruby. Does anyone know if there is something that I can
> use for this problem? TIA.


Yes.... Johnson bridges Ruby to JavaScript. We haven't released a gem
yet, but you can check it out from github now. Its pretty stable, and
we only have 1 bug blocking our release. :-)

http://github.com/jbarnette/johnson/tree/master

Example:

context = Johnson::Context.new
context.evaluate("function foo() { return 'hello world'; }")
context.evaluate("foo()") # => 'hello world'

--
Aaron Patterson
http://tenderlovemaking.com/

  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 13h52.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,10427 seconds with 11 queries