Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-03-28 09:29:21

thibs
New Member
From: France
Registered: 2007-03-28
Posts: 6
Website

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

#2 2007-03-28 09:43:29

sthmtc
Member
From: CGN, GER
Registered: 2005-01-17
Posts: 586
Website

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…

bas_lightbox

and

smd_slimbox

Last edited by sthmtc (2007-03-28 09:45:11)

Offline

#3 2007-03-28 09:59:22

Bastian
Plugin Author
From: Wuppertal, Germany
Registered: 2005-02-02
Posts: 376
Website

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

#4 2007-03-28 10:00:32

thibs
New Member
From: France
Registered: 2007-03-28
Posts: 6
Website

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

#5 2007-03-28 10:03:02

Bastian
Plugin Author
From: Wuppertal, Germany
Registered: 2005-02-02
Posts: 376
Website

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

#6 2007-03-28 10:12:28

thibs
New Member
From: France
Registered: 2007-03-28
Posts: 6
Website

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

#7 2007-03-28 10:29:52

Bastian
Plugin Author
From: Wuppertal, Germany
Registered: 2005-02-02
Posts: 376
Website

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

#8 2007-03-28 10:37:31

thibs
New Member
From: France
Registered: 2007-03-28
Posts: 6
Website

Re: insert javascript (not plug in)

Here

I’d like to put the code in the contact page.

Last edited by thibs (2007-03-28 11:08:55)

Offline

#9 2007-03-28 11:26:30

Bastian
Plugin Author
From: Wuppertal, Germany
Registered: 2005-02-02
Posts: 376
Website

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

#10 2007-03-28 11:45:55

thibs
New Member
From: France
Registered: 2007-03-28
Posts: 6
Website

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

#11 2007-03-28 11:57:37

Bastian
Plugin Author
From: Wuppertal, Germany
Registered: 2005-02-02
Posts: 376
Website

Re: insert javascript (not plug in)

I give up… Sorry

Offline

#12 2007-03-28 12:01:00

thibs
New Member
From: France
Registered: 2007-03-28
Posts: 6
Website

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

Board footer

Powered by FluxBB