> ## Documentation Index
> Fetch the complete documentation index at: https://dokumentation.websale.de/llms.txt
> Use this file to discover all available pages before exploring further.

# WEBSALE JavaScript library

> Overview of the WEBSALE JavaScript modules: which file provides which function, which prerequisites apply, and where to download the files.

WEBSALE V8s delivers its JavaScript functions as individually loadable files. This page lists the available modules with their file names and prerequisites.

You can find the current list in the online service area. Open the "PageSpeed-Tool" tab there; the modules and libraries are listed in the right column.

Reference: JavaScript and jQuery

## Download

You can download each file at this address:

```text theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
https://<ihre-domain>/$WS/ws_sysdata/js/<Dateiname>.js
```

## Three variants, one of them current

Historically, there are three ways to include WEBSALE JavaScript. This is the most important point on this page, because your choice determines how much you load.

| Variant | Files | Use |
| - | - | - |
| **WS-Module** | `ws-module-…` | Current. You load only the modules you actually need |
| System library | `ws-system-…` | Legacy. One large file with all modules, jQuery, and Colorbox |
| Core library | `ws-core-…` | Legacy. Like the system library, but without jQuery and Colorbox |

> [!NOTE]
>
> The WS modules were extracted from the system library and have since been available as standalone files. To integrate individual modules, you need neither the system library nor the core library nor their design component.
>
> For new shops, the WS modules are therefore the right approach.

## WS modules

### The basic component comes first

The module and design basic components must be loaded once **before** all other WS modules.

| | File |
| - | - |
| Module component | `ws-module-basics-1.8.4.js` |
| Design component | `ws-module-basics-design-1.8.4.js` |
| Prerequisite | jQuery library |

The basic component provides two functions: `ws_showJSOnlyClass` shows a `div` area only when JavaScript is active, and `ws_registerLimitTextarea` displays the remaining characters of a textarea.

### The individual modules

All of the following modules require the jQuery library and the basic component, unless the table states otherwise.

| Function | Module component | Design component |
| - | - | - |
| Load dependent variants via AJAX | `ws-module-pr-depvar-1.8.4.js` | `ws-module-pr-depvar-design-1.8.4.js` |
| Econda Cross Sell | `ws-module-econda-cs-links-1.8.4.js` | none |
| Input-dependent address data control | `ws-module-multiple-data-1.8.4.js` | `ws-module-multiple-data-design-1.8.4.js` |
| Load templates via AJAX | `ws-module-load-template-1.8.4.js` | none |
| Add products to the wish list via AJAX | `ws-module-pr-to-memolist-1.8.4.js` | `ws-module-pr-to-memolist-design-1.8.4.js` |
| Add products to the shopping cart via AJAX | `ws-module-pr-to-basket-1.8.4.js` | `ws-module-pr-to-basket-design-1.8.4.js` |
| Product recommendation function via AJAX | `ws-module-pr-recommendation-1.8.4.js` | `ws-module-pr-recommendation-design-1.8.4.js` |
| Product comparison | `ws-module-pr-comparison-1.8.4.js` | `ws-module-pr-comparison-design-1.8.3.js` |
| SEO content for products | none | `ws-module-seo-content-products-design-1.0.0.js` |
| Web-to-print | `ws-module-w2p-ajaxinit-1.8.4.js` | `ws-module-w2p-ajaxinit-design-1.8.4.js` |
| Link shortener | none | `ws-module-link-shortener-design-1.8.4.js` |
| Password checker, the password strength indicator | `ws-module-passwordchecker-1.8.4.js` | none |
| Consent to data processing | `ws-module-agreementcookies-1.8.5.js` | none |

Three modules have different prerequisites:

| Module | Difference |
| - | - |
| Econda Cross Sell | Also requires the econda JavaScript SDK, see below |
| SEO content for products | Also requires the module for loading templates, or alternatively the core or system library |
| Consent to data processing | Requires **only** jQuery, not the basic component |

> [!NOTE]
>
> The design component of the product comparison has the version identifier `1.8.3`, although the module component is `1.8.4`. The same applies to SEO content, whose design component is independently at `1.0.0`. Both are stated this way in the previous documentation. Check in the PageSpeed tool which version your shop actually offers.

## Additional modules

These modules belong to individual functions and require the jQuery library or the WEBSALE system library.

| Function | File | Special note |
| - | - | - |
| Datepicker widget | `ws-datepicker-creator-1.0.0.js` | Also the language file `ws-datepicker-language-de-1.0.0.js` |
| Keep direct order during a session | `ws-product-reminder-1.7.0.js` | |
| Upload a CSV file for direct order | `ws-direct-order-1.0.0.js` | Also requires the jQuery Form Plugin |
| Econda Cross Sell SDK | `econda-recommendations-3.0.20.js` | Also requires `ws-module-econda-cs-links-…` |
| E-Marketing Manager, Newsletter V3 | `ws-emarketing-manager-1.0.0.js` | |
| User Detection | `ws-user_detection-1.6.0.js` | Recommended |
| Mobile Detection | `ws-mobile_detection-1.0.0.js` | Discontinued, see below |
| IBAN converter | `ws-iban-converter-1.0.3.js` | |
| Category filter | `ws-filter-and-sort-1.2.1.js` | |
| Newsletter V2 | `ws-nllogin-1.0.0.js` | |
| Postal code assistant | `ws-ziphelp-1.1.0.js` | |
| Multiple product images display | `ws-imagegroup-1.1.1.js` | |
| jQuery Form Plugin | `jquery.form.js` | Converts HTML forms to AJAX, required for image upload |
| Products in Action | `ws-actionimages-1.1.0.js` | Also requires the jQuery Form Plugin |
| Upload module | `ws-upload-1.0.0.js` | |

### User Detection and Mobile Detection

`ws-user_detection` contains two redirects: to a matching subshop based on a country check via GeoIP, and to an optimized shop variant if one exists for the device used.

`ws-mobile_detection` contains only the device redirect and is no longer being developed. Use `ws-user_detection` instead.

> [!WARNING]
>
> Before setting up a redirect based on the country of origin, check with your legal advisor whether it is permissible.

### Changes to direct order

Direct order is the only module with a documented change history.

| Version | Change |
| - | - |
| 1.7.0 | The default class of the input lines is now `cookie_product_reminder_data_line` instead of `direct_order_productLine`. The module checks whether an input line exists. New option `cookieActionParam`, which prevents errors caused by multiple OTPX parameters with the same name |
| 1.6.0 | Advertising code and product number can be separated from the same text input. The selected variant combination can be saved. New button for deleting products from the list and cookie |

> [!WARNING]
>
> When upgrading to 1.7.0, a class name changes. If your stylesheet styles `direct_order_productLine`, it no longer applies after the switch.

## System library and core library

Both variants are legacy. They bundle several modules in one file and each requires the matching design component `ws-design-<Version>.js`.

| Library | Current file | Difference |
| - | - | - |
| System library | `ws-system-1.8.3.js` | Also contains jQuery 1.7.2 and the jQuery Colorbox Plugin 1.3.19 |
| Core library | `ws-core-1.8.3.js` | Without jQuery and without Colorbox |

In version 1.8.3, both contain the same functions:

* Load static page content via AJAX
* Load dependent variants of a product via AJAX
* Product comparison
* Add products to the shopping cart via AJAX
* Add products to the wish list via AJAX
* Recommend a product via AJAX
* Input-dependent address data control
* Automatically show `div` containers when JavaScript is active
* Dynamically display the remaining characters of a textarea
* econda Cross Sell
* The functions `ws_AjaxLoadTemplate` and `ws_AjaxLoadTemplatePOST`

> [!NOTE]
>
> Older versions of both libraries remain available but contain fewer functions. Versions 1.8.0 and 1.1.0 include jQuery 1.4.2 and Colorbox 1.3.6. `ws_AjaxLoadTemplatePOST` was only added in 1.8.3, and input-dependent address data control in 1.8.2.
>
> You can see which versions your shop offers in the PageSpeed tool.

## Older versions

Older versions of most modules remain available. The file name always follows the same pattern, with the version identifier before the extension. For an existing integration, you only change the number in the file name.

This page states the version that the previous documentation lists as current. The list in the PageSpeed tool is authoritative.


## Related topics

- [JavaScript and jQuery](https://dokumentation.websale.de/en/v8s/templates/javascript-und-jquery.md)
- [Link shortener](https://dokumentation.websale.de/en/v8s/funktionen-zur-shop-optimierung/link-shortener.md)
- [Reload and submit forms via AJAX](https://dokumentation.websale.de/en/v8s/formulare-fuer-kundenanfragen/formulare-per-ajax-nachladen-und-absenden.md)
- [Designing category filters](https://dokumentation.websale.de/en/v8s/fortgeschrittene-designtechniken/kategoriefilter-designen.md)
- [Integrating FINDOLOGIC](https://dokumentation.websale.de/en/v8s/externe-dienste/integration-von-findologic.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.