Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

155
Views
why is this happening to my JavaScript code?

so this is my code:

<!DOCTYPE html>
<html>
    <head>
        <link rel="stylesheet" href="style.css">
    </head>
    <body>
        <script type="module">
            import * as THREE from 'https://unpkg.com/three@0.126.1/build/three.module.js'
            const scene = new THREE.Scene
            console.log(scene)
        </script>
    </body>
</html>

it works just fine but as soon as i put the "src="script.js" to the script tag, the code suddenly stops working... can somebody explain to me why this is happening?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Each script tag only loads from either src or from within the body, not both. You'll need 2 script tags to load the inline code as well as the script file in one of them each.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!