[Xerte] Re: Embedding survey monkey
Julian Tenney
Julian.Tenney at nottingham.ac.uk
Fri Jul 3 09:26:33 BST 2015
I wondered about that, but I'd like to understand why it's inserting at 0,0 because it might be something xerte is doing and possible we could change something so it does work properly using their embed code: here is my solution, which adds an extra div, and then adds an extra parameter z to the function so I can pass in the id of the div and then use that to set the value of the var c:
<div id="survey"></div>
<script>(function(t,e,s,n,z){var o,c,a;t.SMCX=t.SMCX||[],e.getElementById(n)||(o=e.getElementsByTagName(s),c=document.getElementById(z),a=e.createElement(s),a.type="text/javascript",a.async=!0,a.id=n,a.src=["https:"===location.protocol?"https://":"http://","widget.surveymonkey.com/collect/website/js/EZfigXKNNLYTe3aIXp3Y0evIBYgz_2FshKsjj5OGywUjs8bbGIhnCZtatXAEg_2FxnCy.js"].join(""),c.parentNode.insertBefore(a,c))})(window,document,"script","smcx-sdk","survey");</script><a style="font: 12px Helvetica, sans-serif; color: #999; text-decoration: none;" href=https://www.surveymonkey.com/mp/customer-satisfaction-surveys/> Create your own user feedback survey </a>
The original code looks for the last script icon. Presumably because it expects to do it as the page is loading, rather than being instantiated in an already loaded framework:
<script>(function(t,e,s,n){var o,c,a;t.SMCX=t.SMCX||[],e.getElementById(n)||(o=e.getElementsByTagName(s),c=o[o.length-1],a=e.createElement(s),a.type="text/javascript",a.async=!0,a.id=n,a.src=["https:"===location.protocol?"https://":"http://","widget.surveymonkey.com/collect/website/js/EZfigXKNNLYTe3aIXp3Y0evIBYgz_2FshKsjj5OGywUjs8bbGIhnCZtatXAEg_2FxnCy.js"].join(""),c.parentNode.insertBefore(a,c))})(window,document,"script","smcx-sdk");</script><a style="font: 12px Helvetica, sans-serif; color: #999; text-decoration: none;" href=https://www.surveymonkey.com/mp/customer-satisfaction-surveys/> Create your own user feedback survey </a>
-----Original Message-----
From: Pat Lockley (Pgogy) [mailto:info at pgogywebstuff.com]
Sent: 02 July 2015 18:58
To: Xerte discussion list
Cc: Julian Tenney
Subject: Re: [Xerte] Re: Embedding survey monkey
If you can share a version I can hack at it in chrome Make a page type?
On 2015-07-02 13:49, Julian Tenney wrote:
> I tried that but it didn't work, but I unscrambled the code and did
> get it to work by forcing the insertBefore to use a new div. I hate it
> when you get js all in one line like that...
>
> cheers Pat,
> ________________________________________
> From: xerte-bounces at lists.nottingham.ac.uk<mailto:xerte-bounces at lists.nottingham.ac.uk>
> [xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Pat Lockley
> (Pgogy) [info at pgogywebstuff.com]
> Sent: 02 July 2015 18:26
> To: Xerte discussion list
> Subject: [Xerte] Re: Embedding survey monkey
>
> Try wrapping it in a div with a position:absolute style and then set
> the top to something?
>
> On 2015-07-02 11:08, Julian Tenney wrote:
>> Trying to help someone embed a survey money and finding the layout
>> breaks: has anyone successfully manipulated the embed code to get it
>> to appear in the right place?
>>
>> This message and any attachment are intended solely for the addressee
>> and may contain confidential information. If you have received this
>> message in error, please send it back to me, and immediately delete
>> it.
>>
>> Please do not use, copy or disclose the information contained in this
>> message or in any attachment. Any views or opinions expressed by the
>> author of this email do not necessarily reflect the views of the
>> University of Nottingham.
>>
>> This message has been checked for viruses but the contents of an
>> attachment may still contain software viruses which could damage your
>> computer system, you are advised to perform your own checks. Email
>> communications with the University of Nottingham may be monitored as
>> permitted by UK legislation.
>>
>>
>> _______________________________________________
>> Xerte mailing list
>> Xerte at lists.nottingham.ac.uk<mailto:Xerte at lists.nottingham.ac.uk>
>> http://lists.nottingham.ac.uk/mailman/listinfo/xerte
>
> --
> Pgogy Webstuff
> pgogywebstuff.com
>
> _______________________________________________
> Xerte mailing list
> Xerte at lists.nottingham.ac.uk<mailto:Xerte at lists.nottingham.ac.uk>
> http://lists.nottingham.ac.uk/mailman/listinfo/xerte
>
> _______________________________________________
> Xerte mailing list
> Xerte at lists.nottingham.ac.uk<mailto:Xerte at lists.nottingham.ac.uk>
> http://lists.nottingham.ac.uk/mailman/listinfo/xerte
>
>
>
>
> This message and any attachment are intended solely for the addressee
> and may contain confidential information. If you have received this
> message in error, please send it back to me, and immediately delete it.
>
> Please do not use, copy or disclose the information contained in this
> message or in any attachment. Any views or opinions expressed by the
> author of this email do not necessarily reflect the views of the
> University of Nottingham.
>
> This message has been checked for viruses but the contents of an
> attachment may still contain software viruses which could damage your
> computer system, you are advised to perform your own checks. Email
> communications with the University of Nottingham may be monitored as
> permitted by UK legislation.
--
Pgogy Webstuff
pgogywebstuff.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nottingham.ac.uk/pipermail/xerte/attachments/20150703/643407b0/attachment-0001.html>
More information about the Xerte
mailing list