create LI autofill lib include dynamically
This commit is contained in:
parent
7322f88733
commit
9f93801cb5
@ -1,6 +1,7 @@
|
||||
<script>
|
||||
(function () {
|
||||
var fillScript = document.createElement('script'), // the LI autofill script (client-side)
|
||||
liAutoFillScript = document.createElement('script'),
|
||||
iframeHolderDiv = document.createElement('div'), // so we can style location of button
|
||||
autoFillLocation = document.querySelector("form[id^='mktoForm_']"), // will only find first Marketo form on a page
|
||||
firstRow,
|
||||
@ -91,9 +92,15 @@
|
||||
}
|
||||
});
|
||||
|
||||
// build LI autofill script
|
||||
liAutoFillScript.src = 'https://www.linkedin.com/autofill/js/autofill.js';
|
||||
liAutoFillScript.type = 'text/javascript';
|
||||
liAutoFillScript.defer = true; // as opposed to default 'async'
|
||||
|
||||
// add the iframe to the holder div
|
||||
iframeHolderDiv.appendChild(fillScript);
|
||||
autoFillLocation.prepend(iframeHolderDiv);
|
||||
autoFillLocation.append(liAutoFillScript);
|
||||
|
||||
if (typeof MktoForms2 !== 'undefined') {
|
||||
MktoForms2.whenReady(function (form) {
|
||||
|
Loading…
Reference in New Issue
Block a user