CodeWeblog.com » lt,implementation,amp » Ajax the Clear Cache

Ajax the Clear Cache

The first is: in the Ajax to add the URL parameters "? Fresh =" + Math.random (); / / Of course, here the parameters can be obtained fresh

The second: the parameters in the URL after "? Timestamp =" + new Date (). GetTime ();

Under way, response.flush () the problem could easily ~ ~ ~

code:
function officecode (officeid) (
oSelect = $ (officeid);
ajaxOfficeCode ( "medical.cmd? method = Initofficecode" + "& timestamp =" + new Date (). getTime ());
)

function ajaxOfficeCode (url) (

new Ajax.Request (url,
(
method: 'get',
onComplete: function (request) (
eval (request.responseText); / / implementation of some script
addOfficeOptions (medofficecode); / / medofficecode json variable
)
));

)

function addOfficeOptions (office) (
len = office.length; / / length

var o1 = document.createElement ( "OPTION");
o1.value = "";
o1.text = "";
oSelect.add (o1);
for (var i = 0; i <len; i + +) (
id = office [i]. officecode;
name = office [i]. officename;
var oOption = document.createElement ( "OPTION");
oOption.value = id;
oOption.text = name;
oSelect.add (oOption);
)
)
Digg Technorati StumbleUpon Mixx del.icio.us Reddit BlinkList Furl YahooMyWeb feedburner

Tags: lt (RSS), implementation (RSS), amp (RSS), new date (RSS), math (RSS), ajax (RSS), variable function (RSS), request url (RSS), len (RSS), url parameters (RSS), gettime (RSS), clear cache (RSS), timestamp (RSS)

Permalink: http://www.codeweblog.com/ajax-the-clear-cache/

Leave a reply