⌨️ HTML Code
The values you have to put in the HTML attributes are specific to each event and each session. They will be communicated to you directly by the Comexposium Team. The Comexposium Team will also have to allow all the domain names you call, otherwise you will have the following errors in the javascript console:
wrong application token CORS: Response to preflight request doesn't pass access control check
Once all your domain names have been authorized by Comexposium, and the loader.min.js script as well as your version of jQuery are correctly loaded in your application / platform, you can add the following code in the body part of your HTML code:
<div id="cxpmClientAccountWidget"
data-salon="[SHOWROOM_NAME]"
data-sessionSalon="[SHOWROOM_SESSION]"
data-application="[YOUR_APPLICATION_ID]"
data-language="[LANGUAGE]"
>
<!-- Nothing here -->
</div>
This is a simple div with 4 attributes. Each of these attributes refers to the event:
- [SHOWROOM_NAME] : The name of the show related to your use.
- [SHOWROOM_SESSION] : The name of the session related to your use
- [YOUR_APPLICATION_ID] : Your application id in the ComexposiumConnect environment. This one is unique whatever the showroom or the session. It also differs depending on whether you are in production or pre-production.
- [LANGUAGE] :It can take 2 possible values : "fre-FR" or "eng-GB"
These elements will be sent to you by the Comexposium Team.
Full example
Here is an example using the pre-production environment, and having been authorized for the domain name: http://127.0.0.1:63569. You can test it by launching a local web server especially thanks to this free chrome app on the http port 63569 :
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Exemple</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js" charset="utf-8"></script>
</head>
<body>
<div id="cxpmClientAccountWidget"
data-salon="exemple"
data-sessionSalon="exemple_2018"
data-application="2a6d06fc8089bbff0889aadc02d4a14ac1bdd03a"
data-language="eng-GB"
>
<!-- Nothing here -->
</div>
<script src="https://connect.preprod.comexposium-webservices.com/js/loader.min.js"></script>
<script type="text/javascript">
$(document).on("comexposiumConnectLoaded", function(){
console.log("ComexposiumConnect loaded");
});
$(document).on('comexposiumConnectLogged', function(event, email, token, isExhibitor) {
console.log(email, token, isExhibitor);
});
</script>
</body>
</html>