Tag: json

How to extract JSON from URL?

I’m looking to extract JSON data from a server URL that looks something like this: https://dev.randomdomain.com/subdomain The URL itself outputs the data like such: [ { “name”: “Not configured”, “mac_address”: “####c##c####”, “online”: “false”, “rate”: “Not configured”}, { “name”: “Not configured”, “mac_address”: “####c##c####”, “online”: “false”, “rate”: “Not configured”}, ] The outputed data changes and will need […]

Google charts: Slow in IE 8 and 9, but fine in Mozilla

Can anyone spot what might be slowing IE down to a crawl in the following JS / JQUERY / JSON. It isn’t slow until a large JSON dataset is added to it, but Mozilla based broswers are fine in like for like conditions. There are no script runtime errors. I have eliminated bad HTML as […]

Custom JSON.stringify fails to Stringify object as whole, but works when iterated one level deep

Hoping someone can spot the error, because I’m having trouble Alright, I built my own JSON.stringify for just custom large objects. It may not be exactly to specification for some edge case things, but’s only meant for stringify on large objects that I’m building myself. Well, it works, and works well for most objects, but […]

Are there any guidelines to structuring a JSON message?

Are there any guidelines specific to design JSON objects so that I can exchange information between server and browser? Usecases like setting up a cookie in browser containing actual data with hash values. Any JSON exchanged between browser and server use these hashes to generate proper data using those stored hashes? -Lalith

Load all background-images at once with JS or CSS?

So right now I have a list with a bunch of Facilities. Each of these facilities has an image property which is simply just the name of it’s image file. For example, facility.image == ‘YogisBarAndGrill’. On pageload, I sent an array of strings (image names) via JSON and try to load all the images before […]

Create object from remote JSON

Have posted before but I think I was a little too specific to gain much interest Original. I am new to javascript and AJAX and have found it difficult to find a simple answer to this question. My goal is to simply parse some remote JSON, giving me an object which I can then use […]

json ajax problem

I am sorry to ask this but i’ve been working on this for hours and I can’t figure it out on my own. I have to use json for part of a project and I was able to get it to work but now it’s not returning it back to the right jsp but instead […]

HTML-escaping the data returned from ajax/json

I’m using ajax to retrieve some data from the backend. I get the result as json. I then use jquery to add it to the page: $(…).append(‘<H3>’ + data.title + ‘</H3>’) And I just realized that the json data is not HTML escaped, which is bad. What should I do? HTML escape all the data […]

jQuery evangelists!

I’m absolutely digging what I’ve been able to do in jQuery. From my perspective there isn’t a lot jQuery can’t do. I’m working on a new project and my plan is to use jQuery heavily with JSON,Ajax and Webservices inside of a ASP.net project. Before I go spouting my opinion about how great jQuery is, […]

How to change the JSON output format and how to support chinese character?

Currently I using the following code to get my JSON output from MySQL. <?php $session = mysql_connect(‘localhost’,’name’,’pass’); mysql_select_db(‘dbname’, $session); $result= mysql_query(‘SELECT message FROM posts’, $session); $somethings = array(); while ($row = mysql_fetch_assoc($result)) { $somethings[] = $row; } ?> <script type=”text/javascript”> var somethings= <?php echo json_encode($somethings); ?>; </script> And the output is: <script type=”text/javascript”> var somethings= […]