m |
|||
Line 1: | Line 1: | ||
+ | [[Category:Data]] | ||
= Ayah = | = Ayah = | ||
Line 30: | Line 31: | ||
<br/><br/>'''JSON Response: ''' [http://api.globalquran.com/ayah/10/quran-simple http://api.globalquran.com/ayah/10/quran-simple] | <br/><br/>'''JSON Response: ''' [http://api.globalquran.com/ayah/10/quran-simple http://api.globalquran.com/ayah/10/quran-simple] | ||
− | <pre class="prettyprint javascript"> | + | <pre class="prettyprint javascript">{ |
− | { | + | |
"quran": { | "quran": { | ||
"quran-simple": { | "quran-simple": { |
Fetchs the quran ayah data. This will pull the single ayah only
Url: [http://api.globalquran.com/ayah/getAyah/quranID http://api.globalquran.com/ayah/getAyah/quranID]
attribute | Value | Description |
---|---|---|
getAyah | surah:ayah number or verse number | Identify here what page number you want to pull |
quranID | quran id | list of quran id seperated by | (pipe) |
Url Examples By:
JSON Response: [http://api.globalquran.com/ayah/10/quran-simple http://api.globalquran.com/ayah/10/quran-simple]
{ "quran": { "quran-simple": { "10": { "surah": 2, "ayah": 3, "verse": "الَّذِينَ يُؤْمِنُونَ بِالْغَيْبِ وَيُقِيمُونَ الصَّلَاةَ وَمِمَّا رَزَقْنَاهُمْ يُنْفِقُونَ" } } } }
Example: Loads the verse number 10, which also can be wrote as 2:3
<!DOCTYPE html> <html> <head> <style>#demo-1{ color:lightBlue; }</style> <script src="http://code.jquery.com/jquery-latest.js"></script> </head> <body> <div id="demo-1"> </div> <script> $.ajaxSetup({ cache: true, jsonpCallback: 'quranData' }); // define ajax setup $.getJSON("http://api.globalquran.com/ayah/10/quran-simple?jsoncallback=?", { format : "jsonp" }, function(data) { $.each(data.quran, function(i, by) { $.each(by, function (verseNo, line) { $("<p>").html(line.surah+':'+line.ayah+' '+line.verse).appendTo("#demo-1"); }); }); }); </script> </body> </html>
Demo:
.