tags:

views:

162

answers:

2

I am using some pre-written JavaScript from polldaddy.

They have a JavaScript option which, when you click on the link, the survey pops up as an overlay to my site.

However, I would like when people come to the site, the overlay comes up on its own without needing to click on the link.

Here is the JavaScript:

<script language="javascript" type="text/javascript">
var PDF_surveyID = 'F1B4CE39FE1ECE86';
 var PDF_openText = 'View Survey';
</script>
<script type="text/javascript" language="javascript" src="http://www.polldaddy.com/s.js"&gt;&lt;/script&gt;
<noscript><a href="http://surveys.polldaddy.com/s/F1B4CE39FE1ECE86/"&gt;View Survey</a></noscript>
+2  A: 

If you look at the script you're including, you'll see it does this:

document.write('<a href="javascript:PDF_launch(\''+ PDF_surveyID +'\');">'+ PDF_openText +'</a>');

to put the link into the page. What you'll want to do, then, is call PDF_launch when the page loads.

Jim Puls
+1  A: 

Looking at http://www.polldaddy.com/s.js, the link is written is in the following statement:

document.write('<a href="javascript:PDF_launch(\''+ PDF_surveyID +'\');">'+ PDF_openText +'</a>');

So when you click on the link, it's calling

PDF_launch(PDF_surveyID);

What you'll want to do is call this yourself when the page loads. For example:

<body onload="PDF_launch(PDF_surveyID)">
lc
thank you -- nice work
Angela