1

i am not familiar with javascript/jquery, that's why my question: I want to split existing javascript file to make code more readable. I have multiple text blocks, which i want to put in separate file/files. What is the best way to realise it?

if (facet === "FACET_NAME") {
      $(this.target).append(
       $('<span> </span><a class="click" onclick="show_hidePopUpWindow(\'foo\');" 
      onmouseover="" style="cursor: pointer;"> ' +  info_button + "</a>" +
      "" + '<div class="menu" id="foo" style="display:none">
     <a onclick="show_hidePopUpWindow(\'foo\');">' +close_button +"</a><b> TEXT </b>\n"
      +"<br><b>CONTENT:</b> Fulltexts of all articles from the inception ...\n" +
  "<br><b>NOTE:</b> To see the image-PDF of the issue you will have go to the database ... \n</div>"  
));}
andy_bu
  • 113
  • 2
  • 13
  • Does [this answer](https://stackoverflow.com/a/950146/14316282) help? Looks like either way it's not as nice as python with `import filename` – Rolv Apneseth May 14 '21 at 10:52

1 Answers1

0

You can insert your js file into another file with the line:

<script src="/path/to/script.js"></script> 
gavstar
  • 41
  • 4