Click here to Skip to main content
15,892,298 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi all
I am trying to store data in the solr server but the page is showing error
My Code
HTML
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<script src="Include/JS/JqueryPlugin/jquery-1.8.2.min.js"></script>
<script>
    function save() {
        try {
            $.ajax({
                type: "POST",
                url: "http://192.168.10.113:8080/solr/update/json?commit=true",
                data: { "add": { "doc": { "id": "222222", "name": "Ruby on Trails" } } },
                contentType: "application/json; charset=utf-8",
                dataType: 'jsonp',
                crossDomain: true,
                jsonp: 'json.wrf'
            });
        }
        catch (err) {
            alert(err);
        }
    }
</script>
</head>
<body>
<input type="button" id="button" onclick="save()" value="Submit" />
</body>
</html>

Its showing error like this
Uncaught SyntaxError: Unexpected token
how to over come from this problem. I searched on google and found that syntax error in the html page or in js page .
But in my case there no error.

You can see the error here
please help to solve this error.

Thanks in advance
Posted
Updated 2-Nov-12 0:51am
v2

1 solution

Looks like the xml isn't correct. Have a look at the first line, the two characters after "UTF-8". It doesn't look right (cannot see exactly what it is though because the resolution is quite low)

Good luck!
 
Share this answer
 
Comments
Mac12334 5-Nov-12 5:49am    
which xml is not correct??

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900