[JSP][JS][Ajax]如何把Ajax隱藏在JSP內?

本帖最後由 wonglekkin 於 2010-9-25 02:03 編輯

我在JSP上有一個簡單的form,由於我不希望submit時會refresh,於是我便以Ajax在背後把form的資料post至另一個JSP作處理。然而,clients便能夠看見JS/Ajax的code。

我知道要在client side上面隱藏JS是不可能的,
可是我聽聞JS可以隱藏在PHP/ASP內,以sever side形式執行,
但JSP v1.2卻還沒有支援這樣的功能…

有沒有甚麼方法能夠讓Ajax隱藏起起來呢?
thx chings

if something can be done one server side, why don't you use server side script?
you can use ajax for passing data to server script, receiving the data and presenting the data
no one knows how you process the data on the server, but javascript are always exposed to the client as you've already known

TOP

if something can be done one server side, why don't you use server side script?
you can use ajax for ...
wtel 發表於 2010-9-25 05:52

by the way, i also have another question,
is Ajax cannot read a file in Ubuntu system?
my code work fine in Windows but not Ubuntu

TOP

回復 3# wonglekkin


    I don't think there is standard file I/O method comes with native Javascript due to security reason. Different browsers may provide their non-standard ways for accessing local file on client side. On IE, you will need to use ActiveX, and Mozilla had submitted a draft File API to w3c (http://www.w3.org/TR/FileAPI/) which I think won't work on IE...

TOP