Skip to Content
0
Jun 16, 2016 at 05:31 AM

How to convert the odata field value from html format to JSON format?

384 Views

Hi all,

I use the following successfactor's odata for one of my app:

" https://apisalesdemo8.successfactors.com/odata/v2/JobRequisitionLocale "


The 'jobDescription' field of this odata is in HTML format.

<d:jobDescription>
<p> The Account Manager is a sales professional with a history of over-performance in quota attainment, winning new business and developing existing accounts
.<br /> <br /> <b>Responsibilities</b><br /> The successful candidates will possess the following qualifications:</p> <ul> <li> 8-10 year background of 
successful sales experience to Fortune 2000 accounts</li> <li> Must have a history of exceeding annual sales quotas for last 3-5 consecutive years.
</li> <li> Ability to manage major account sales cycles to global Fortune 2000 organizations</li> <li> Will have key contacts in the software industry.
</li> <li> Excellent written/verbal communication skills to interact with senior level corporate management.</li> <li> Operates with a sense of urgency 
and has a positive, winning attitude.</li> <li> Proven ability to prospect and manage a designated territory to maximize revenue growth.</li> </ul>
 </d:jobDescription>

Now, I need to convert that HTML format into json object to use it in my app.I tried the following code.

var jdescs=oData.results[0].jobDescription;

var Odata=jdescs.JSON();

alert(JSON.stringify(Odata));

But it's showing me " Uncaught TypeError: jdescs.JSON is not a function".

Can someone help me with this.

Thanks,

Ramya