Line 4: Line 4:
 
Get's the complete quran with one request. useful for offline mode.
 
Get's the complete quran with one request. useful for offline mode.
  
'''Url:''' [http://api.globalquran.com/complete/quranID?format=json http://api.globalquran.com/complete/quranID?format=json]
+
'''Url:''' [http://api.globalquran.com/complete/quranID?format=json http://api.globalquran.com/complete/quranID?key=api_key&format=json]
  
 
{| border="1" cellspacing="1" cellpadding="1" style="width: 500px;"
 
{| border="1" cellspacing="1" cellpadding="1" style="width: 500px;"
Line 15: Line 15:
 
| quran id
 
| quran id
 
| list of quran id seperated by '''|''' (pipe)
 
| list of quran id seperated by '''|''' (pipe)
 +
|-
 +
| key
 +
| api key
 +
| your site / app api key here
 
|}
 
|}
  
Line 21: Line 25:
 
'''Url Examples By:'''
 
'''Url Examples By:'''
  
*line by line: [http://api.globalquran.com/complete/quran-simple http://api.globalquran.com/complete/quran-simple]
+
*line by line: [http://api.globalquran.com/complete/quran-simple http://api.globalquran.com/complete/quran-simple?key=api_key]
*json format: [http://api.globalquran.com/complete/quran-simple?format=json http://api.globalquran.com/complete/quran-simple?format=json]
+
*json format: [http://api.globalquran.com/complete/quran-simple?key=api_key&format=json http://api.globalquran.com/complete/quran-simple?key=api_key&format=json]
  
  
Line 41: Line 45:
 
<script>
 
<script>
 
$.ajaxSetup({ cache: true, jsonpCallback: 'quranData' }); // define ajax setup
 
$.ajaxSetup({ cache: true, jsonpCallback: 'quranData' }); // define ajax setup
$.getJSON("http://api.globalquran.com/complete/quran-simple?jsoncallback=?", {
+
$.getJSON("http://api.globalquran.com/complete/quran-simple?key=api_key&jsoncallback=?", {
 
     format&nbsp;: "jsonp"
 
     format&nbsp;: "jsonp"
 
}, function(data)
 
}, function(data)

Latest revision as of 03:36, 9 March 2014

Complete Quran

Get's the complete quran with one request. useful for offline mode.

Url: [http://api.globalquran.com/complete/quranID?format=json http://api.globalquran.com/complete/quranID?key=api_key&format=json]

attribute Value Description
quranID quran id list of quran id seperated by | (pipe)
key api key your site / app api key here


Url Examples By:

  • line by line: [http://api.globalquran.com/complete/quran-simple http://api.globalquran.com/complete/quran-simple?key=api_key]
  • json format: [http://api.globalquran.com/complete/quran-simple?key=api_key&format=json http://api.globalquran.com/complete/quran-simple?key=api_key&format=json]


Examples:

Example:  Complete load the simple quran and display only 10 verses from it.

<!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/complete/quran-simple?key=api_key&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");
            if (verseNo == 10)
                return false;
	});
    });
});
</script>
</body>
</html>

Demo:

Comments


blog comments powered by Disqus

.