我如何使用Ajax,Perl和JSON容易在一起吗?如何使用、容易、Perl、Ajax

2023-09-10 17:33:43 作者:不努力梦想永远只是梦

我试图让使用Ajax的网页。

I am trying to make a webpage with Ajax.

例如:

我创建触发一个简单的后一个Perl / CGU文件;

I create a Perl/CGU file that triggers a simple post;

文件:..test.cgi名=托马斯

File: ..test.cgi?name=Thomas

文本回:你的名字是托马斯·

Text back: Your name is Thomas!

我创建可以使用后一个HTML文件,但随后的页面重新加载。 我用文字输入和一个按钮。

I create a html file that can use the post, but then the page have to reload. I use text input and a button.

我如何使用Ajax,Perl和JSON容易在一起吗? 这是怎么回事应该一起工作,但如何?

How can I use Ajax, Perl and JSON easy together? This is how it should work together, but how?

HTML +的Ajax / JavaScript调用的Perl +JSON-perl的字符串退还到阿贾克斯CONVERT-JSON - > HTML

Html + Ajax/JavaScript CALL Perl + "JSON-perl-string" RETURN-TO Ajax CONVERT-JSON -> Html

推荐答案

有关JSON尝试的 CPAN JSON模块。

有关使用XMLHtt prequest我建议这些精彩的教程来自IBM。

For using the XMLHttpRequest I recommend these wonderful tutorials from IBM.

掌握Ajax,第1部分:Ajax简介

这两篇文章,你可能最感兴趣的是这两个:

The two articles you'll probably be most interested in are these two:

掌握Ajax,第10部分:使用JSON进行数据传输

掌握Ajax,第11部分:JSON在服务器端

您可以得到整个11部系列使用这种搜索链接。

You can get the entire 11 Part series using this search link.