I'm just starting with SharePoint 2013 dev. I've created a VM on my computer, it's running Windows Server 2013 and SharePoint 2013 Foundation.
I'm trying to create a App with a App part in it. On VS 2012 I've created a new project based on the template "App for SharePoint 2013". I'm choosing to host it as Sharepoint-Hosted.
When i deploy this basic App, everything runs normally. I go back to Visual Studio and add a Client Web Part to my project, i don't change anything in it's code and deploy it.
When i add this App Part to any page i've created, my Visual Studio returns a exception saying:
0x800a1391 - JavaScript runtime error: 'Type' is undefined in the sp.runtime.js
I've done a little search about this subject and came across this post Link
One of the comments says:
"This error is usually fixed by adding the reference to MicrosoftAjax:
<script type="text/javascript" src="/ajax.aspnetcdn.com/ajax/4.0/1/MicrosoftAjax.js"</script>"
I tried that, replaced the default code of the web part:
<script type="text/javascript" src="/_layouts/15/MicrosoftAjax.js"></script>
for the code he mentioned
<script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/4.0/1/MicrosoftAjax.js"></script>
The web part won't give me an error anymore, but i'm thinking wasn't it supposed to work with the default MicrosoftAjax that's in the /_layouts/ folder? What if the server i'm going to deploy my app for some reason can't access the URL to get the .js file?
Anyone else had this error and knows how it's fixed?