Get Masjid data via json from dropdown

Developer
Size
2,398 Kb
Views
30,360

How do I make an get masjid data via json from dropdown?

What is a get masjid data via json from dropdown? How do you make a get masjid data via json from dropdown? This script and codes were developed by Khalid Munir on 26 August 2022, Friday.

Get Masjid data via json from dropdown Previews

Get Masjid data via json from dropdown - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Get Masjid data via json from dropdown</title>
</head>
<body> <h2>Get masjid weekly JSON</h2>
<p data-bind='text: message'></p>
<select id="selectedMasjid" data-bind="options: items, value: selectedChoice, optionsText: 'name', optionsCaption: 'Choose...'"></select>
<br>
<div>
<table border="1" cellspacing="15"> <thead> <tr> <td>Date</td> <td>Fajar</td> <td>Zuhr</td> <td>Asar</td> <td>Maghrib</td> <td>Esha</td> <td>Jumma</td> </tr> </thead> <tbody data-bind="foreach: times"> <tr> <b><td data-bind="text: salatdate">date</td></b> <td data-bind="text: fajarjamat">Fajar</td> <td data-bind="text: zuhrjamat">Zuhr</td> <td data-bind="text: asarjamat">Asar</td> <td data-bind="text: maghrib">Maghrib</td> <td data-bind="text: eshajamat">Esha</td> <td data-bind="text: jumma">Jumma</td> </tr> </tbody>
</table>
</div> <script src='https://cdnjs.cloudflare.com/ajax/libs/knockout/3.3.0/knockout-min.js'></script>
<script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>

Get Masjid data via json from dropdown - Script Codes JS Codes

//define(['knockout', 'text!./masjid-options.html'], function(ko, templateMarkup) { var MasjidOptions = function() { var self = this; this.message = ko.observable('Select a local Masjid from list below'); this.items = ko.observableArray(); this.times = ko.observableArray(); this.selectedChoice = ko.observable(); //i.e. this.availableCountries = ko.observableArray(['France', 'Germany', 'Spain']) self.selectedChoice.subscribe(function (newValue) { // alert("the new value is " + newValue); // should show [Object] // alert("the new value is " + newValue['masjidtable']); // should show url for cut/paste self.times([]); var nurl = 'http://77.98.150.154/getmasjidweek.php?name=' + newValue['masjidtable']; // alert(nurl); // //self.selectedChoice(newValue); $.getJSON(nurl, null, function (data) { // alert(data); console.log(data); for (var i = 0; i < data.length; i++) { self.times.push(data[i]); } // alert(self.times().length); console.log(self.times()); }) // end getJSON }) // end subscribe var url = 'http://82.98.150.154/jsonpure4.php'; $.getJSON(url, null, function (data) { //alert(data); console.log(data); for (var i = 0; i < data.length; i++) { self.items.push(data[i]); } }); //end .getJSON } // end MasjidOptions(params) ko.applyBindings(MasjidOptions); // produces --> Uncaught Error: You cannot apply bindings multiple times to the same element
// return { viewModel: MasjidOptions, template: templateMarkup };
//});
Get Masjid data via json from dropdown - Script Codes
Get Masjid data via json from dropdown - Script Codes
Home Page Home
Developer Khalid Munir
Username khalidmunir
Uploaded August 26, 2022
Rating 3
Size 2,398 Kb
Views 30,360
Do you need developer help for Get Masjid data via json from dropdown?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Khalid Munir (khalidmunir) Script Codes
Create amazing blog posts with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!