JavaScript API Methods

You can use methods of the Netrox SC chat widget JavaScript-API for certain actions. Coupled with event handing this will help achieve unique behavior of the chat and harmoniously embed the live chat system into your site.

The methods employed belong to the nsc_Visitor object that initializes when the widget of live chat system loads up.

Methods currently available

Имя методаОписание
.close()

Allows for closing the chat widget in software.

.getBrowser()

Identify the visitor's browser name and version. Use result example: "Chrome 43"

.getCity()

 Allows for recognizing the visitor's city, identified by the Netrox SC live chat software based on the IP address.

.getCountry()

Recognize the visitor's country, identified by the Netrox SC live chat software based on the IP address.

.getCurrentPage()

Returns the object describing the site's current page.

.getIP()

Returns the string containing the site visitor's IP address.

.getLandingPage()

Returns an object describing the landing page that the visitor started browsing the site with this time.

.getLandingPageParams()

Returns the Javascript object (a set of key-value pairings) where keys are the names of the landing page query string parameters.

.getLastMessage()

It returns the object (a set of key-value pairs) describing the last message in the chat structured as specified below.

.getOS()

Returns the string containing the name and version of the visitor's operating system.

.getPageParams()

Returns the Javascript object (a set of key-value pairings) where keys are the names of the current page request string parameters.

.getPagesCount()

 Returns an integer number of site pages viewed during the current visit.

.getParameter()

Allows for obtaining the value of one of the available parameters

.getReferrer()

Returns the full URL of the page the visitor came to your site from. If the site was accessed directly, the method will return an empty string.

.getTimeOnSite()

It returns the integer number of seconds spent by the user on the entire site throughout the current visit.

.getVisitedPages()

Returns the object array of all pages seen during the current visit. The pages are ranked chronologically. This means that the fist element is the landing page while the last one is the current page.

.getVisitNumber()

Returns the site visitor's current visit number. This refers to how many times the visitor has been to your site, this visit included.

.isChatting()

Returns true, if chat is currently underway (there is at least one message in the chat) and false, if not.

.isMobile()

Returns true, if the visitor's browser and device are detected to be mobile and false, if not.

.messagesCount()

allows for getting the number of messages in an ongoing chat.

.open()

Allows for opening the chat widget in software.

.setParameter()

Allows for setting the value of one of the available parameters

.triggerFilter()

allows for initiating activation of the automatic actions filter.

Parameters for setParameter and getParameter methods
.rate()

JavaScript API method for chat rating.


All rights reserved. Copyright © 2017 Netrox SC
Host CMS