tags:

views:

59

answers:

1

This is a JSON I'm writing and use it with JQuery.

bookData.webSites = [
    {
        id: 1,
        title: "ΤΟΥΡΙΣΤΙΚΗ ΑΝΑΠΤΥΞΗ",
        image: 'images/books/min.png',
        site: 'http://delicious.com/',
        author: "",
        pages: '',
        isbn: '',
        price: '',
        type: 'book'
    }];

It works perfect until I'm trying to use a long Greek text with it, then It goes really wrong. I had some problems with the author tag but it all went well when I used "" instead of ''. In a long Greek text we use " and ' while writing and I apparently want to use greek for the description. Any way for that to became posible.

Thanks beforehand for everyones help from this AWESOME community!

+3  A: 

Try placing an escape character ('\') before each instance of " or '.

JavaScript JSON libraries should handle this for you. Example - http://www.json.org/js.html: see JSON.stringify.

MarkPowell
Kevin_Jim