Results 1 to 2 of 2

Thread: Live Search using Ajax and JSON doesn't work on Plunker!

  1. #1
    Join Date
    Jan 2017
    Posts
    29
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Question Live Search using Ajax and JSON doesn't work on Plunker!

    Hi,

    I'm trying to test a live search using JSON and Ajax on Plunker.
    However the code doesn't work!
    Is anything wrong with my code or Plunker isn't able to handle Ajax requests?

    Here is my example
    http://plnkr.co/edit/ZkXMcRsHCuYg4axN5DL8?p=preview

    Thanks

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    You don't really have any code I can see other than this:

    Code:
    $(document).ready(function(){
      
      $.getJSON('data.json', function(data) {
        console.log(data);
      }); // get JSON
      
    }); // document ready
    That much appears to be working. I see this in the console (I expanded one element to see that it contains the expected information):

    Code:
    Object
    speakers
    :
    Array[9]
    0
    :
    Object
    1
    :
    Object
    bio
    :
    "The Artist to Watch in 2012 by the London Review, Johnathan has already sold one of the highest priced-commissions paid to an art student, ever on record. The piece, entitled Gratitude Resort, a work in oil and mixed media, was sold for $750,000 and Jonathan donated all the proceeds to Art for Peace, an organization that provides college art scholarships for creative children in developing nations"
    name
    :
    "Jonathan G. Ferrar II"
    reknown
    :
    "Artist to Watch in 2012"
    shortname
    :
    "Jonathan_Ferrar"
    __proto__
    :
    Object
    2
    :
    Object
    3
    :
    Object
    4
    :
    Object
    5
    :
    Object
    6
    :
    Object
    7
    :
    Object
    8
    :
    Object
    length
    :
    9
    __proto__
    :
    Array[0]
    The page appears to be using jQuery 1.8.3 though, not the apparently desired 2.2.4.
    Last edited by jscheuer1; 01-20-2017 at 05:50 PM.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Similar Threads

  1. Jquery w/ json search
    By crobinson42 in forum JavaScript
    Replies: 2
    Last Post: 07-05-2013, 07:57 PM
  2. Ajax tabs content doesn't work in IE 6
    By Pedro_CM in forum Dynamic Drive scripts help
    Replies: 2
    Last Post: 02-27-2011, 10:38 PM
  3. Replies: 1
    Last Post: 03-12-2008, 09:43 PM
  4. <script> in Ajax doesn't work
    By tp4fp in forum JavaScript
    Replies: 0
    Last Post: 01-16-2008, 04:28 AM
  5. AJAX doesn't work
    By eamon in forum Dynamic Drive scripts help
    Replies: 0
    Last Post: 06-29-2006, 01:45 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •