0
Safari瀏覽器有沒有在Safari 3.2.3(525.29)或者其他的jQuery AJAX $.post()
方法的工作?
我想動態地獲取一些信息,當用戶鍵入輸入但它似乎不起作用。
而且,在其它版本的Safari(我只是測試的版本5)這是工作好,也是IE等。
任何人都可以證實我這還是給我關於$.post()
的Safari或者更多信息或有關從primefaces jQuery庫的問題?
我真的很感謝你的意見。
EDITED
我使用jQuery庫與primefaces和我有以下,只是一個例子或代碼片段:
// 1. I imported a base64.js that has this structure: (This .js is obfuscated for security)
// methods situated at base64.js
var key = "b3NjYXJqY";
function base64key(){
this.key = function(){
return key;
};
}
function decrypt(val){
//method that just plays with the string passed in the parameter (val)
return decryptedString;
}
/****************************************************************************/
/* 2. Data returned in the callback is an encrypted json from java servlet. */
/****************************************************************************/
// value from my input
var identifier = $('#txtid').val();
$.post('MyServlet', {identifier : identifier} , function(data) {
// MyServlet returns 0 if no data, else returns an encrypted json as base64 generated with a key.
if (data != 0) {
// base64key() is a method from base64.js that just return a key (like b3NjYXJqY)
var b = new base64key();
// variable that contains encrypted json as string
var temp = data.replace(b.key().substring(5), '');
// decrypt the json (temp variable)
var json = decrypt(temp).replace(b.key(), '');
// parse the json string
var info = JSON.parse(json);
// fill the inputs with data
$('#txtname').val(info.name);
$('#txtemail').val(info.email);
$('#txtphone').val(info.phone);
});
/**********************************************************************************/
/* 3. Just to have an idea of the "data" structure, this is the decrypted json. */
/**********************************************************************************/
{"name": "Oscar Jara", "email": "[email protected]", "phone": "+45 88779900"}
請出示一個例子。 – powtac 2012-02-11 00:47:42
您可以發佈運行'$ .post()'調用的JavaScript代碼,包括捕獲用戶在輸入中輸入的代碼嗎? – Jasper 2012-02-11 00:56:00
好吧,我更新了一切,請檢查。 – 2012-02-11 03:20:08