Pikachu
Kelp is good! Yum yum!
- Pronoun
- he
Okay, I've discovered the sheer easiness of creating a Google Chrome extension, so now I'm trying to do just that. I'm developing a Prayer Times (a timetable thing for Muslims so that they know if it's time to pray when they're browsing the web) and I'm using XML instead of a MySQL database for the extension. This is an example of how the XML page looks:
I'm having a problem being able to select the times of a specific date in Javascript. Say I want the time for "asr" on the "1" of "January". How would I do that in JavaScript? I want to be able to change months and days as well. This is what I have so far in JavaScript:
Thanks again.
Code:
<?xml version="1.0" encoding="UTF-8" ?>
<praytimes>
<month name="January">
<day value="1">
<imsaak>05:29</imsaak>
<fajr>05:39</fajr>
<sunrise>06:58</sunrise>
<dhuhr>11:56</dhuhr>
<asr>14:36</asr>
<sunset>16:55</sunset>
<magrib>17:12</magrib>
<isha>18:09</isha>
</day>
<day value="2">
<imsaak>05:29</imsaak>
<fajr>05:39</fajr>
<sunrise>06:58</sunrise>
<dhuhr>11:57</dhuhr>
<asr>14:37</asr>
<sunset>16:55</sunset>
<magrib>17:12</magrib>
<isha>18:09</isha>
</day>
<day value="3">
<imsaak>05:29</imsaak>
<fajr>05:39</fajr>
<sunrise>06:58</sunrise>
<dhuhr>11:57</dhuhr>
<asr>14:38</asr>
<sunset>16:56</sunset>
<magrib>17:13</magrib>
<isha>18:10</isha>
</day>
</month>
</praytimes>
I'm having a problem being able to select the times of a specific date in Javascript. Say I want the time for "asr" on the "1" of "January". How would I do that in JavaScript? I want to be able to change months and days as well. This is what I have so far in JavaScript:
Code:
<html>
<head>
<style type="text/css">
body {
min-width: 357px;
overflow-x: hidden;
}
</style>
</head>
<body>
<p><b>Imsaak:</b> <span id="imsaak"></span><br />
<b>Fajr:</b> <span id="fajr"></span></p>
<script type="text/javascript">
xhttp = new XMLHttpRequest()
xhttp.open("GET","praytimes.xml",false);
xhttp.send("");
xmlDoc = xhttp.responseXML;
document.getElementById("imsaak").innerHTML = xmlDoc.getElementsByTagName("imsaak")[0].childNodes[0].nodeValue;
document.getElementById("fajr").innerHTML = xmlDoc.getElementsByTagName("fajr")[0].childNodes[0].nodeValue;
</script>
</body>
</html>
Thanks again.