Right I am creating a method which adds an Account to Dynamics CRM with an Ajax POST to a built in webservice, the code is as follows :
var context = GetGlobalC
Make sure all other depending JavaScipt libraries are loaded before this javascipt and you have to maintain the depending javascript precedence. Since you are using Json and JQuery libraries you have to load those libaries first. Also if you are using any function of some other library it has to be loaded (it should be in the top of the list) before this javascript.