Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
insert javascript (not plug in)
Hello,
How is it possible to insert javascript lightbox2.02 in my Pages. I tried to put this code in the <head> :
<script type=“text/javascript” src=“js/prototype.js”></script>
<script type=“text/javascript” src=“js/scriptaculous.js?load=effects”></script>
<script type=“text/javascript” src=“js/lightbox.js”></script>
It doesn’t work for sure!!!
I tried some of alternatives ways (forms, stm_javascript plugin ) I didn’t find my solution.
Any ideas?
Last edited by thibs (2007-03-28 09:32:29)
Offline
Re: insert javascript (not plug in)
this is the correct way. make sure your path is correct.
edit: there are some lightbox plugins for textpattern which might make things easier for you…
and
Last edited by sthmtc (2007-03-28 09:45:11)
Offline
Re: insert javascript (not plug in)
Perhaps you should use an absolute path from root:
<script type=“text/javascript” src=“/js/prototype.js”></script>
<script type=“text/javascript” src=“/js/scriptaculous.js?load=effects”></script>
<script type=“text/javascript” src=“/js/lightbox.js”></script>
Because when you are displaying for example http://domain.tdl/blog/first-post
your browser will search the script referenced by js/script.js
in /blog/js/
. Start the script’s path with /js
or http://domain.tdl/js/
to make sure that the script can be found
Offline
Re: insert javascript (not plug in)
Yes, thanks, I used smd_slimbox for all my others pictures, but the lightbox2.02 Version is with Full SWF Support…
That’s why I need to use that one just for one swf files presentation.
When I put the code as you said on my txt pages gabarits <head> </head> I have a 404 error !
Offline
Re: insert javascript (not plug in)
When I put the code as you said on my txt pages gabarits <head> </head> I have a 404 error !
Where did you store the javascript files?
Do you use TXP in a sub folder?
Offline
Re: insert javascript (not plug in)
Javascript files are in a folder at the root.
My textpattern website is not in a sub folder.
It’s really strange
Offline
Re: insert javascript (not plug in)
If you get an 404 when referring your JavaScripts in a root folder by /js/
, it is really strange!
Is the page online, to have a short look?
Offline
Re: insert javascript (not plug in)
Offline
Re: insert javascript (not plug in)
While http://www.copperheads-bulldogs.com/js/prototype.js is avaible, i find no reason why /js/prototype.js
should return a 404.
- Do you have a
.htacess
within/js/
? - Do you have a TXP section named
js
?
Offline
Re: insert javascript (not plug in)
No, I dont’ have a htaccess within js folder, and not a section called “Js” too..
It happens when I edit my pages in my textpattern Admin, I put the code and when i save it give me a 404 error page
Sorry, maybe it’s a problem with the hoster.
Offline
Re: insert javascript (not plug in)
I give up… Sorry
Offline
Re: insert javascript (not plug in)
I don’t see where’s the problem, I think it’s a very simple and under my eyes :-)
I continue my research.
Thanks for your help and your time Bastian. I’ll let you if I find the solution
Offline
Pages: 1