I would like to be able to use javascript code in the tpl's as it doesen't seem to work now it just show up an error.at the moment. The reson is that i want to use a pop up link but i can't find any other way than using javascript for this.
Regards
Moderators: Gaia.
Page: 1
| Author | Post |
|---|---|
|
#1 Thu Sep 15, 2005 7:38 pm
|
|
Member
![]() Registered: Jul 2005
Posts: 232
Location: Stockholm
|
I would like to be able to use javascript code in the tpl's as it doesen't seem to work now it just show up an error.at the moment. The reson is that i want to use a pop up link but i can't find any other way than using javascript for this.
Regards |
|
#2 Thu Sep 15, 2005 8:05 pm
|
|
|
Developer
Registered: Apr 2004
Posts: 2216
Location: Belgium
|
Why doesn't it work? Have you tried 0.7?
_______________ |
|
#3 Thu Sep 15, 2005 8:19 pm
|
|
Member
![]() Registered: Jul 2005
Posts: 232
Location: Stockholm
|
i haven't tried 0.7 (you mean the CVS version right?) but in 0.6a it shows up this error
|
|
#4 Thu Sep 15, 2005 8:23 pm
|
|
|
Developer
Registered: Apr 2004
Posts: 2216
Location: Belgium
|
Must be because you are breaking the string encapsed with single quotes... Normally JavaScript works, but some small fixed were put in CVS so it now even works very well in a post if you are able to post HTML.
_______________ |
|
#5 Thu Sep 15, 2005 8:57 pm
|
|
Member
![]() Registered: Jul 2005
Posts: 232
Location: Stockholm
|
but is it smart to use CVS for your community? Doesen't it get hard to upgrade and so on
|
|
#6 Thu Sep 15, 2005 9:21 pm
|
|
|
Developer
Registered: Apr 2004
Posts: 2216
Location: Belgium
|
For the moment I don't think there's a problem, but of course 0.6 is recommended, just in this case to test if stuff works. But I'm sure you just broke the string the template is in. You'll need to escape the single quotes in your Javascript.
_______________ |
|
#7 Fri Sep 16, 2005 3:43 pm
|
|
Member
![]() Registered: Jul 2005
Posts: 232
Location: Stockholm
|
but i'll test the CVS.. but isn't it possible to add javascript code to a singe .js file and have an include javascript.js or something
|
|
#8 Fri Sep 16, 2005 4:00 pm
|
|
|
Developer
Registered: Apr 2004
Posts: 2216
Location: Belgium
|
Sure it is, but still it should work in the templates themselves too.
_______________ |
|
#9 Fri Sep 16, 2005 8:48 pm
|
|
Member
![]() Registered: Jul 2005
Posts: 232
Location: Stockholm
|
ok i use a code like this
<A HREF="http://site.se/popup/" TARGET="popup" ONCLICK="window.open('http://site.se/popup/', i haven't tried 0.7 yet though.. |
|
#10 Fri Sep 16, 2005 9:10 pm
|
|
|
Developer
Registered: Apr 2004
Posts: 2216
Location: Belgium
|
Well you're using single quotes that need to be escaped...
_______________ |
|
#11 Fri Sep 16, 2005 9:13 pm
|
|
Member
![]() Registered: Jul 2005
Posts: 232
Location: Stockholm
|
what do you mean with single quotes?
|
|
#12 Fri Sep 16, 2005 9:19 pm
|
|
|
Developer
Registered: Apr 2004
Posts: 2216
Location: Belgium
|
<A HREF="http://site.se/popup/" TARGET="popup" ONCLICK="window.open(\'http://site.se/popup/\', This is what you need. ![]() _______________ |
|
#13 Sat Sep 17, 2005 10:32 pm
|
|
Member
![]() Registered: Jul 2005
Posts: 232
Location: Stockholm
|
oh thanks man. I undetstand about the single quotes now and it helped me with some other stuff as well
|
Page: 1
UseBB Community is powered by UseBB 1 Forum Software