Login   Register  
PHP Classes
elePHPant
Icontem

File: test/index.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Dmitri Russu  >  PHP Reduce JSON  >  test/index.php  >  Download  
File: test/index.php
Role: Auxiliary script
Content type: text/plain
Description: Auxiliary script
Class: PHP Reduce JSON
Compress JSON data using the reduced JSON format
Author: By
Last change:
Date: 1 year ago
Size: 782 bytes
 

Contents

Class file image Download
<script src="../rjson.js" type="text/javascript" language="JavaScript"></script>
<script src="jquery.js" type="text/javascript" language="JavaScript"></script>
<script language="JavaScript" type="text/javascript">
    $.ajax({
        "dataType": "json",
        "type": "POST",
        "url": "DataProcess.php?action=get_data",
        "success": function(data) {

            console.log('Pack->result=');
            console.dir(data);

            var unpackData = RJSON.unpack(data);

            console.log('UnPack->result=');
            console.dir(unpackData);

            var packData = RJSON.pack(unpackData);

            $.ajax({
                "dataType": "json",
                "type": "POST",
                "url": "DataProcess.php?action=save_data",
                "data": {"pack_data": packData},
                "success": function(response) {
                    console.log(response);
                }
            });
        }
    });




</script>