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

  • Home
  • SEARCH
  • 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 7826163
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T09:17:10+00:00 2026-06-02T09:17:10+00:00

Into my app I have included all needed JS files (my scripts, libraries such

  • 0

Into my app I have included all needed JS files (my scripts, libraries such as Twitter Bootstrap etc.).

The problem is, that when I have a request which is called via AJAX, so in the called page are not included the JS files, which are included in my app and I have to include them into the called page.

Example: my_scripts.js contains lots of JS functions.

link to page called through AJAX

<a href="/articles/create_new" data-remote="true>Create New Article</a>

/views/articles/_create_new.html.haml

...some content of this file.. #here doesn't work the functions from the file "my_scripts.js"

when I put into the /views/articles/_create_new.html.haml this link

= javascript_include_tag "my_scripts"
...some content of this file..

so then in the /views/articles/_create_new.html.haml those JS functions working.

I would like to ask you, if exist any way, how to automatically put all JS files in my every single AJAX pages, because always include the JS files into an AJAX pages is not good way…

Thanks

  • 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-02T09:17:13+00:00Added an answer on June 2, 2026 at 9:17 am

    use a script loader like RequireJS or $cript.

    Have your pages reply 2 things also: the content and the scripts to load. This is best using JSON like:

    {
        "content" : "content here",
        "scripts" : ["an","array","of","script","urls"]
    }
    

    then when the data is returned, parse and paint the content and after that, use the script loaders to load the scripts. Actually, you can make your own script loader. It’s just a matter of dynamically creating a <script> tag, put it in the <head> and give it an src

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

Sidebar

Related Questions

We have an app that currently installs itself into 'program files\our app', and it
I have installed an HttpModule into my web app that will handle all requests
I have a Scripts folder, that includes all the .js files used in the
I know that after I have deployed my ipad/iphone app into App Store, it
I have around 4000 entities that I need to insert into a Java App
Ok so I am trying to integrate twitter into my iPhone app. I have
In my app, i currently have all my code separated into a static library,
I have been looking into integrating testing into my app based on RequireJS. I
I have to import some XML data into my app. Now I open a
Im trying to develop my first ASP.NET MVC web app and have run into

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.