I'm getting text from an API and it's something like following:
text = 'replied to @james and he was visiting this http://some-site.com/another/something/../ so what you think about it';
How can I parse this text and make links as html links and @james as html links also, but with their own href values.
Does anyone know any function ...
I want to use Perl script that gets the JSON data and converts it into XML file. How can I do that in Perl?
...
Hello everybody,
why does the JSON.stringify-Function converts a string.Empty ("") to a "null"-String?
The problem, why i'm not using:
JSON.parse(json, function(key, value) {
if (typeof value === 'string') {
if (value == 'null')
return '';
return value;
}
});
...is, if somebody really write "null" (is very unlikely, ...
I am using asp.net mvc to list the events in the jquery full calendar. Below is the script i am using to list the events through json from mvc.
$('#calendar').fullCalendar({
theme: true,
editable: true,
disableDragging: true,
disableResizing: true,
header: {
left: 'prev,next today',
center: 'title',
right: 'month,bas...
I'm sure there's a simple answer to this, but it's Friday afternoon and I'm tired. :(
Not sure how to explain it, so I'll just go ahead and post example code...
Here is a simple object:
var Bob =
{ Stuff : ''
, init : function()
{
this.Stuff = arguments[0]
}
, doSomething : function()
{
console.log( this.Stuff );
}
}
An...
Using jquery, I'm able to send json objects from client to server using ajax like this:
var strJSON = '{"event":[{
"dates":[
"2009-10-14","2009-10-15"],
"teams":[
{"id":"0","country":"USA","state":"CA","name":"California Polytechnic State University","subteam":""},
{"id":"1","country":"USA","state":"CA","n...
I am POSTing data to an MVC controller and I'm attempting to maintain state as well for optimistic concurrency. I'm currently posting back a JSON request, but would be open to workable alternatives?
I am already posting a name/value collection with the following command:
$.ajax({
url: g_appPath + "/Rounding.aspx/Round/" + $("#Offe...
I keep getting the following error when I try to invoke the Facebook REST API Call:
Connect.registerUsers
Error Code: 100 - param accounts must be an array
JSON based response (from Facebook):
{"error_code":100,"error_msg":"param accounts must be an array.","request_args":
[{"key":"accounts","value":"{email_hash:5232156322_55ddgvc3d...
as the following code, my question is:
in testFunction, how can i call function remove?
in remove how can i call testFunction?
in remove, how can i call add?
great thanks
var stringhelper={
testFunction:function(){},
//deal with text such as:
//"alignleft red bold header2"
classValue:{
//test whether classValue has className in it
...
I am writing code that needs to extract an object literal posted to a servlet. I have studied the API for the HttpServletRequest object, but it is not clear to me how to get the JSON object out of the request since it is not posted from a form element on a web page.
Any insight is appreciated.
Thanks.
...
I'm using a JSON example off the web, as seen below.
{
"menu": "File",
"commands": [
{
"title": "New",
"action":"CreateDoc"
},
{
"title": "Open",
"action": "OpenDoc"
},
{
"title": "Close",
"action": "CloseDoc"
}
]
}
I've tried...
I have data in a MYSQL DB that looks like this:
id,parentid,name,count
1,0,top,10
2,1,middle1,5
3,1,middle2,5
4,3,bottom1,3
5,3,bottom2,2
and want to output it via PHP as a heirarchical JSON string where 'top' has a collection of 'middle's etc.
Get my drift? Anyone have a recursive PHP function to help?
...
Hi,
Here's something I want to learn and do. I have a JSON file that contains my product and details (size, color, description). In the website I can't use PHP and MySQL, I can only use Javascript and HTML. Now what I want to happen is using JQuery I can read and write a JSON file (JSON file will serve as my database). I am not sure if ...
I have a JSON file contact.txt that has been parsed into an object called JSONObj that is structured like this:
[
{
"firstName": "John",
"lastName": "Smith",
"address": {
"streetAddress": "21 2nd Street",
"city": "New York",
"state": "NY",
"postalCode": "10021"
},
"phoneNumbers": [
{ "type": "home", "...
I can't get this update script to work in IE. Works fine in every other browser. IE tells me that the update was performed. However, it wasn't. I've no more hair left to pull out..grr. BTW I've tried $.ajax and $.get too..still no luck. I'm thinking it may have something to do with the live click handler. Don't know...I've tried eve...
i want to display image after it upload
i write following code but it did't work
onFileSuccess: function(file, response) {
var json = new Hash(JSON.decode(response, true) || {});
if (json.get('status') == '1') {
file.element.addClass('file-success');
} else {
file.element.addClass('file-failed');
}
})
and li is
...
I'm using JQuery's getJSON method to retrieve some data from an MVC controller.
[AcceptVerbs(HttpVerbs.Get)]
public ActionResult GetContacts(int? numberOf)
{
List<Contact> contacts =
(numberOf != null && numberOf > 0) ?
_provider.GetContacts(Convert.ToInt32(numberOf)):
_pro...
I get a json date from a webservice that i need to parse manualy and the date looks like this:
"Fri, 06 Nov 2009 00:00:00 -0800"
How would i parse this into a datetime object?
I guess i should use DateTime.ParseExact but what do i feed into it.
...
As the question goes , how do i go about serializing a subsonic class to JSON. While i can manually create the JSON object i need some way to do it automatically.
Any recommendations would be awesome as i don't really want to do this manually.
Could you also please recommend a could Library to help with the JSON serialization.
BTW i am...
I wanted to know if JSON is still used in live applications? I am creating a service and want to understand if I should output data using JSON too?
What is the latest standard now?
...