URENTGLY:why is there sytnax error

hi anyone know why there is syntax error to this?
if i write this can i get a attribute frm the json file?
is it because how i put the json data in html wrongly?

var xmlhttp;
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5

xmlhttp=new ActiveXObject(“Microsoft.XMLHTTP”);
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{

var addrField = document.getElementById("myDiv");
var card = eval('('+xmlhttp.responseText+')'); // they say the error is here
addrField.value = card.places.place.name.value;
}

}

xmlhttp.open(“GET”,“HTMLPage3.htm”,true);
xmlhttp.send();

this is my json file in html

{"books:{
`“book”:[

    {
    "title":"JavaScript, the Definitive Guide",
    "publisher":"O'Reilly",
    "author":"David Flanagan",
    "cover":"/images/cover_defguide.jpg",
    "blurb":"Lorem ipsum dolor sit amet, consectetuer adipiscing elit."
        },


    {
    "title":"DOM Scripting",
    "publisher":"Friends of Ed",
    "author":"Jeremy Keith",
    "cover":"/images/cover_domscripting.jpg",
    "blurb":"Praesent et diam a ligula facilisis venenatis."
        },

    {
    "title":"DHTML Utopia: Modern Web Design using JavaScript & DOM",
    "publisher":"Sitepoint",
    "author":"Stuart Langridge",
    "cover":"/images/cover_utopia.jpg",
    "blurb":"Lorem ipsum dolor sit amet, consectetuer adipiscing elit."

}
]
}

}

i check le…yes i miss out one semicolon but still it still give me sytnax error
is it because i didn’t put correctly the json in the html

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=“http://www.w3.org/1999/xhtml” >
<head>
<title>Untitled Page</title>
</head>
<body>
{
places:
{
place:
{
id: “1”,
name: “club”,
x_coordinate: “35484.66533355533”,
y_coordinate: “31293.823929446196”
}
{
id: “2”,
“name”: “Police Station”,
x_coordinate: “35951.524906914485”,
y_coordinate: “31862.739419191174”
}

}
}

</body>
</html>

Yes it is. The html file is intended to be interpreted by a web browser. It’s not valid for an html file to be interpreted as json data.

u mean that i cant use this html url to be retrieve data in xmlhttp.open(“GET”,“HTMLPage3.htm”,true);
what i mean was HTMLPage3.htm store the json data in the html and i got to use this url to work with the ajax
it jus retrieve the name and coordinates

Let me try to explain this using different words, so that they might be understood.

The entire contents of the html file will be returned as data to the request. If you want the data to be interpreted as json data, the entire contents of the file must be json data.

Paste the JavaScript code in the online lint, and you will be shown the problem.

so is json file then can retrieve?
okay then why my supervisor say create a dummy html page with the json format data…what she mean that

You may have to ask for further clarification from your supervisor on that.

okay if i use the json file right …then it shld be able to get the name and coordinate but how to write in ajax ?then i will like to ask is my format of json declare wrongly?

Yes it is. The correct format is shown in diagrams over at the JSON web site.

arh …i am sorry i don’t really get the diagram…can help me see

{
places:
{
place:
{
id: “1”,
name: “club”,
x_coordinate: “35484.66533355533”,
y_coordinate: “31293.823929446196”
}
{
id: “2”,
“name”: “Police Station”,
x_coordinate: “35951.524906914485”,
y_coordinate: “31862.739419191174”
}

}
}

You have two different places there.
Shouldn’t each place be separated by a comma, and shouldn’t yoiu use an array to contain multiple items, such as those places?

oh that one is okay already but can i ask you using ajax right how am i goin to put the data retrieve from the json data into the programmatic dojo border container…i try out but it don’t work
this is one code…i not sure why it don’t work in the border container…the htmlpage4 is json data inside

function getInfoContent(graphic) {

function ajaxRequests() {
        var activexmodes = ["Msxml2.XMLHTTP", "Microsoft.XMLHTTP"] //activeX versions to check for in IE
        if (window.ActiveXObject) { //Test for support for ActiveXObject in IE first (as XMLHttpRequest in IE7 is broken)
            for (var i = 0; i &lt; activexmodes.length; i++) {
                try {
                    return new ActiveXObject(activexmodes[i])
                }
                catch (e) {
                    //suppress error
                }
            }
        }
        else if (window.XMLHttpRequest) // if Mozilla, Safari etc
            return new XMLHttpRequest()
        else
            return false
    }

    var mygetrequests = new ajaxRequests()
    mygetrequests.onreadystatechange = function() {
        if (mygetrequests.readyState == 4) {
            if (mygetrequests.status == 200 || window.location.href.indexOf("http") == -1) {
                var bookss = eval("(" + mygetrequests.responseText + ")") //retrieve result as an JavaScript object
                var rssent = bookss.infos.info
                for (var i = 0; i &lt; rssent.length; i++) {
                
                    // alert(mygetrequests.responseText);
                    var placeImg = ""
                    var txt = ""
                   // placeImg += rssent[i].descImg
                    txt += rssent[i].desc
                    var shorttxt = ""
                    shorttxt += txt.substring(0, 30);
                    var bc = new dijit.layout.BorderContainer({ style: "font-size: 11pt; height: 574px; width:739px; border:0px;" });
                    var c1 = new dijit.layout.ContentPane({

                        region: "top",
                        style: "height: 11.5%; width: 100%; color: black; background-color: transparent; border:0px;",
                        content: "&lt;table&gt;&lt;div id = \\"mydiv\\"&gt;" + shorttxt + "&lt;font color = '#0000FF' size = '1'&gt;&lt;a onclick='showmore();'&gt;&lt;u&gt;  More...&lt;/u&gt;&lt;/a&gt;&lt;/div&gt;&lt;/td&gt;&lt;/table&gt;"
                    });
                    bc.addChild(c1);
                    
                



                }

            }

            else {
                alert("An error has occured making the request")
            }
           
        }
        return bc.domNode;
    }

    mygetrequests.open("GET", "HTMLPage4.htm", true)
    mygetrequests.send(null)
}

What on earth is a programmatic dojo border container?

this kind var bc = new dijit.layout.BorderContainer({ style: “font-size: 11pt; height: 574px; width:739px; border:0px;” });
instead of the div …
so why it the border container cannot work but if i alert each of the retrieve it call the data but the border container cannot work …please help me!!!

First of all, fix up the most important problems with your code.
Paste the javascript in to the online lint and fix the problems that it finds there.

i use the same ajax way to retrieve data and pin on the point it way …it just that the border container don’t work

so i not how to make it work can help me please!!!

so how is it ? do you know how to work with the border container?

Once the most significant problems with the code are sorted out, we can then focus on the issue at hand without being distracted by other problems.
Things like automatic semicolon insertion is known to cause unexpected problems with your code, so don’t rely on it.

so ?? i put the semi colon in liao le …also can not work…cause i return the bc.domNode …but it say domNode null …is it i put at the wrong area or what why the ajax can retrieve data but can’t put inside the border container…please help me solve it…