Overview
With LabVIEW web services, we can respond to AJAX methods by utilizing the LabVIEW Web Services API and the Write response method. This is a fast and easy method to create dynamic web pages utilizing the LabVIEW web server.
Description
This short example demonstrates how we can use AJAX methods to get the windows login name of a particular user. AJAX sends an HTTP request, calling a LabVIEW web method that responds with the login data. We then set a text input field to the user name.
Steps to Implement or Execute Code
- Download and unzip the attached file
- Start the LabVIEW web server by right-clicking the 'WindowsLoginAJAX' web service and select Application Web Service -> Publish
- Using a web browser, type the following url: http://localhost:8001/WindowsLoginAJAX
This will navigate you to the home page - Select the 'Get Login' button: this will run the ReturnWindowsLogin web method
Requirements
Software:
LabVIEW 2013 or greater
Windows OS
Additional Images or Video
Snippet of javascript/ajax function embedded in html page

Web service snippet for get windows user name:

Cole R.
National Instruments
Software Engineer