Using data in a script

13 posts by 3 authors in: Forums > CMS Builder
Last Post: August 5, 2009   (RSS)

By Roj - August 4, 2009

Hi Dave,

I have attached the viewer.

The URL is http://waittandco.sc14.co.uk/

Thanks

Roj
Roj
Attachments:

viewer.txt 5K

Re: [Roj] Using data in a script

By Dave - August 4, 2009

Roj,

This is a tricky one. Making javascript work is a bit outside of our expertise and support but try adding this function to the top of the page:

<?php
function jsEncode($content) {
$content = htmlspecialchars($content);
$content = addcslashes($content, "\\'\r\n");
return $content;
}
?>


Then use this for your mouseover link:

onmouseover="onover('<?php echo jsEncode( $record['fieldname'] ) ?>')"

And I've attached a test file that shows this working with images and content with single and double quotes.

Hope that helps!
Dave Edis - Senior Developer
interactivetools.com