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

177
Views
Long page loading with own script js

I have a page that takes a long time to load.

The reason is the js script code.

I set it to load asynchronously but it doesn't help.

Is there a way to do this? (In the script, I also refer to the Model from view.)

PageView:

@section Scripts{ 
    <script>
        //Lots of code with functions and references to DOM and AJAX
    </script>
}

_Layout:

@if (IsSectionDefined("Scripts"))
{
    @await RenderSectionAsync("Scripts", true)
}

The server returns a timeout error (works locally without any problem)

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

0

I use this syntax, wtihtout any problem

 @await RenderSectionAsync("Scripts", required: false)
about 4 years ago · Juan Pablo Isaza Report

0

You can use defer attribute <script defer> ... </script>. Also do you used await a lot?

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!