简体   繁体   中英

How to connect this js code to the external sheet and connect to the html?

I have obfuscated an email address using Hiveware Enkoder. The result is below.

obfuscated code

I usually place it inside the div just as is.

But I would prefer to include it in an external file and create less text in my code. I know how to copy it properly to a sheet and place the path and syntax in the head, but I do not know how to connect the file to the div where it should function.

Thank you for any help.

/Pat

Making a bunch of assumptions here (because we can't see what your code does and transcribing a picture of text back to text in order to decode it would be far more effort then I'm willing to put in):

You seem to be operating under the misapprehension that using a src attribute for a script instead of inlining it requires that you place the script in the head .

That is not the case. If your script inserts content into the DOM at the point of the script element, then just put the script element where you want the content.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM