Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-03-21 13:39:18

pedronx
Member
From: Poland
Registered: 2006-01-20
Posts: 18
Website

How to link to javascript (.js)

Helo
We are linking to css by inserting this code:

<link rel="stylesheet" href="<txp:css />" type="text/css" media="screen" />

but how to link to javascript code, and where should i put this on serwer?

Thanks

Last edited by Sencer (2006-03-21 15:37:31)

Offline

#2 2006-03-21 15:58:05

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: How to link to javascript (.js)

<script type="text/javascript" src="/whatever.js"></script> in the head.
In this case whatever.js is in your root.

Offline

#3 2006-03-22 09:13:47

pedronx
Member
From: Poland
Registered: 2006-01-20
Posts: 18
Website

Re: How to link to javascript (.js)

thanks a lot;)

Offline

#4 2006-03-22 12:05:43

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,122
Website GitHub Mastodon Twitter

Re: How to link to javascript (.js)

or you can put the javascript in a form (say with name “js”) and link to it from the page template
<code><txp:output_form form=“js” /></code>
Admittedly this is not linked js as the code will appear in the html page but, on the positive side, you keep all in the db which makes it easier to back up or migrate to a new server.

Last edited by colak (2006-03-22 12:11:45)


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

Board footer

Powered by FluxBB