I am trying to pass value from HTML page(place where button code and deployment code is placed) to prechat form using
`liveagent.addCustomDetail('test','Test Value')`
process. but when I try to get that the value from Prechat form form using
<script type='text/javascript' src='https://c.la1c1.salesforceliveagent.com/content/g/js/32.0/prechat.js'></script>
<script type="text/javascript">
var detailCallback = function (details){
for (var i = 0; i < details.customDetails.length; i++) {
if(details.customDetails[i].label == 'test'){
console.log(details.customDetails[i].value);
}
}
};
liveagent.details.preChatInit('https://d.la1c1.salesforceliveagent.com/chat','detailCallback');
it gives me an error
Uncaught TypeError: Cannot read property 'preChatInit' of undefined
Please tell me where I am going wrong or is there any other way of passing the data.
Thanks!