m
Line 1: Line 1:
 +
[[Category:Data]]
 
= Ayah =
 
= Ayah =
  
Line 30: Line 31:
  
 
<br/><br/>'''JSON Response:&nbsp;''' [http://api.globalquran.com/ayah/10/quran-simple http://api.globalquran.com/ayah/10/quran-simple]
 
<br/><br/>'''JSON Response:&nbsp;''' [http://api.globalquran.com/ayah/10/quran-simple http://api.globalquran.com/ayah/10/quran-simple]
<pre class="prettyprint javascript">
+
<pre class="prettyprint javascript">{
{
+
 
&nbsp;&nbsp;&nbsp; "quran": {
 
&nbsp;&nbsp;&nbsp; "quran": {
 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "quran-simple": {
 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "quran-simple": {

Revision as of 17:35, 28 January 2012

Ayah

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:

  • Surah & Ayah:  [http://api.globalquran.com/ayah/114:6/quran-simple http://api.globalquran.com/ayah/114:6/quran-simple]
  • Verse Number:  [http://api.globalquran.com/ayah/6023/quran-simple http://api.globalquran.com/ayah/6023/quran-simple]




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": "الَّذِينَ يُؤْمِنُونَ بِالْغَيْبِ وَيُقِيمُونَ الصَّلَاةَ وَمِمَّا رَزَقْنَاهُمْ يُنْفِقُونَ"
            }
        }
    }
}



Examples:

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:

Comments


blog comments powered by Disqus

.