Daily Grind

システム開発関連の忘備録です

ajax

ajaxサンプル

hello.cgi #!/usr/bin/env ruby sleep(3) require "cgi" cgi = CGI.new name = cgi['name'] name = CGI.escapeHTML(name) # セキュリティ対策 puts "Content-type: text/html charset: euc-jp" puts puts "こんにちは、#{name} さん!\n" hello.html <html lang="ja"> <head> <meta charset="euc-jp"> <title>Hel</title></meta></head></html>…