Skip to content
Snippets Groups Projects
Commit cd0981b2 authored by Commander-lol's avatar Commander-lol
Browse files

Added muTest to perform (very primitive) testing

Added an extra file (test.js) to store various tests under muTest, a php
file to respond to requests and an update for test.html to include
test.js
parent 7f8a8c94
No related branches found
No related tags found
No related merge requests found
if(!mu.exists(window.muTest)){
window.muTest = {
postJsonResponse: function(){
mu.ajax({
url: 'tests/jsonresponse.php',
method: 'POST',
responseType: 'json',
success: function(data){
console.log(data);
}
});
}
}
}
......@@ -13,7 +13,7 @@
so it would be <span class='important'>bad</span> if any of them dissapeared.
</p>
<p id='emptydiv'>
</p>
</div>
......@@ -45,6 +45,7 @@
</body>
<script type="text/javascript" src="js/tinyDOM.js"></script>
<script type="text/javascript" src="js/test.js"></script>
<script type="text/javascript">
μ('#btn-show').on('click', function(){
μ('.important').show();
......
<?php header('Content-Type: application/json');
$jsonObj = array(
'elementOne' => 'Its a string',
'numberElement' => -1,
'booleanElement' => True,
'elementTwo' => 'another string!'
);
echo json_encode($jsonObj);
?>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment