Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7712937
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T01:44:54+00:00 2026-06-01T01:44:54+00:00

I have a YQL output JSON string at this URL: YQL JSON I found

  • 0

I have a YQL output JSON string at this URL: YQL JSON

I found some other

I am trying to understand why I cannot get certain items out of the JSON return. For example, using jQuery, if I want the first DIVs H1 I use:

$.ajax({
       url:"http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20html%20where%20url%3D%22http%3A%2F%2Fwww.missoulaavalanche.org%2Fcurrent-advisory%2F%22%20and%20xpath%3D'%2F%2Fdiv%5B%40id%3D%22content%22%5D%2Fdiv%5B1%5D'&format=json",
       dataType: 'jsonp',
       jsonp: 'callback',
       jsonpCallback: 'cbfunc'
    });
    function cbfunc(data){
      var id = data.query.results.div;

      $('#table').append('<li>'+id.h1+'</li>');

  $('#table').listview('refresh');
}       

I have tried to get some info, say the img alt or img src, from the second div… div1 like so:

function cbfunc(data){
      var id = data.query.results.div[1];

      $('#table').append('<li>'+id.img.alt+'</li>');

      $('#table').listview('refresh');
    }

I keep getting Undefined or no results… What I am missing or not understanding about getting results from the yql JSON list?

EDIT: I read a post on the YQL Blog about Cache busting… So I am using their suggestion there.

EDIT 2: here is the JSON from the yql. I would like to get div img src for example, but am not getting a return or I get an object. I think it would be data.query.results.div1.img.src

I get data.query.results.div.h1 no problem:

cbfunc({
 "query": {
  "count": 1,
  "created": "2012-03-28T15:36:28Z",
  "lang": "en-US",
  "results": {
   "div": {
    "id": "content",
    "div": [
     {
      "class": "post-2491 post type-post status-publish format-standard hentry category-advisories",
      "id": "post-2491",
      "h1": "March 26, 2012 Avalanche Advisory",
      "p": {
       "class": "postmetadata alt",
       "small": {
        "br": [
         null,
         null
        ],
        "a": {
         "href": "http://www.missoulaavalanche.org/category/advisories/",
         "rel": "category tag",
         "title": "View all posts in Advisories",
         "content": "Advisories"
        },
        "content": "This entry was posted on Monday, March 26th, 2012 at 6:55 am\n Categories: \n"
       }
      },
      "div": [
       {
        "id": "danger_rating",
        "a": {
         "href": "http://www.missoulaavalanche.org/wp-content/themes/missoula-avalanche/images/ratings/avalanche_danger_scale.jpg",
         "img": {
          "alt": "Current Danger Rating is MODERATE",
          "src": "http://www.missoulaavalanche.org/wp-content/themes/missoula-avalanche/images/ratings/moderate.gif"
         }
        }
       },
       {
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T01:44:55+00:00Added an answer on June 1, 2026 at 1:44 am

    It’s easier than you think if you use jQuery.getJSON.

    Try this:

    $.getJSON("http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20html%20where%20url%3D%22http%3A%2F%2Fwww.missoulaavalanche.org%2Fcurrent-advisory%2F%22%20and%20xpath%3D'%2F%2Fdiv%5B%40id%3D%22content%22%5D%2Fdiv%5B1%5D'&format=json",
              function(data) {
                  var id = data.query.results.div;
                  $('#table').append('<li>'+id.h1+'</li>');
                  $('#table').listview('refresh');
              }
    );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this this feed from Yahoo (YQL) and need to output some info
i am trying to get access to whitepages using YQL. Unfortunately i don't have
Problem I have a YQL query result that I'm trying to get converted and
I have this situation where I need to get some data from a webpage
I have been trying to understand how to return links from yql results, but
I have a problem here. I am using YQL & jQuery to get some
Have you managed to get Aptana Studio debugging to work? I tried following this,
I have this code : $(document).ready(function(){ $(#search_input).autocomplete({ source: function(request, response) { $.ajax({ url: 'http://query.yahooapis.com/v1/public/yql',
I have this: $(#term).autocomplete({ minLength: 2, source: function( request, response ) { $.ajax({ url:
I have a string like x = http://query.yahooapis.com/v1/public/yql?q=select%20owner%2Curls%20from%20flickr.photos.info%20where%20photo_id%3D'%s'&format=json If I do x % 10

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.