1

Im using prettyphoto to create a staff popout info page when a staff photo is clicked.

Pretty photo calls another template via ajax, which works ok except for the staff email which outputs an error: 'JavaScript must be enabled to view this email address'. The code in the ajax popup is as follows:

<div class="modal">
{exp:channel:entries channel="leadershipteam" disable="categories|trackbacks|pagination" sort="asc" entry_id="{embed:entry_id}" limit="1"}
<img src="{colourphoto}" class="leftimage"><h1>{title}</h1><h2>{staff_title}</h2>
<p>{staffdescription}</p>
<br /><strong>{if staff_email} E: {staff_email}<br><br>{/if}{if staff_phone}P: {staff_phone}<br />{/if}</strong>
{/exp:channel:entries}
{clear}
</div>
1

You can't serve javascript via AJAX -- and the email address is being automatically encoded as Javascript to protect it from spammers.

The way around this is to turn off "Automatically turn URLs and email addresses into links?" in the channel preferences.

TTFN Travis

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.