JSON

506

Solutions

545

Contributors

JavaScript Object Notation, or JSON, is human-readable text used when transmitting data objects consisting of attribute:value pairs between a server and a web application as an alternative to XML. JSON, while it is originally derived from JavaScript, is a language-independent data format. Code for parsing and generating JSON data is available in many programming languages.

Share tech news, updates, or what's on your mind.

Sign up to Post

Dear Experts,

I post a payment request to a payment website, then the web site returns me the below data as a succesful result.

I get the result like this

$raw = file_get_contents('php://input');
and when I print_r($raw); I get the below result.

I want to decode the result and put the parameters into arrays however I can not decode it properly.
How can I decode it?
I tried to decode it like below twice. When I did that, it only gives me the result but it doesn't give the header of the result.
what do you suggest I should do?
$new = urldecode($raw);
$new = urldecode($new);

Open in new window

0
Learn by Doing. Anytime. Anywhere.
Learn by Doing. Anytime. Anywhere.

Do you like to learn by doing?
Our labs and exercises give you the chance to do just that: Learn by performing actions on real environments.

Hands-on, scenario-based labs give you experience on real environments provided by us so you don't have to worry about breaking anything.

Hi Experts,

I recently started a tutorial (http://bitoftech.net/2014/10/27/json-web-token-asp-net-web-api-2-jwt-owin-authorization-server/)
but when build and browser I received the above error.

I have actually downloaded the code and still got the same error. I also followed some fixes suggesting that I enable directory browsing in IIS, which I have done and still doesn't work.

Just wondering if anyone knows a work around?

Kind Regards

Mike
0
I have a table with two columns containing a varchar(max) column (`vertices`) and a geography datatype column (`geography`).

in the varchar(max), i have a saved google maps polygon JSON string:

[{"lng":-82.54841995396418,"lat":27.36429736498091},{"lng":-82.54730415501399,"lat":27.35995237468737},{"lng":-82.54224014439387,"lat":27.360257291850118},{"lng":-82.53760528721614,"lat":27.363611325218592},{"lng":-82.54352760472102,"lat":27.365135852250216},{"lng":-82.54841995396418,"lat":27.36429736498091}]

I'm trying to convert this into a SQL Server geography data type using an update script:

   
 UPDATE [AOI]
    SET [geography] = geography::STGeomFromText('POLYGON(('+vertices+'))', 4326)
    END

Open in new window


This isn't working.
How do I make the conversion?

Thanks
0
Hi Guys,
I send json data from my server to the view in MVC project.

Here is the link I send as a json:
dataCell.textCell = "<a onmouseout='HideFlyOut()' ;="" class='theme_color' onmouseover='ShowFlyOut('" + encryptedRowPass + "') href=\documentviewer.aspx?" + encryptedValue + "'<i class='fa fa-paperclip fa-flip-horizontal fa-2x theme_color'></i></a>"

Open in new window



Now in my UI side I'm getting this data which is one row and parse it to json:

 var sendDataRowsToView = JSON.parse(datarows)

Open in new window


Then I"m trying to place this data into a <td> in my dom:

 tableBody.append('<td> + sendDataRowsToView + </td>')

Open in new window



I'm getting the data and all works fine but it doesn't bind it to the dom:

Like I'm expecting to see for exmaple:
<td><a></a></td> which bind all the link from the server, but for some reason I can't see this data in my dom.

what am I doing wrong?
0
This is my first foray into JSON and I'm trying to develop an autocomplete field with JSON, php and sql.  I've got it working on a single field (employee Name) but would like to add a second field that gets populated by the employee title when the employee name is selected.  

So far, my test page looks like:
<!DOCTYPE html>
<html>
<head>
    <title>Autocomplete Textbox Demo | PHP | jQuery</title>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
    <link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/themes/smoothness/jquery-ui.css">
    <script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>

    <script type="text/javascript">
        $(function() {
            var availableTags = <?php include('fetchEmpName.php'); ?>;
            $("#empName").autocomplete({
                source: availableTags,
                autoFocus:true
            });
        });
    </script>
</head>
<body>
<label>Department Name</label></br>
<input id="empName" type="text" size="50" />
<input id="empTitle" type="text" size="50" />
</body>
</html>

Open in new window


And the fetchEmpName.php file is like:
<?php
require('i_PDOConnection.php');
$query = "SELECT empFName + ' ' + empLName as [empName], empTitle FROM tbl_CouncilStaff WHERE active = 1 AND display = 1 AND (empFName LIKE '%".$search."%' OR empLName LIKE '%".$search."%') ORDER BY empLName";
$stmt = $dbh->prepare($query);
$stmt->execute();
$data = $stmt->fetchAll();
foreach ($data as $row) {
    $empName[] = $row['empName'];
    $empTitle[] = $row['empTitle'];
}
 $arrData = array($empName,$empTitle);
 echo json_encode( $arrData );
?>

Open in new window


The code is working if I only use the $empName or $empTitle array and encode that ($data = $empTitle or $data=$empName.  

However making an array of both arrays causes the empName box to return two blank lines instead of any names or titles when I type.  I get that, but I don't know what to do about it to access the underlying data and have the names list in text box one and populate the employee title to text box two upon a selection.

As always, thanks in advance for any help offered.
0
I have a page that generates this json output
{"address":"1234 East Main Street","city":"Anywhere"}

Open in new window


I created it using this PHP function on an index.php page
$address="1234 East Main Street";
$city="Anywhere";
echo json_encode(array('address'=>$address,'city'=>$city));

Open in new window


I then have the script shown below attached to the top of the index page that includes this ajax script that should be parsing and returning the values in my console.  I only get error messages

$(function() {

    $.ajax({
        url : 'index.php',
        type : 'POST',
        data : {"address":"address","city":"city"},
        dataType : 'json',
        success : function (result) {
           alert(result['address']); // alert box
           console.log(result['city']) // city in console
        },
        error : function () {
           alert("error");
        }
    });
});

Open in new window


Im very new to ajax so I'm hoping im just overlooking something simple but if there is a better way to do it altogether im open to that too. Thanks!
0
I've got an ajax call that returns the following object:

d:
[{"Name":"Elvis", "Num":"100", "Phone":"Y"},{"Name":"Presely", "Num":"101", "Phone":"N"},{"Name":"Maria", "Num":"103", "Phone":"Y"}]


I'm trying to loop over everything so I can capture the values. The variable that contains this object is json.  I've tried the following code and haven't gotten any where and I'm stuck:
jQuery.each(json, function (i, val) {
  $.each(val, function (j, v) {
            alert( v.Name +  v.Num + v.phone)
                });

Open in new window


Any thoughts?
0
Hi Guys,

I would like to get the property names from a Javascript object to build a table dynamically. Example:

var data = [{
        Name: "xxxx",
        Last: "bbbbb"
                },
{
        Name: "ddddd",
        Last: "sssss"
}]

Now imagine this properties (Name , Last) come in different name from the database so how could I retrieve the property data from the json array with javascript.

Thank.
0
I have a function that calls an AJAX request so I can have data returned.  Currently when I step through the code everything works, but when I get to the AJAX it steps over it but my web method (vb.net) does not fire.  I've double and triple checked my ajax url, added async:false, added  error handling, and even added the function inside of the function to try and get this to work.  If I expose the ajax outside of the function everything seems to work fine except it fires when the page loads and not when a button is pressed.


Below is my code:

function writeTable(SectionID, tableid,year) {


    var json = get_Data();
....

Open in new window


function get_Data() {
    $(function () {
        $.ajax({
            type: "Get",
            contentType: "application/json; charset=utf-8",
            url: "Test.aspx/Get_Results",
            data: JSON.stringify(),
            dataType: "json",
            async: "false",
            success: function (response) {
                alert('sucess');
            },

            error: function (jqXHR, exception) {
                var msg = '';
                if (jqXHR.status === 0) {
                    msg = 'Not connect.\n Verify Network.';
                } else if (jqXHR.status == 404) {
                    msg = 'Requested page not found. [404]';
                } else if (jqXHR.status == 500) {
                    msg = 'Internal Server Error [500].';
                } else if (exception === 'parsererror') {
          

Open in new window

0
Hello,
I try out SQL to query a table and get an sorted result. My table is

ID
parent
name
date

1 ; 0 ; "parameter"
3; 1; "names" 
4;3; "name 1"
5;3; "name 2"
6;3;"name 3"
7;5;"name 4"

Open in new window


The ID is an auto increase value. Each ID has one or more parents.
Final I want to get a result that shows me the name of all IDs an their parents parent in JSON.

{
   "first parent": {
      "Second item",
      "third item": {
          "fourth item",
       }
   "fifth item",
   }
}

Open in new window


How looks an SQL Query for this? I have to go much more deeper but I want to learn how to sort a database and make a JSON from it

Thanks,

Ingo
0
Percona Live Europe 2017 | Sep 25 - 27, 2017
LVL 3
Percona Live Europe 2017 | Sep 25 - 27, 2017

The Percona Live Open Source Database Conference Europe 2017 is the premier event for the diverse and active European open source database community, as well as businesses that develop and use open source database software.

Hi experts, is there way (util, script, open source/ licensed product) to receive Jason and generate HTML pls?
0
I have a working Jquery modal dialog which includes a form to collect a contacts address. At the top of the form is a drop down list which returns pre-defined addresses and a 'Use Address' button (id="signal).  The user can choose a pre-defined address if they wish and click the 'Use Address' button which takes the address values and pre-populates the form, thereby, saving the user from having to type in the address manually.

The html for modal form is
<div id="addcontact-window" title="Add Agency Contact">
    <div align="center">
    <p id="errors6"></p>
    </div>
    <form id="addcontactForm" name="addcontactForm" action="" method="post">
    <div id="addcontactFormBody"></div> 
    </form>
    </div>

Open in new window


The jquery code which declares/defines the dialog is:

$("#addcontact-window").dialog(
                        {
                        autoOpen: false,
                        maxWidth:850,
                        maxHeight: 700,
                        width: 850,
                        height: 700,
                        draggable: true,
                        modal: true,
                        buttons: {
                          "Save": function () 
                          { 
                          $.post("./add_agencycontact_process.php", $("#addcontactForm").serialize(), function(response)
                            {
                            if(!response)
                            {
                            

Open in new window

0
Oh men,
Im wondering it is a free plugin or some calendar for  an consulting room apointment
its any idea or recomendation if its for free or open source better
regards
0
I am using Javascript, HTML, Json and PHP.  The emails were sending but now they are not.  Any help is appreciated.  Thank you.

www.mediascrubber.com/videos.html


<script src="https://code.jquery.com/jquery-2.2.4.js"></script>
<script>
$(function() {
  $("#myform").on('submit', function(e) {
    e.preventDefault();
    $.ajax({
      url: '//jsbin.com/vufeyag.json',
      dataType: 'json',
      data: $("#myform").serialize()
    }).done(function(d) {
      if (d.success==true) {
        $("#myform").hide();
        $("#results").text("Thanks!").show();
      }
    });
  });
});
</script>>

Open in new window


<?php

$webmaster_email = "ds@mediascrubber.com";
$email_address = $_REQUEST['email_address'] ;

function isInjected($str) {
	$injections = array('(\n+)',
	'(\r+)',
	'(\t+)',
	'(%0A+)',
	'(%0D+)',
	'(%08+)',
	'(%09+)'
	);
	$inject = join('|', $injections);
	$inject = "/$inject/i";
	if(preg_match($inject,$str)) {
		return true;
	}
	else {
		return false;
	}
}


if (!isset($_REQUEST['email_address'])) {
header( "Location: $feedback_page" );
}
elseif ( isInjected($email_address) ) {
header( "Location: $error_page" );
}
else {
mail( "$webmaster_email", "Subscruber",
 
   "From: $email_address" );
   

}
$jsonurl = "http://api.wipmania.com/json";
$json = file_get_contents($jsonurl);
var_dump(json_decode($json));
?>

Open in new window


<form id="myform" class="form-horizontal" action="send_mail.php" method="post">
				<div class="input-group">
                <input type="text" name="email_address" class="def-input" placeholder="Your Email Here">
                <span class="input-group-btn">
                <button class="btn-form btn" input type="submit">Subscribe</button>
                </span>
                
				</div>
                </form>
                <div id="results" style="display: none;"></div>

Open in new window

0
Hello

I'm busy on a project where i have read only access to an oracle database.
Got a running webserver (LAMP) with a running OCI8 connection.
I'm trying to get a select query result from the following:

TableA
ID
DOC_ID
Date
Type

TableB
ID
DOC_ID (references tableA)
FILE_NAME
FILE_ID
FILE_TYPE

TableB can contain more then one result for the same DOC_ID.

The goal is to get the data from TableA appended with the results from TableB where the DOC_ID is the same and get them into a JSON format.
Looking like

{
	"data": [{
		"ID": "123456",
		"DOC_ID": "789456",
		"Date": "2/1/2016",
		"Type": "PI",
		"FILE_NAME": [
			"File1.pdf", "File2.docx"
		],
		"FILE_TYPE": [
			"PDF", "DOCX"
		],
		"FILE_ID": [
			"453215", "654687"
		]
	}, {
		"ID": "544569",
		"DOC_ID": "001223",
		"Date": "2/8/2016",
		"Type": "PI",
		"FILE_NAME": [
			"File1.txt"
		],
		"FILE_TYPE": [
			"TXT"
		],
		"FILE_ID": [
			"453215"
		]
	}, {
		"ID": "2225599",
		"DOC_ID": "0148966",
		"Date": "2/1/2017",
		"Type": "PI",
		"FILE_NAME": [
			"File1.xml", "File2.xml", "File3.xml"
		],
		"FILE_TYPE": [
			"XML", "XML", "XML"
		],
		"FILE_ID": [
			"00147788", "00114455", "00113210"
		]
	}]
}

Open in new window


Any advise on how to best go about this is welcome.
0
I have a very simple JSON feed and have been able to parse the feed using the below code. However, when the script gets to the "OFFERS" structure, it won't output the results cause it sees the brackets [ ] and is treating the data as a LIST of objects under OFFERS instead of objects like they would be under normal braces { }. I don't know how to get Coldfusion to properly give me the subitems of OFFERS.  You can easily see the feed using the link I provide also.

<cfoutput>
<cftry>
	<cfhttp url="https://rest.bandsintown.com/artists/spencerkane/events?app_id=day6mgmt&date=2017-08-19" result="httpResult" charset="utf-8" method="get"/>
 	<cfset BITdata = deserializeJSON(httpResult.filecontent)/>
	<cfloop array="#BITdata#" index="post">
		<cfif StructKeyExists(post, "datetime")>
			<cfset event_date = post.datetime>
		<cfelse>
			<cfset event_date = "">
		</cfif>
		<cfif StructKeyExists(post, "venue") and StructKeyExists(post.venue, "name")>
		    <cfset ev_title = post.venue.name>
		<cfelse>
            <cfset ev_title = "">
		</cfif>
		<cfif StructKeyExists(post, "venue") and StructKeyExists(post.venue, "city")>
			<cfset city = post.venue.city>
		<cfelse>
			<cfset city = "">
		</cfif>
		<cfif StructKeyExists(post, "venue") and StructKeyExists(post.venue, "region")>
			<cfset region = post.venue.region>
		<cfelse>
			<cfset region = "">
		</cfif>
		<cfif StructKeyExists(post, "offers[url]")>
		<cfset tickets = post.offers[url]>
			<cfelse>
		<cfset tickets = "">
		

Open in new window

0
In my .net c# project I have two jason like this

Json1
{"WindowsServices":[{"name":"SNMP","statusID":"1","StatusMsg":"Stopped","FullStatus":"SNMP,1"},{"name":"SNMPTRAP","statusID":"1","StatusMsg":"Stopped","FullStatus":"SNMPTRAP,1"}]}

Open in new window


Json2
{"WindowsServices":[{"name":"SNMP","statusID":"4","StatusMsg":"Running","FullStatus":"SNMP,4"},{"name":"SNMPTRAP","statusID":"1","StatusMsg":"Stopped","FullStatus":"SNMPTRAP,1"}]}

Open in new window


I need to compare this to json and get the result of the modified part oly
{"WindowsServices":[{"name":"SNMP","statusID":"4","StatusMsg":"Running","FullStatus":"SNMP,4"}]}

Open in new window



Thank you for your help!!
0
I am trying to change a SP so that the email generated is an array, currently is just one fixed entry, the current syntax works but doesnt work with the API because the email needs to be an array.

Here is the current SP which works fine with a fixed email :
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER OFF
GO


ALTER PROCEDURE [dbo].[api_cc_all_active_contacts] 
AS
    DECLARE @json_result [NVARCHAR](MAX) = '';
    DECLARE @json_resultot [NVARCHAR](MAX) = ''; 

   SELECT   @json_result += CASE WHEN LEN(@json_result) = 0 THEN ''
                                ELSE ', 
'
                           END + '[{"email_addresses":"' + a.Email
                           + '","first_name": "' + ISNULL(a.FirstNm,'')
                           + '","last_name": "' + ISNULL(a.LastNm,'')
                           + '", "custom_fields":[ {"name": "contact_status", "value":"'
                           + CAST(ISNULL(a.Archivedcont,'0') AS varchar(10))
                           + '" },{"name": "country_of_birth", "value":"'
                           + ISNULL(a.PobCountry,'')
                           + '" }, {"name": "nationality", "value":"' + ISNULL(a.Nationality,'')
                           + '" }, {"name": "immigration_status", "value":"'
                          + ISNULL(a.NiStatus,'')
                           + '" }, {"name": "employer", "value":"' + ISNULL(b.MaidenNm,'') + '" } ]}]'
    FROM   dbo.Users a
           LEFT JOIN Users AS b ON b.UserId = a.EmployerId
    

Open in new window

0
I am displaying records from the database like this:

$(document).ready(function(){
			$.ajax({
				url: 'functions/list-articles-delete.php',
				dataType: 'json',
				method: 'POST',
				success: function(data) {
				 $.each(data, function(item){
					var tr_str = "<tr>"
					+ "<td>" + data[item].n_title + "</td>"
					+ "<td>" + data[item].n_dateTime + "</td>"
					+ "<td><button class='btn btn-danger' id='deletebut' data-id='" + data[item].id + "'>Delete</button></td>";
					 $( "#output" ).append(tr_str);
						
					 $( "#deletebut" ).on('click', function(){
						// display id of associated record
				}); 
			});			
		},
	});
});

Open in new window


When I click on any of the buttons I want it to console.log() the id of the associated record but not quite sure how to do this?
0
Get MongoDB database support online, now!
LVL 3
Get MongoDB database support online, now!

At Percona’s web store you can order your MongoDB database support needs in minutes. No hassles, no fuss, just pick and click. Pay online with a credit card. Handle your MongoDB database support now!

I am trying to create a Json object in C# that I will convert to XML.   I have a repeating set of Fees that I need to add to the json object.

Here is my code so far:

root.Deal.Fees = new ExpandoObject();
List<ExpandoObject> feeArray = new List<ExpandoObject>();

foreach (DataRow ro in ds.Tables["fees"].Rows)
{
    root.Deal.Fees.DealFees.Fee.Description = ro["fee_type"].ToString();;
    root.Deal.Fees.DealFees.Fee.Amount = ro["amount"].ToString();

feeArray.Add(root.Deal.Fees);
}

Open in new window


No sure what else is needed.   Supply a different example if that is easier for you.
Thank you
0
I am trying to run json linq query in Visual Studio 2008. I am getting the error :

select is not a member of newtonsoft.json.linq.array

Below is my code

Dim APIURL As String = "https://mydomain/api/v1/enrollments/search?id=12345"
            Dim req As WebRequest = WebRequest.Create(APIURL)
            req.ContentType = "application/json; charset=utf-8"
            req.Credentials = New System.Net.NetworkCredential("xyz", "123")
            req.Method = WebRequestMethods.Http.Get

            Dim text As String = ""
            Dim dt As DataTable = New DataTable
            Dim res As Stream = req.GetResponse().GetResponseStream
            Dim reader As New StreamReader(res)
            Dim response As String = reader.ReadToEnd()

            reader.Close()
            res.Close()

              Dim parsedObject = JObject.Parse(response)

            Dim docs = JArray.FromObject(parsedObject("enrollments")).Select(Function(x) x.ToObject(Of jSonClass.Enrollment)()) 'Error here
EE_json.txt
0
So, I am really trying to get my head around JSON and I have tried this which works but I wanted to know if there is a better way to do it or if this okay. I am actually playing around with developing a hybrid mobile app which uses a php and mysql backend. I have to use ajax to retrieve data and I want to also use JSON.

This is the jQuery/Ajax. The double dollar signs are not a typo, that is the correct syntax for the application but it is identical to jQuery as far as I know.

$$( "#submit" ).click(function(e){
		$$.ajax({
			url:"content.php",
			type:"POST",
			dataType:"json",
			success: function(data) {
				var len = data.length;
				for(var i = 0; i<len; i++) {;
					var user_name = data[i].user_name;
					$$( "#phpcontent" ).append(`
					<li class="item-content">
						<div class="item-inner">
						<div class="item-title">${user_name}</div>
						</div>
					</li>
					`);
				}
			}
		});
	});

Open in new window


This is the php for content.php

$stmt = $link->prepare("SELECT `user_name` FROM `users` ORDER BY `user_name` DESC");
$stmt->execute();
$result = $stmt->get_result();
$numRows = $result->num_rows;
if($numRows > 0) {
	while($row = $result->fetch_assoc()) {
		$user_name = sanitize($row['user_name']);
		
		$return_array[] = array(
		
			"user_name" => $user_name
		
		);
	}
}
$stmt->close();
echo json_encode($return_array);

Open in new window


What I have noticed in all the examples I have looked at is that the database results have to be put into an array in order to use json_encode. Am I correct in saying that or is it just a coincidence that every example I looked at did that?
0
I have a simple html page that uses bootstrap grid.

Each page of the grid I've labelled as a section.

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title></title>

	<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">

  </head>
  <body>

  <div class="container">

  	<div class="row">
  		<div class="col-md-4">Section 1</div>
  		<div class="col-md-4">Section 2</div>
  		<div class="col-md-4">Section 3</div>
  	</div>

  	<div class="row">
  		<div class="col-md-6">Section 4</div>
  		<div class="col-md-6">Section 5</div>
  	</div>

  </div>
 

    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
   	<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
  </body>
</html>

Open in new window


Example data:

{
  "section": "section1",
  "position": "5"
}

Open in new window


What I want to do is to load the different grid parts by reading json data.

So basically, the page loads, reads the json data which contains the positions of the sections and then populates the website.
0
I am using a webclient to send data via JSON to tell the server what I want to have them return to me. However, The API requires I use a GET. But I don't know how to define a GET in the UploadData or even DownloadString methods. How can I issue a GET at the same time I am also sending JSON?

If I pass all the parameters as query string parameters it also fails, so I have to issue the call using JSON data in the body.

thanks!
0
I am using REST API with SharePoint 2013 and I want to know if the following url endpoint is legal or if there is a better way?
 //http://myspsite.com/nrm/_api/web/lists/getbyTitle('My_Project_Modules')/items?$select=DIR,Station,Title,Building_x0020_Number&$filter=Project_x0020_Number eq '402-CSI-001'     //<---  Works when I paste it in the browser
 var projNum = '402-CSI-001';
var endPointUrl = _spPageContextInfo.webAbsoluteUrl + "/_api/web/lists/getbyTitle('My_Project_Modules')/items?$select=DIR,Station,Title,Building_x0020_Number&$filter=Project_x0020_Number eq "+projNum;  //<---  Not valid when I run it in my code

Open in new window


Error I get in my js file
rest api error
js file
function loadSPItems() {
var projNum = '402-CSI-001';
var endPointUrl = _spPageContextInfo.webAbsoluteUrl + "/_api/web/lists/getbyTitle('My_Project_Modules')/items?$select=VISN,Station,Title,Building_x0020_Number&$filter=Project_x0020_Number eq "+projNum;//,ProjectNumber,ApprovalStatus,ProjectExecutionStatus”;
var headers = { 
	"accept": "application/json;odata=verbose" 
}
 
jQuery.ajax({ 
	url: endPointUrl, 
	type: "GET", 
	headers: headers, 
success: function (data) {
	console.dir(data);
}, 
	error: function (err) { 
	alert("Error Occured:" + JSON.stringify(err)); 
}
 
});
 
}

loadSPItems();

Open in new window




Thoughts?
0

JSON

506

Solutions

545

Contributors

JavaScript Object Notation, or JSON, is human-readable text used when transmitting data objects consisting of attribute:value pairs between a server and a web application as an alternative to XML. JSON, while it is originally derived from JavaScript, is a language-independent data format. Code for parsing and generating JSON data is available in many programming languages.

Related Topics