none
Creating a pop-up EULA - Stuck RRS feed

  • Question

  • I am currently using the following code. 
    <html>
    <body>
    <p>Testing!</p>
    </body>
    <script type="text/javascript" language="javascript">
    
    var agreement = GetCookie();
    
    // checks for cookie and displays disclaimer alert if new user
    
    if (agreement == "") {
    
    var decision = confirm("Test");
    
    if (decision == true) {
    
    // writes a cookie
    
    var oneMinute = 60 * 1000
    
    var oneHour = oneMinute * 60
    
    var oneDay = oneHour * 24
    
    var today = new Date()
    
    var nextXmas = new Date()
    
    nextXmas.setMonth(11)
    
    nextXmas.setDate(31)
    
    var expiredays = nextXmas.getTime() - today.getTime()
    
    expiredays = Math.floor(expiredays/oneDay)
    
    var exdate = new Date()
    
    exdate.setDate(exdate.getDate() + 1)
    
    document.cookie = "PartnerAgreement" + "=" + escape("Agree To Disclaimer") +
    
    ((expiredays == null) ? "" : ";path=/; expires=" + exdate.toGMTString())
    
    }
    
    else {
    
    // redirect
    
    window.location = "/_layouts/signout.aspx";
    
    // or close the browser window
    
    //window.opener='x';
    
    //window.close();
    
    }
    
    }
    
    // gets the Cookie if it exists
    
    function GetCookie() {
    
    if (document.cookie.length > 0) {
    
    c_name = "PartnerAgreement";
    
    c_start = document.cookie.indexOf(c_name + "=")
    
    if (c_start != -1) {
    
    c_start = c_start + c_name.length + 1
    
    c_end = document.cookie.indexOf(";", c_start)
    
    if (c_end == -1) c_end = document.cookie.length
    
    return agreement = unescape(document.cookie.substring(c_start, c_end))
    
    }
    
    }
    
    return "";
    
    }
     document.write(exdate);
    </script>
    </html>
    but the problem I have is that I cannot format the text correctly, so I need help formatting the text or ideally loading a PDF in place of the text.
    Wednesday, July 8, 2015 6:43 PM

All replies