<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="<root_prefix>infodrom.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="<root_prefix>/jquery-2.1.0.min.js"></script>
+<script type="text/javascript" src="<root_prefix>/infodrom.js"></script>
</head>
<body>
--- /dev/null
+function ajax_request(funcname, params, callback, error_callback)
+{
+ if (params === null)
+ params = 'func='+funcname;
+ else if (typeof params == 'object')
+ params['func'] = funcname
+ else if (typeof params == 'string')
+ params = 'func='+funcname+'&'+params
+ else
+ return false;
+
+ $.post('/ajax.php', params,
+ function(data){
+ if (!data.status) {
+ if (typeof data.error == 'string')
+ var error = data.error;
+ else
+ var error = 'An error occurred'
+ alert(error);
+ if (typeof error_callback == 'function')
+ error_callback(data);
+ return;
+ }
+ if (typeof callback == 'function')
+ callback(data);
+ });
+}