Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8476715
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T18:15:24+00:00 2026-06-10T18:15:24+00:00

My templates contain JS, as they are called JS is not executed, you have

  • 0

My templates contain JS, as they are called JS is not executed, you have an idea please.

For example in my JS file script.js, i have methods that apply to HTML elements in my templtes and it does not work, an idea please.

Example :

index.html

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
</head>
<body ng-app>
    <ng-include src="'header.html'"></ng-include>
    <script src="angular.js"></script>
    <script src="jquery.js"></script>
    <script src="script.js"></script>
</body>
</html>

header.html

<div id="header">
<div id="logo">AngularJs</div>
<div id="nav"></div>
</div>

script.js

$(document).ready(function(){
    $('#nav').html('<ul><li><a href="">Link<a></li></ul>');
});

The script execute well, I feel it does not find the element div#nav.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T18:15:26+00:00Added an answer on June 10, 2026 at 6:15 pm

    Sorry, I read wrong a part of your question, my mistake.

    The DOM ready statement of jQuery will probably not work correctly. What you can do is on your ngInclude tag add a onload=”FUNCTION_NAME” that contains the DOM edition you indicated inside the script.js

    For more information have a look at the documentation here: http://code.angularjs.org/1.0.1/docs-1.0.1/api/ng.directive:ngInclude

    — Old Post —

    @YoussefElMontaser, you don’t have to put the quotes on the ngInclude:

    <ng-include src="header.html"></ng-include>
    

    probably that is what is wrong with your script not going forward.
    Let me know if that worked.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have a web-application that uses T4 templates to render pages. Pages can contain
I have a base.html template that contains a list of links. Example: <div id=sidebar1>
Have a SomeLib.pro file that contains: CONFIG += debug TEMPLATE = lib TARGET =
My problem: I have 3 templates: main.html.twig (main layout file) layout.html.twig (a bundle specific
I have written a generic CSV file reader that I'm trying to use to
I have a database with tags for an image gallery. They contain the fields
I have an attribute that I match against. It will match 2 XSL templates
I have a web application where the masterPage/template contains some static HTML that never
I have a listbox item template that contains visual states. I have DisplayStateBehaviors that
I have an array set inside a velocity template that contains some paths. The

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.