Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?
- $setType = $_GET["set_type"];
- $gender = $_GET["gender"];
- //$figureSet = file_get_contents($setType . "-" . $gender . ".txt");
- ?>
- <html>
- <head>
- <script language="JavaScript">
- function xmlhttpPost(strURL) {
- document.body.innerHTML = '';
- var xmlHttpReq = false;
- // Mozilla/Safari
- if (window.XMLHttpRequest) {
- xmlHttpReq = new XMLHttpRequest();
- if (xmlHttpReq.overrideMimeType) {
- xmlHttpReq.overrideMimeType('text/xml');
- // See note below about this line
- }
- // IE
- } else if (window.ActiveXObject) { // IE
- try {
- xmlHttpReq = new ActiveXObject("Msxml2.XMLHTTP");
- } catch (e) {
- try {
- xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
- } catch (e) {}
- }
- }
- if (!xmlHttpReq) {
- alert('ERROR AJAX:( Cannot create an XMLHTTP instance');
- return false;
- }
- xmlHttpReq.open('GET', strURL, true);
- xmlHttpReq.onload = function(e) {
- var data = JSON.parse(this.response);
- }
- xmlHttpReq.send();
- //xmlHttpReq.responseType = "text";
- // xmlHttpReq.setRequestHeader('Content-Type', 'application/json');
- //xmlHttpReq.onreadystatechange = function() {
- // callBackFunction(xmlHttpReq);
- //};
- xmlHttpReq.send();
- }
- function callBackFunction(http_request) {
- if (http_request.readyState == 4) {
- if (http_request.status == 200) {
- /*var responceString = http_request.responseText;
- document.body.innerHTML = '';
- document.write(responceString);*/
- } else {
- alert('ERROR: AJAX request status = ' + http_request.status);
- }
- }
- }
- </script>
- </head>
- <body onload="xmlhttpPost('./<? echo $setType . "-" . $gender . ".json" ?>');">
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement