Skip to main content
Version: v10.0.0

Adding exceptions

In some cases, you can come across some conflict between the Hand Talk's code and some script that the website has. To avoid this conflict, just add this element as an exception.

Treatment of ID and CLASS exceptions

If your website has a conflict problem with one carousel script, for example, you may add the element in the exceptions property.

Declare which ID or class will not be used by the plugin, the child elements will not be read as well, i.e., when you declare that #carousel will not be read, nothing inside that DIV or element will be translated. These elements must be inserted between quotation marks, and separated by commas:

exceptions: ["#menu", "#carousel", ".lists", ".form"]

In the example, we put an exception in a HTML element and CSS classes.

Atention

By adding content as an exception, it will not be read by Hand Talk.

Important

Depending on the language and/or programming logic applied to the website development, to allow the full functioning or to upgrade the results given by the service, you may need to do some customizations in the Hand Talk's installation that need to be done by the customer.

Example Adding Exceptions

Javascript

var ht = new HT({
// Change it to your access token
token: "TOKEN",
// Ignores all content that has the passed id/class
exceptions: ["#carousel", ".form"]
});

HTML

<body>
<!-- There is no reference to the element below in the list, so it will be translated. -->
<h1 id="titulo">Hand Talk</h1>
<!-- The class form is being ignored, so all the content inside this form will not be translated. -->
<form class="form">
<input type="text" placeholder="Insert he text">
<input type="submit" value="Search">
</form>
<!-- This slide is being ignored because the id carousel was added to the exceptions list -->
<div id="carousel">
<div>My slide 1</div>
<div>My slide 2</div>
<div>My slide 3</div>
</div>
<!-- Takes the latest version of the Hand Talk Plugin. -->
<script src="https://plugin.handtalk.me/web/latest/handtalk.min.js"></script>
<script>
var ht = new HT({
// Change it to your access token
token: "TOKEN",
// Ignores all content that has the passed id/class
exceptions: ["#carousel", ".form"]
});
</script>
</body>