Hi, Christian, thanks for your response.
That was just an example of where i'm using quoted strings. Actually i
receive JSON object via jQuery.getJSON() from PHP-script. It contains
list of names and descriptions as strings. Both can contain single or
double quotes.
$.getJSON(scriptURL+'?t=q&q='+escape(q), function(data){
var nodes_arr = new Array();
var edges_arr = new Array();
for (var i=0;i<data.length;i++)
{
nodes_arr[nodes_arr.length] = {id: data[i].name,
label: data[i].name,
abstract: data[i].abstract,
};
}
drawNodes(nodes_arr);
})
Here is a JSON-string from PHP-script:
[{"name":"some name","abstract":"some text"},{"name":"some other
name","abstract":"some \"quoted\" text"}]
And here is how i draw nodes:
function drawNodes(n_arr)
{
var net = {
dataSchema: {
nodes: [
{name: "label", type: "string" },
{name: "abstract", type: "string" },
]
},
data:{
nodes:n_arr,
}
};
vis.draw({network: net});
vis.ready(function() {
vis.addListener("click", "nodes", function(event)
{
alert(event.target);
}
});
}
I even tried data[i].abstract.split('\"').join('"'), didn't help.
This bug appears in every browser i tried: Chrome 18.0; Firefox 11.0,
Opera 11.61, IE 8.0