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

142
Views
Get js file directory

in js file, I have below code:

jQuery(document).ready(function($) {
  $("ul.colors .color1").click(function () {
        $("#colors").attr("href", "wp-content/plugins/hekim/widgets/bclinico/css/colors/default.css");
        return false;
   })
});

it works only on the homepage because on other pages, it adds page name to the url.for example:

on the home page: link.com/.../defauls.css works

on contact page: link.com/contact-page/default.css not working

how can I write directly js file url instead of wp-content/... to href?

it works under wordpress, I can do it easily with `php/wordpress code but it is in a js file and I want to make it with js or jquery code.

about 4 years ago · Juan Pablo Isaza
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!