Damn.. I really dont believe this!!
I gave a half-hearted try to what you said and it worked!!
I was previously working inside /cgi-bin/ajax-test directory and was 
thinking it should not make a difference. What you said made no sense to 
me but I still gave it a try just to be sure.
Anyways, thanks so much!!

Gale



J-H Johansen wrote:
> On 6/28/07, Gale CC <galecho / gmail.com> wrote:
>> I'm pretty sure the shebang line is correct. I verified by doing "which
>> ruby" and also ran the file independently from the shell by typing
>> "./test2.rb" and it works.
>>
>> Also the file runs fine when its set as an "action" to a form, but not
>> in this case when its run from inside a javascript script. Any idea
>> what's wrong ?
> 
> Download the "web developer" plug-in for Firefox and enable while
> you're developing. It's a nice feature to see each and every call you
> make and you can even inspect the output from the calls.
> 
> The reference you're using here looks a bit weird though.
> 
> xmlHttp.open("GET","test2.rb",true);
> 
> Normally, I would have to reference the cgi-bin directory as well, and
> this here appears to reference the Ruby script as though it was
> located in the same directory as the HTML file that produces the page.
> Try something like this:
> 
> xmlHttp.open("GET","/cgi-bin/test2.rb",true);
> 
> if the script is located at the root of the cgi-bin directory.


-- 
Posted via http://www.ruby-forum.com/.