Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Jan 03, 2013 06:28 PM by justin.beckwith
Dec 19, 2012 01:10 PM|LINK
I'm a begineer and maybe this is a simple question for most of you but in web matrix 2 I can't get to see the HTML methods in the intellisense.
If, inside of <script> tag I write:
I get lots of methods and properties but not innerHTML and other common HTML element's methods and properties.
How can you explain that?
Thanks a lot in advance
Dec 19, 2012 03:13 PM|LINK
Dec 19, 2012 03:54 PM|LINK
thanks for your answer.
Intellisense has to be essentially programmed to know what properties and functions are associated
Or is Microsoft that can only do that?
Thanks a lot again
Dec 19, 2012 04:33 PM|LINK
Keep in mind that Intellisense is a tool. Don't depend on it for everything. If you already know the features you're looking, just type it in.
Dec 20, 2012 07:39 AM|LINK
Thanks a lot for your very clear answer.
Jan 03, 2013 06:28 PM|LINK
Greetings! As Careed mentioned, we're only exposing properties of the node and element objects in the W3C DOM:
We don't do any sort of manage to detect what type of element you've selected with getElementById, so we really don't have a way to know for sure that it's an HTML element that supports the property. This is consistent with how Visual Studio 2010 behaves.
That having been said, this behavior has been changed in Visual Studio 2012. We moved from a strict W3C DOM list to one that includes common properties and methods, one of which includes innerHTML.
Changing this in WebMatrix wouldn't be easy, though it's something we could consider if there's enough people asking for a change:
As mentioned, using jQuery would certaintly make this kind of thing easier :) Hopefully this helps answer your question!