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 5992525
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T23:32:39+00:00 2026-05-22T23:32:39+00:00

everyone.I wanna include javascript in the html(webpy templates),but it doesn’t work.the javascript code in

  • 0

everyone.I wanna include javascript in the html(webpy templates),but it doesn’t work.the javascript code in the html works very well…

following is the main python file(main.py):

urls = ('/main','main')
render = web.template.render('templates/')

class main:
  def GET(self):
    return render.main()

app = web.application(urls,globals())

if __name__ == "__main__":
  app.run()

templates/main.htm:

<body>
<script type="text/javascript" src="include.js"></script>
<script>
  alert(location.href);  //this line works..
</script>
</body>

include.js:

alert('test');  //this line doesn't work
  • 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-05-22T23:32:40+00:00Added an answer on May 22, 2026 at 11:32 pm

    You must put the include.js file in a “static/js” directory at the root of your project and src should be “static/js/include.js”.

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

Sidebar

Related Questions

everyone, i have no idea why this doesn't work hopefully someone here can help
Everyone I work with is obsessed with the data-centric approach to enterprise development and
Everyone (at least everyone who uses a compiled language) has faced compilation errors but
Everyone uses source-code control to manage versions (right?) and this provides some level of
Hello everyone I was just going trough http://static.springsource.org/docs/Spring-MVC-step-by-step/part1.html spring tutorial, and I thought its
Good day everyone. I have an audio class, that plays a .wav file. But
I've written some bash scripts (< 200 lines of code each) I wanna share
Greetings everyone, i just wanna ask.. how do i disable the right click property
Everyone keeps saying flash is dead, silverlight is dead, and the future is HTML
everyone, I have this piece of the code: void foo(int var, int var1) {

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.