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 8723661
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T07:40:38+00:00 2026-06-13T07:40:38+00:00

I am a newbie to javascript. I am experimenting with the below code for

  • 0

I am a newbie to javascript. I am experimenting with the below code for retrieving cross site data.

How can I do this code work, e.g. I want each family member is alerted to the screen.

Thank you for your help.

The code is amended like this and the alert says [object Object], do you know what this means??:

<html>
<head>
<script type="text/javascript" 

src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript">

      // LOOP THROUGH EACH FAMILY MEMBER AND DO STUFF!
      alert(mValue)
    });
}
});
</script>
</head>
<body>
</body>
</html>
  • 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-13T07:40:40+00:00Added an answer on June 13, 2026 at 7:40 am

    you don’t want to wrap the oData with jQuery in your $.each

    so, instead of

    $.each($(oData['ops:patent-family']['ops:family-member']),
    

    you want:

    $.each(oData['ops:patent-family']['ops:family-member'],
    

    Also – you have to go down a level with the returned json (there is a first ‘ops:world-patent-data’ level), which will look something more like:

    if(oData['ops:world-patent-data'] && 
      oData['ops:world-patent-data']['ops:patent-family'] && 
      oData['ops:world-patent-data']['ops:patent-family']['ops:family-member']){
    
      $.each(oData['ops:world-patent-data']['ops:patent-family']['ops:family-member'],
        function(iIndex, mValue) {
          // LOOP THROUGH EACH FAMILY MEMBER AND DO STUFF!
          console.log(iIndex, mValue)
        });
    
    }
    

    Another completely different way to do this is by using jquery deferreds syntax and using .pipe to transform the data – might be a bit cleaner than the if

    var sUrl =  "http://ops.epo.org/2.6.2/rest-services/family/publication/docdb/EP.1000000.A1/.js?callback=?";    
    
    $.getJSON(sUrl)
    .pipe(function(data){
        try{
            return data['ops:world-patent-data']['ops:patent-family']['ops:family-member'];
        } catch(e){
            return [];
        }
    })
    .then(function(members){
        $.each(members, function(iIndex, mValue){ 
            console.log(iIndex, mValue)
        })
    })
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

A JavaScript newbie here. I have this following code: function testObject(elem) { this.test =
Javascript newbie here, just trying to tweak this bit of code. It checks for
I am newbie of JavaScript and studying with textbook. I wrote below code, and
JavaScript newbie here, I was going through some js code at work when i
I want to use this javascript but being able to hard code 3 users,
Im a javascript newbie and would need some help with this simple thing... I
Bit of a javascript newbie so not sure if this question is easy or
hi i am newbie to javascript.... i want to synchronize scrolling of two select
I am basically a newbie with javascript. I want to populate a div in
I am newbie. many of javascript code start with <!-- <script type=text/javascript> <!-- and

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.