Hello,

I have been working on a website at my college (not coursework) that uses Pylons and Genshi. To avoid Genshi parsing the JavaScript code in a template I moved the JavaScript to a separate file. The problem is I tried putting the .js file in the templates directory (where the HTML it came from is located) and linking it in with the code below, but it did not work.

<head_info>
        <script type="text/javascript" src="javascript_utilities.js">
        </script>
</head_info>

So what I need to know is, where do I place the JavaScript file so that it will properly link in on a website managed by Pylons.

Thanks

Note: I'f you haven't guessed, I am very new at web development.

Recommended Answers

All 4 Replies

I don't know Genshi, but normally a library file should be put in a specific folder of the frame work. It is not in the same location where HTML files are. Look for a folder in your frame work where other script are located. If you see a bunch of stylesheet (CSS) files in a folder, the parent of that folder may also contain another folder which is where other javascript files would be located.

Some clarification: First, Pylons is the framework, Genshi (A template language) was only the reason for moving the JavaScript. Second, this site is small and the JavaScript that I moved was the only in the whole site and there does not seem to be any separate CSS files.

I just got it resolved. I had to put the .js file in the public folder and give the site name and then the name of the file when referencing it.

Hmm... So Pylons is the one you need to look at then... Does the frame work has its public folder somewhere? That's where all images, javascript, css files should be located. Is there a folder in Pylons called "static"?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.