0

I have a tooltip script I grabbed from:
http://www.dynamicdrive.com/dynamicindex5/fixedtooltip.htm

Normally used kind of like this:

<script src="http://thescript.com/tooltip.js"></script>

<a onMouseover="fixedtooltip('I am html harharhar', this, event, '150px')" onMouseout="delayhidetip()">JavaScript Kit</a>

BUT.. I'm using Smarty to parse templates. I am trying to parse my tooltip "content" as an include file.

<script src="http://thescript.com/tooltip.js"></script>

<a onMouseover="fixedtooltip('{include file="popup.html" all=$response['item1'] id=$response['id']}', this, event, '150px')" onMouseout="delayhidetip()">JavaScript Kit</a>

Unfortinatly, I can not find a way to do this without breaking the javascript. Thoughts?

1
  • Why does this breaks the javascript? Does the file popup.html contain any quotes? Commented Apr 16, 2012 at 17:17

1 Answer 1

2

{literal} tags allow a block of data to be taken literally. This is typically used around Javascript or stylesheet blocks where {curly braces} would interfere with the template delimiter syntax. Anything within {literal}{/literal} tags is not interpreted, but displayed as-is. If you need template tags embedded in a {literal} block, consider using {ldelim}{rdelim} to escape the individual delimiters instead.

Sign up to request clarification or add additional context in comments.

1 Comment

its actually because new lines interfer with javascript execution. additionally, CSS classes refrenced in the popup are also causing some kind of interference. When withdrawn to test small snippets at a time, the style property is also causing broken javascript. but thanks for your input, i didn't know about those tags.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.