Try this in your browser (no server required , no PHP, HTML and JavaScript only)
<!DOCTYPE HTML>
<html lang="en">
<head>
<title>API test</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<style type="text/css">
</style>
<script type="text/javascript">
// this would be returned using XHR
var realestateview_json = {
"Pagination" : [
{
"PageURL" : "",
"PageNumber" : "1"
}
],
"Listings" : [
{
"CityStateText" : "New South Wales",
"SaleLeaseAlertPriceText" : "Expressions of Interest",
"ListingResultsCount" : "1",
"ContactAgentOfficePhone" : [
"9727 8822",
"02 9727 6077"
],
"CarportsCount" : "3",
"SaleLeaseAlertText" : "For Sale",
"AgentsGroupNameSuburbLink" : "http://www.realestateview.com.au/agents/raine+and+horne+r+and+h+cabramatta",
"AuctionTime" : "12:00AM",
"StreetType" : "St",
"AvailableOnlyFlag" : "1",
"LandSize" : "916.00",
"TotalParkingCount" : "6",
"PropertyTypeText" : "House",
"ContactAgentMobilePhone" : [
"0414 982 978"
],
"ClientAddress" : "5 Arthur St",
"SaleLeaseTypeText" : "for Sale",
"GroupID" : "123",
"ClientSuburb" : "CABRAMATTA",
"PropertyType" : [
"House"
],
"PriceText" : "Expressions of Interest",
"ClientID" : "7373",
"ForSale" : "1",
"BedroomsCount" : "9",
"PortalSection" : "buy",
"FullDisplayLink" : "http://www.realestateview.com.au/Real-Estate/cabramatta/Property-Details-buy-residential-3328445.html",
"PhotosCount" : "10",
"GroupFontColor" : "000000",
"PortalView" : "residential",
"ClientState" : "NSW",
"SaleLeaseText" : "Expressions of Interest",
"OrderID" : "3328445",
"Title" : "Rare Investment Opportunity!",
"IsResidential" : "1",
"GeocodeStatus" : "1",
"Suburb" : "CABRAMATTA",
"ContactAgentName" : [
"Raine Horne Cabramatta",
"Peter Ly"
],
"GroupFont" : "arial",
"ClientLogoResultsURL" : "http://www.realestateview.com.au/logos/results/Raine-and-Horne-2.gif",
"CityState" : "NSW",
"ClientPostCode" : "2166",
"PhotoFloorPlanUpdate" : "2011-11-23 18:28:08",
"BathroomsCount" : "3",
"ViewFullDisplayAltTag" : "View full details for Cabramatta NSW 2166",
"ClientLogoAltText" : "R&H - Cabramatta",
"ContactAgentEmail" : [
"cabramatta@rh.com.au",
"peter.ly@rh.com.au"
],
"ClientName" : "R&H Cabramatta",
"HostName" : "www.realestateview.com.au",
"LandSizeText" : "916",
"LockUpGaragesCount" : "3",
"FirstPropertyTypeOnly" : "House",
"GroupBackgroundColor" : "FFCC00",
"PostCode" : "2166",
"PhotoThumbURL" : [
"http://images.revlocal.com.au/pics/445/Cabramatta-NSW-2166-Property-photo-10-3328445.jpg",
"http://images.revlocal.com.au/pics/445/Cabramatta-NSW-2166-Property-3328445.jpg",
"http://images.revlocal.com.au/pics/445/Cabramatta-NSW-2166-Property-photo-2-3328445.jpg",
"http://images.revlocal.com.au/pics/445/Cabramatta-NSW-2166-Property-photo-3-3328445.jpg",
"http://images.revlocal.com.au/pics/445/Cabramatta-NSW-2166-Property-photo-4-3328445.jpg",
"http://images.revlocal.com.au/pics/445/Cabramatta-NSW-2166-Property-photo-5-3328445.jpg",
"http://images.revlocal.com.au/pics/445/Cabramatta-NSW-2166-Property-photo-6-3328445.jpg",
"http://images.revlocal.com.au/pics/445/Cabramatta-NSW-2166-Property-photo-7-3328445.jpg",
"http://images.revlocal.com.au/pics/445/Cabramatta-NSW-2166-Property-photo-8-3328445.jpg",
"http://images.revlocal.com.au/pics/445/Cabramatta-NSW-2166-Property-photo-9-3328445.jpg"
],
"StreetNumber" : "2A",
"StreetName" : "Levuka",
"Description" : "3 units in one dwelling. All have separate entries and:\n*3 bedrooms, separate lounge and dining\n*Kitchen and bathroom\n*Single lock-up garage + car space\n\n*Ideal for investment/to live and collect income\n*Walk to Cabramatta school, station and shops\n*Current gross income of $46,000 p.a.\n*Ideal for 3 families"
}
],
"Search" : 1,
"ResponseStatus" : "OK",
"TotalMatching" : "1",
"SearchNumber" : "190232266"
};
var city_state = realestateview_json.Listings[0].CityStateText;
</script>
</head>
<body>
<h1>API test</h1>
<div id="test_div"></div>
<script type="text/javascript">
// now that the DOM is loaded
var display_div = document.getElementById("test_div");
display_div.textContent = city_state;
</script>
</body>
</html>