0

I have an HTML page from which i want to read a remote webpage which is at http://xtremeinspection.com/new2you4kids/app/android/get_product_size.php?productID=113

The webpage returns a value depending on the Query string parameter passed that is the productID

My question is since its cross domain reading data which is the best method to use Jquery/Ajaz/Json or mix of all these ?

I have searched it on Google but i cant find example of reading and displaying the data in a DIV .

I am using this code but it doesnt display anything

<script type="text/javascript"src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"></script>
        <script>
            $(document).ready(function(){
                $.getJSON('http://xtremeinspection.com/new2you4kids/app/android/get_product_size.php?productID=113', function(data){
                    $.each(data, function(i, tweet){
                        $('#tweets').append('<li>' + tweet.text + '</li>');
                        alert(tweet.text);
                    });
                });
            });
        </script>

 <ul id="tweets"></ul>
0

1 Answer 1

1

A basic example like this should help you get started:

$.getJSON("http://api.flickr.com/services/feeds/photos_public.gne?jsoncallback=?",
  {
    tags: "gulmarg",
    tagmode: "any",
    format: "json"
  },
  function(data) {
    $.each(data.items, function(i,item){
      $("<img/>").attr("src", item.media.m).appendTo("#images");
      if ( i == 5 ) return false;
    });
  });

DEMO

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.