Mixaalser684 Posted February 16, 2013 Share Posted February 16, 2013 (edited) Currently I'm learning Ajax with Java.The innerHTML method works when I'm retrieving simple string data from the servlet, and when I need to update only one HTML element.Since I have the need to update more HTML elements it occurred to me that I can use JSON object with several properties (HTML tag data for each element needed updating).After trying that I've noticed that innerHTML method doesn't work, when I try to process the retrieved data in the Callback function.My question is, why is this happening?Did someone had a similar problem when using JSON with Javascript.Just for the record, when I use innerText method I successfully update the HTML elements with JSON properties data, only they update as text and that's what I don't need. (See the video) Thank You. Edited February 16, 2013 by Codenoobalser Link to comment Share on other sites More sharing options...
dsonesuk Posted February 16, 2013 Share Posted February 16, 2013 Should be innerHTML, you are using innerHtml in your example 1 Link to comment Share on other sites More sharing options...
Mixaalser684 Posted February 16, 2013 Author Share Posted February 16, 2013 (edited) Should be innerHTML, you are using innerHtml in your example Geeze, talking about case-sensitivity. This raises another question, how do I enable syntax checking for Javascript, in NetBeans IDE, to avoid stupid mistakes like this one in the future? Thanks a million. :)Cheers! Edited February 16, 2013 by Codenoobalser Link to comment Share on other sites More sharing options...
justsomeguy Posted February 18, 2013 Share Posted February 18, 2013 A syntax check wouldn't find that, you can change a property called "innerHtml" if you want to change it, but it's not going to update the HTML content of an element. There's nothing syntactically wrong with using it though, it's not a syntax error. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now