Search Results

Search found 5856 results on 235 pages for 'json encode'.

Page 61/235 | < Previous Page | 57 58 59 60 61 62 63 64 65 66 67 68  | Next Page >

  • Remove accents from a JSON response.

    - by Pentium10
    I get back a JSON response from a social networks site. There are certain accented characters that I would like to be removed. An example is : L\u00e1szl\u00f3 M\u00e1rton, that reads "László Márton" and I would like to be transformed into Laszlo Marton. I would like to keep the JSON format intact, as I will send it towards. How can I do this?

    Read the article

  • how to build a 3statetree in flex

    - by david Lnn
    hi all I want build a 3statetree with checkbox,I had got the resource from cookbook,but I don't know how to use it with json, and how can i click one node then send the request to server and expand the subnode after receive the json data from server. thank you,thank you.

    Read the article

  • How to cache render :json

    - by ash34
    Hi, I have a controller index action which returns json output. render :json => my_array.to_json What type of caching do I have to use here. Does 'page caching' make sense for this. Or do I have to do action caching like below caches_action :index thanks, ash

    Read the article

  • resttemplate getForObject map responsetype

    - by Zack Macomber
    I'm invoking a rest service that returns JSON like this: { "some.key" : "some value", "another.key" : "another value" } I would like to think that I can invoke this service with a java.util.Map as the response type but that's not working for me. I get this exception: org.springframework.web.client.RestClientException: Could not extract response: no suitable HttpMessageConverter found for response type [interface java.util.Map] Should I just specify String as the response type and convert the JSON to a Map?

    Read the article

  • Python 3.1 twitter post with installed library,

    - by Andrew
    I'd like to be able to post twitter messages from python 3.0. None of the twitter API I have looked at support python 3.1. Since the post proceedure only requires this : JSON: curl -u username:password -d status="your message here" http://api.twitter.com/1/statuses/update.json I was wondering if it is possible with the standard libraries to format this so a message could be sent. My head says it should be possible.

    Read the article

  • Save HashMap data into SQLite

    - by Matthew
    I'm Trying to save data from Json into SQLite. For now I keep the data from Json into HashMap. I already search it, and there's said use the ContentValues. But I still don't get it how to use it. I try looking at this question save data to SQLite from json object using Hashmap in Android, but it doesn't help a lot. Is there any option that I can use to save the data from HashMap into SQLite? Here's My code. MainHellobali.java // Hashmap for ListView ArrayList<HashMap<String, String>> all_itemList; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main_helloballi); all_itemList = new ArrayList<HashMap<String, String>>(); // Calling async task to get json new getAllItem().execute(); } private class getAllItem extends AsyncTask<Void, Void, Void> { @Override protected Void doInBackground(Void... arg0) { // Creating service handler class instance ServiceHandler sh = new ServiceHandler(); // Making a request to url and getting response String jsonStr = sh.makeServiceCall(url, ServiceHandler.GET); Log.d("Response: ", "> " + jsonStr); if (jsonStr != null) { try { all_item = new JSONArray(jsonStr); // looping through All Contacts for (int i = 0; i < all_item.length(); i++) { JSONObject c = all_item.getJSONObject(i); String item_id = c.getString(TAG_ITEM_ID); String category_name = c.getString(TAG_CATEGORY_NAME); String item_name = c.getString(TAG_ITEM_NAME); // tmp hashmap for single contact HashMap<String, String> allItem = new HashMap<String, String>(); // adding each child node to HashMap key => value allItem.put(TAG_ITEM_ID, item_id); allItem.put(TAG_CATEGORY_NAME, category_name); allItem.put(TAG_ITEM_NAME, item_name); // adding contact to contact list all_itemList.add(allItem); } } catch (JSONException e) { e.printStackTrace(); } } else { Log.e("ServiceHandler", "Couldn't get any data from the url"); } return null; } } I have DatabasehHandler.java and AllItem.java too. I can put it in here if its necessary. Thanks before ** Add Edited Code ** // looping through All Contacts for (int i = 0; i < all_item.length(); i++) { JSONObject c = all_item.getJSONObject(i); String item_id = c.getString(TAG_ITEM_ID); String category_name = c.getString(TAG_CATEGORY_NAME); String item_name = c.getString(TAG_ITEM_NAME); DatabaseHandler databaseHandler = new DatabaseHandler(this); //error here "The Constructor DatabaseHandler(MainHellobali.getAllItem) is undefined }

    Read the article

  • Cannot get xmlhttprequest.responseText from JQuery

    - by Felix Guerrero
    Hi. I got this function function verify_at_bd(){ var u = "foo"; var p = "bar"; return $.post('auth.php', { name: u, password: p, mobile: '' }, function(result){ return result; },'json'); } If I do a console.log(verify_at_bd()) I'm getting an xmlhttprequest but cannot access to responseText property. I'm using header("Content-Type: application/json") into my PHP. I'm using firefox 3.6 on OS X.

    Read the article

  • jQuery Mobile - how to force that page recreation - pagebeforecreate event

    - by NewUser
    I have a small jQuery mobile site. it's all single .html file it's has some edit functionality (view, edit, save) all works with ajax/json/web service Most of my pages are using data from web service, via AJAX & JSON, so I am using the following a lot: $(document).on( 'pagebeforecreate', '#monday', function() { // do some stuff on before create, load data with AJAX }); Now, how do I FORCE that page recreation (pagebeforecreate event) so the AJAX inside is run again (get the latest data from server)?

    Read the article

  • See anything wrong with this JSON2 push/stringify?

    - by nobosh
    dynamictextareas.push({guideid:targeteditorID, guideitemtext : textareacontents }); alert( JSON.stringify(dynamictextareas) ); See anything wrong with this JSON2 javascript code? For some reason this come is making a mess of things. I want to push: <p>DDDDDD</p> But instead it's pushing: [{"guideid":"1","guideitemtext":"<p>\u000a\u0009u000au0009DDDDDD</p>\u000a"}] Any ideas? Is there a better way I can build this JSON object?

    Read the article

  • How can I create a Searchstring for a Google AJAX Search API?

    - by elmaso
    Hello, i have this code to get the search resutls from the api: querygoogle.php: <?php session_start(); // Here's the Google AJAX Search API url for curl. It uses Google Search's site:www.yourdomain.com syntax to search in a specific site. I used $_SERVER['HTTP_HOST'] to find my domain automatically. Change $_POST['searchquery'] to your posted search query $url = 'http://ajax.googleapis.com/ajax/services/search/web?rsz=large&v=1.0&start=20&q=' . urlencode('' . $_POST['searchquery']); // use fopen and fread to pull Google's search results $handle = fopen($url, 'rb'); $body = ''; while (!feof($handle)) { $body .= fread($handle, 8192); } fclose($handle); // now $body is the JSON encoded results. We need to decode them. $json = json_decode($body); // now $json is an object of Google's search results and we need to iterate through it. foreach($json->responseData->results as $searchresult) { if($searchresult->GsearchResultClass == 'GwebSearch') { $formattedresults .= ' <div class="searchresult"> <h3><a href="' . $searchresult->unescapedUrl . '">' . $searchresult->titleNoFormatting . '</a></h3> <p class="resultdesc">' . $searchresult->content . '</p> <p class="resulturl">' . $searchresult->visibleUrl . '</p> </div>'; } } $_SESSION['googleresults'] = $formattedresults; header('Location: ' . $_SERVER['HTTP_REFERER']); exit; ?> search.php <?php session_start(); ?> <form method="post" action="querygoogle.php"> <label for="searchquery"><span class="caption">Search this site</span> <input type="text" size="20" maxlength="255" title="Enter your keywords and click the search button" name="searchquery" /></label> <input type="submit" value="Search" /> </form> <?php if(!empty($_SESSION['googleresults'])) { echo $_SESSION['googleresults']; unset($_SESSION['googleresults']); } ?> but with this code, I cant add a searchstring.. how can i add a search string like search.php?search=keyword ? thanks

    Read the article

  • JQuery AJAX responseText to JSON

    - by BoredOfBinary
    I have this script that calls a .net WebService msg = $.toJSON( $.ajax({ type: "POST", url: "http://[url]/ETS.UI/WebServices/LocationService.asmx/GetMappingLocationDetails", contentType: "application/json; charset=utf-8", data: $.toJSON({'componentId':994}), dataType: "json", async: false }).responseText ); And I recieve the following value in the msg variable: ""{\"d\":\"{\\"ComponentId\\":994,\\"Latitude\\":32.219627009236405,\\"Longitude\\":-110.96843719482422,\\"LocationName\\":\\"Tucson\\",\\"StreetAddress\\":\\"7201 E 22nd Street \\",\\"City\\":\\"Tucson\\",\\"State\\":\\"AZ\\",\\"PostalCode\\":null}\"}"" I have no idea why this would format this way, seems to only do this in responseText. Does anyone have any ideas?

    Read the article

  • Post request to include 'Content-Type' and JSON

    - by Sangram Singh
    I'm to work with goo.gl for URL shortening. I need to make the following request: POST https://www.googleapis.com/urlshortener/v1/url Content-Type: application/json {"longUrl": "http://www.google.com/"} my html:- <form method="post" action="https://www.googleapis.com/urlshortener/v1/"> <button type="submit"> submit </button> </form> how do i add the 'content-type' and json here?

    Read the article

  • Zend framework Json engine?

    - by simple
    Is there some kind a engine for Json in the Zend framework, What I mean is some abstraction that all the Json (ajax) responces go through ? in other words some class to controll all the Ajax calls?

    Read the article

  • Save JSON outputed from a URL to a file

    - by Aidan
    Hey Guys, How would I save JSON outputed by an URL to a file? e.g from the Twitter search API (this http://search.twitter.com/search.json?q=hi) Language isn't important. Thanks! edit // How would I then append further updates to EOF?

    Read the article

  • Endless scroll paging in jquery Safari

    - by socheata
    I'm using : $(window).scroll(function () { if ($(window).scrollTop() + 10 >= ($(document).height() - $(window).height())) { loadContent(); } } It works fine with Chrome, IE, Firefox but except in Safari. In function loadContent, I used JSON to load data, as this tutorial. But while I test in Safari, It takes the content twice from JSON. If the other takes 9 items, then Safari takes 18 items. Does anyone know how to solve this problem? Thanks.

    Read the article

< Previous Page | 57 58 59 60 61 62 63 64 65 66 67 68  | Next Page >