Repository navigation
Expand file tree
/
Copy pathjava.js
More file actions
72 lines (57 loc) · 1.45 KB
/
Copy pathjava.js
File metadata and controls
72 lines (57 loc) · 1.45 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
var sum = 0;
var slideIndex = 1;
showDivs(slideIndex);
function plusDivs(n) {
showDivs(slideIndex += n);
}
function showDivs(n) {
var i;
var x = document.getElementsByClassName("mySlides");
if (n > x.length) {slideIndex = 1}
if (n < 1) {slideIndex = x.length}
for (i = 0; i < x.length; i++) {
x[i].style.display = "none";
}
x[slideIndex-1].style.display = "block";
}
$(document).ready(function(){
// Function to load new content
function loadNewContent() {
$.ajax({
url: 'contact.html', // Path to the new content file
type: 'GET',
success: function(response) {
$('#container').html(response); // Replace the content of #container
},
error: function(xhr, status, error) {
console.error('Error loading content:', error);
}
});
}
// Call loadNewContent function when a certain event occurs (e.g., button click)
$('#click').on('click', function() {
loadNewContent();
});
});
function calculate1(cost) {
sum= sum + cost;
}
function calculate2(cost) {
sum= sum + cost;
}
function calculate3(cost) {
sum= sum + cost;
}
function calculate4(cost) {
sum= sum + cost;
}
function calculate5(cost) {
sum= sum + cost;
}
function calculate6(cost)
{
sum= sum + cost;
}
function display() {
alert("You have ordered a total amount of Rs " + sum);
}