Advertisement
devinb93

Recruitment Funnel Custom HTML/JAVA (Jotform)

Nov 12th, 2019
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.25 KB | None | 0 0
  1.  
  2. <iframe
  3. id="JotFormIFrame-93027542702149"
  4. title="Resume Collection Form"
  5. onload="window.parent.scrollTo(0,0)"
  6. allowtransparency="true"
  7. allowfullscreen="true"
  8. allow="geolocation; microphone; camera"
  9. src="https://form.jotform.com/93027542702149"
  10. frameborder="0"
  11. style="
  12. min-width: 100%;
  13. height:200px;
  14. border:none;"
  15. scrolling="no"
  16. >
  17. </iframe>
  18. <script type="text/javascript">
  19. var ifr = document.getElementById("JotFormIFrame-93027542702149");
  20. if(window.location.href && window.location.href.indexOf("?") > -1) {
  21. var get = window.location.href.substr(window.location.href.indexOf("?") + 1);
  22. if(ifr && get.length > 0) {
  23. var src = ifr.src;
  24. src = src.indexOf("?") > -1 ? src + "&" + get : src + "?" + get;
  25. ifr.src = src;
  26. }
  27. }
  28. window.handleIFrameMessage = function(e) {
  29. if (typeof e.data === 'object') { return; }
  30. var args = e.data.split(":");
  31. if (args.length > 2) { iframe = document.getElementById("JotFormIFrame-" + args[(args.length - 1)]); } else { iframe = document.getElementById("JotFormIFrame"); }
  32. if (!iframe) { return; }
  33. switch (args[0]) {
  34. case "scrollIntoView":
  35. iframe.scrollIntoView();
  36. break;
  37. case "setHeight":
  38. iframe.style.height = args[1] + "px";
  39. break;
  40. case "collapseErrorPage":
  41. if (iframe.clientHeight > window.innerHeight) {
  42. iframe.style.height = window.innerHeight + "px";
  43. }
  44. break;
  45. case "reloadPage":
  46. window.location.reload();
  47. break;
  48. case "loadScript":
  49. var src = args[1];
  50. if (args.length > 3) {
  51. src = args[1] + ':' + args[2];
  52. }
  53. var script = document.createElement('script');
  54. script.src = src;
  55. script.type = 'text/javascript';
  56. document.body.appendChild(script);
  57. break;
  58. case "exitFullscreen":
  59. if (window.document.exitFullscreen) window.document.exitFullscreen();
  60. else if (window.document.mozCancelFullScreen) window.document.mozCancelFullScreen();
  61. else if (window.document.mozCancelFullscreen) window.document.mozCancelFullScreen();
  62. else if (window.document.webkitExitFullscreen) window.document.webkitExitFullscreen();
  63. else if (window.document.msExitFullscreen) window.document.msExitFullscreen();
  64. break;
  65. }
  66. var isJotForm = (e.origin.indexOf("jotform") > -1) ? true : false;
  67. if(isJotForm && "contentWindow" in iframe && "postMessage" in iframe.contentWindow) {
  68. var urls = {"docurl":encodeURIComponent(document.URL),"referrer":encodeURIComponent(document.referrer)};
  69. iframe.contentWindow.postMessage(JSON.stringify({"type":"urls","value":urls}), "*");
  70. }
  71. };
  72. if (window.addEventListener) {
  73. window.addEventListener("message", handleIFrameMessage, false);
  74. } else if (window.attachEvent) {
  75. window.attachEvent("onmessage", handleIFrameMessage);
  76. }
  77. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement