title: How to delete socket from javascript
body: <p>How can I delete <a href="https://mywebsite.com/assets/js/socket.io.js" rel="nofollow noreferrer">https://mywebsite.com/assets/js/socket.io.js</a> from this code? If I just delete it, my script not loading.</p>
  
  <pre><code>console.log('myWp loading ' + Date.now());
  var x = document.createElement('script');
  x.src = 'https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js',
  document.getElementsByTagName('head')[0].appendChild(x),
  x.onload = function() {
  jq321 = jQuery.noConflict(!0);
  var a = document.createElement('script');
  a.src = 'https://mywebsite.com/assets/js/socket.io.js',
  document.getElementsByTagName('head')[0].appendChild(a),
  a.onload = function() {
      var a = jq321('.myWpImportWidget').attr('id'),
          s = document.createElement('script');
  
      var attrLanguage = jq321('.myWpImportWidget').data('myWp-language');
      if(typeof attrLanguage !== 'undefined') { userLanguage = attrLanguage; }
  ..........
  </code></pre>
  
  <p>I don't need socket anymore. My code don't depend on that socket. I am getting error in console <a href="https://prntscr.com/lorjuz" rel="nofollow noreferrer">prntscr.com/lorjuz</a> </p>
  
  <pre><code>socket.io.js:2 GET http://file/socket.io/?sessionID=undefined&amp;EIO=3&amp;transport=polling&amp;t=MTYQAsH 
  </code></pre>
  
  <p>It is full error message. I am getting only this error. Socket loading every time with wrong url, so I need to delete him from the code. But if delete this part of the code: </p>
  
  <pre><code>var a = document.createElement('script'); 
  a.src = 'mywebsite.com/assets/js/socket.io.js', 
  document.getElementsByTagName('head')[0].appendChild(a), 
  </code></pre>
  
  <p>my script not working on front-end</p>