WB 10 PGM
WB 10 PGM
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<style>
body {
line-height: 1.6;
margin: 0;
padding: 20px;
background-color: #f4f4f4;
.container {
max-width: 800px;
margin: auto;
background: white;
padding: 20px;
border-radius: 5px;
}
h1 {
color: #333;
h2 {
color: #666;
button {
background-color: #4CAF50;
border: none;
color: white;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
cursor: pointer;
border-radius: 4px;
pre {
background-color: #f8f8f8;
border-radius: 4px;
padding: 10px;
white-space: pre-wrap;
word-wrap: break-word;
}
</style>
</head>
<body>
<div class="container">
<pre id="result-a"></pre>
<pre id="result-b"></pre>
<pre id="result-c"></pre>
<pre id="result-d"></pre>
</div>
<script>
// Simulated data
const simulatedData = {
age: 30,
};
function operationWithoutJQuery() {
setTimeout(function() {
document.getElementById("result-a").textContent = simulatedData.text;
}, 500);
function operationWithJQuery() {
$.Deferred(function(deferred) {
setTimeout(function() {
deferred.resolve(simulatedData.text);
}, 500);
}).done(function(result) {
$("#result-b").text(result);
});
function getJSONOperation() {
$.Deferred(function(deferred) {
setTimeout(function() {
deferred.resolve(simulatedData.json);
}, 500);
}).done(function(result) {
});
function parseJSONExample() {
</script>
</body>
</html>