GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Anyone here know if you can use .js in a Smarty Template? (https://gfy.com/showthread.php?t=442976)

newbreed 03-11-2005 06:06 PM

Anyone here know if you can use .js in a Smarty Template?
 
See subject. :helpme

Thanks.

Chris 03-11-2005 06:08 PM

google told me yes

swedguy 03-11-2005 06:14 PM

It works like a charm (I'm doing it).

newbreed 03-11-2005 06:23 PM

Quote:

Originally Posted by JupZChris
google told me yes

Google also told me yes, but my server gave me a parse error pointing at the line where my otherwise functional .js is located.

newbreed 03-11-2005 06:24 PM

Quote:

Originally Posted by swedguy
It works like a charm (I'm doing it).

If I am only testing the .js, do I need the encompassing html?

swedguy 03-11-2005 06:58 PM

Quote:

Originally Posted by newbreed
If I am only testing the .js, do I need the encompassing html?

If you have { or } in your javascript, you need to change left_delimiter and right_delimiter.

I've set mine to {{ and }}

http://smarty.php.net/manual/en/language.escaping.php

TMM_John 03-11-2005 07:00 PM

If you use { you do not need to change the delimiters.

You can simply place {literal} and {/literal} around the javascript and it will not parse what is between them for smarty.

newbreed 03-11-2005 07:15 PM

Quote:

Originally Posted by PBucksJohn
If you use { you do not need to change the delimiters.

You can simply place {literal} and {/literal} around the javascript and it will not parse what is between them for smarty.

That's what I was looking for. I think.

newbreed 03-11-2005 07:16 PM

Quote:

Originally Posted by swedguy
If you have { or } in your javascript, you need to change left_delimiter and right_delimiter.

I've set mine to {{ and }}

http://smarty.php.net/manual/en/language.escaping.php

I didn't understand that at first, but now I see what you mean.

JSA Matt 03-11-2005 07:23 PM

Quote:

Originally Posted by PBucksJohn
If you use { you do not need to change the delimiters.

You can simply place {literal} and {/literal} around the javascript and it will not parse what is between them for smarty.

Exactly... do the same thing with CSS

swedguy 03-11-2005 07:31 PM

Quote:

Originally Posted by newbreed
I didn't understand that at first, but now I see what you mean.

I was going to add a clarification, but it was too late to edit it :)

I used to use {literal} and {/literal} before, but it was a pain in the butt because I have a lot of templates (I'm using it in my LL scripts) and I had a tendency to forget about it between the times I needed it. So for me it was a lot easier to change the delimiters. Never needed to worry about it after that.


All times are GMT -7. The time now is 05:41 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123