JMeter, when testing web services, basically does not matter whether you are using java, javascript or ajax at client side. JMeter will record HTTP requests including request headers and responses from clients and during testing it will simulate the same requests for the specified number of users(threads). You can easily reproduce the web services if you know all the details of the web-request(host, method(get/post), request parameters, request headers, etc.). If you don't know the details or facing problems then you can use Developer tools>Network (press f12 in Chrome) to get the details of web requests. In your case, you closely observe the web request in ajax call using developer tools and provide the details in JMeter.
If you want to pass login credentials, you can make use of user defined variables in jmeter. You can set values in variables and make use it in requests as ${variable_name}
If you need to do some computations,you can use beanshell components or BSF samplers.
If you want extract value(to a variable) from the response data sent from the server and reuse them, then use regular expression extractor.