-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathforex.php
More file actions
80 lines (74 loc) · 1.94 KB
/
forex.php
File metadata and controls
80 lines (74 loc) · 1.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Simple Ajax Demo</title>
<!-- Bootstrap -->
<link href='css/bootstrap.min.css' rel="stylesheet">
<script src="js/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
</head>
<body>
<div class="container">
<section>
<h1>Jquery Ajax Demo</h1>
</section>
<div class="navbar">
<div class="navbar-inner">
<div class="container">
<ul class="nav">
<li><a href="ajax.php">Home</a></li>
<li><a href="map.php">Map</a></li>
<li class="active"><a href="forex.php">Forex</a></li>
<li><a href="dateconvert.php">Date Conversion</a></li>
<li><a href="visualization.php">Map Visualization</a></li>
</ul>
</div>
</div>
</div>
</div>
<div class="container">
<div class="row">
<div class="span5">
<table class="table table-striped">
<caption>Foreign Exchange Rate: Nepal Rastra Bank</caption>
<thead>
<tr>
<th>Currency</th>
<th>Buying/Rs.</th>
<th>Selling/Rs.</th>
</tr>
</thead>
<tbody id="tablebodyC">
</tbody>
</table>
<div id="loadimage" align="center">
</div>
</div>
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){
$.ajax({
url: 'proxy.php?url=http://nepalapi.appspot.com/forex/today',
type: 'GET',
dataType: 'json',
beforeSend: function(){
$('#loadimage').html('<img src="img/ajax-loader.gif">');
},
success: function(data, textStatus, xhr){
$.each(data, function(index, data) {
$('#tablebodyC').append('<tr>');
$('#tablebodyC').append('<td>'+data.currency+'</td>');
$('#tablebodyC').append('<td>'+data.Selling+'</td>');
$('#tablebodyC').append('<td>'+data.Buying+'</td>');
$('#tablebodyC').append('</tr>');
});
$('#loadimage').hide();
},
});
});
</script>
</body>
</html>