-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to get data with ajax request #20
Comments
I don't have much experience here -- I do all of my Ajax work using the JS wrappers provided by Play, rather than making raw Ajax calls through jQuery. That said, the error you're getting on matching suggests that something is wrong with the match. Are you matching a facade? Are you sure that all of the fields are non-null? This sort of error is extremely common when you are trying to cast a JS object to a facade, and one or more fields are null but the facade doesn't take that into account. |
I've found that if you change the Type from Any to js.Dynamic you can use the data. e.g. if the data object had properties id and name you could use the data like so
You might be right about the match though. The data comming back from the server is missing fields for the None values that are set. However, this is the desired behavior for now so I will use it as I have above. |
Note that, if a field of type |
I'm having trouble getting data with an ajax request.
I have the code
in the console log I get
[object Object]
if I try to match
data
I getI checked the
textStatus
and it returns success. I've also checked the request in the chrome dev tools and it is returning a json string. How do I use that json string after I've recieved it?The text was updated successfully, but these errors were encountered: