Posted inTechnology / Ajax / AngularJS / ASP.NET / JavaScript / jQuery

How to display cross domain json data using Jquery

How to display cross domain json data using Jquery

In this Post We Will Explain About is How to display cross domain json data using Jquery With Example and Demo.Welcome on Pakainfo.com – Examples, The best For Learn web development Tutorials,Demo with Example! Hi Dear Friends here u can know to Accessing other domain web services via jQuery Ajax Example

In this post we will show you Best way to implement jQuery’s JSONP Explained with Examples, hear for Display different domain data using Jquery and JSON with Download .we will give you demo,Source Code and examples for implement Step By Step Good Luck!.

PHP – json from another domain using jquery

Some more days back I had new posted a Live24comu. about parsing data like as a JSON data with jQuery using .getJSON() functions. In this post I want to learn about ‘How to use JSON callback as well as to display cross domain data using jQuery’. this is a simple and useful.

Just copy and paste means put this following source code between tag. we can display another domain data.




    domain.json.js

    Javascript some following source code read the here JSON file.

    $(document).ready(function()
    {
    $.getJSON("https://www.pakainfo.com/json.php?total_count=5&jsoncall=?",function(data)
    {
    $.each(data.posts, function(i,data)
    {
    var jsondata ="
  1. "+data.comments+"
  2. "; $(jsondata).appendTo("ol#liveJSONData"); }); } ); return false; });

    json.php

    Contains simple PHP code displaying some results from clients table in JSON format.

    
    

    domain_css.css

    *{margin:0px; padding:0px;}
    ol.live-jsonbox {
    font-family:"lucida grande",tahoma,verdana,arial,sans-serif;
    font-size:12px;
    color:#FF3D3D;
    list-style:none;
    width:300px;
    padding:10px 10px 25px 10px;
    background:url(https://www.pakainfo.com/vue/live.jpg)
    bottom right no-repeat;
    background-color:#3D3D3D;
    text-align:center
    }
    ol.live-jsonbox li { padding-bottom:4px}
    ol.live-jsonbox li a{color:#80c8e5; text-decoration:none}
    ol.live-jsonbox li a:hover{color:#80c8e5; text-decoration:underline}
    

    Example

    I hope you have Got What is How to access cross-domain data with AJAX using JSONP And how it works.I would Like to have FeadBack From My Blog(Pakainfo.com) readers.Your Valuable FeadBack,Any Question,or any Comments abaout This Article(Pakainfo.com) Are Most Always Welcome.

    I am Jaydeep Gondaliya , a software engineer, the founder and the person running Pakainfo. I'm a full-stack developer, entrepreneur and owner of Pakainfo.com. I live in India and I love to write tutorials and tips that can help to other artisan, a Passionate Blogger, who love to share the informative content on PHP, JavaScript, jQuery, Laravel, CodeIgniter, VueJS, AngularJS and Bootstrap from the early stage.

    Leave a Reply

    Your email address will not be published. Required fields are marked *

    We accept paid guest Posting on our Site : Guest Post Chat with Us On Skype