1 Reply Latest reply on Feb 5, 2011 3:42 PM by phreaddee123

    template/iframes scripting

    Sarah9157

      How do I get my homepage to pull a specific template with the corresponding iFrame? The homepage opens the template, but the iframe does not load.

       

      Here is the header script I have on the template:

       

      function readCookie(name) {

       

          var nameEQ = name + "=";

       

          var ca = document.cookie.split(';');

       

          for(var i=0;i < ca.length;i++) {

       

              var c = ca[i];

       

              while (c.charAt(0)==' ') c = c.substring

       

      (1,c.length);


              if (c.indexOf(nameEQ) == 0) return c.substring

       

      (nameEQ.length,c.length);
          }
          return null;

       

      }
      function createCookie(name,value,days) {
          if (days) {
              var date = new Date();
              date.setTime(date.getTime()+(days*24*60*60*1000));
              var expires = "; expires="+date.toGMTString();
          }
          else var expires = "";
          document.cookie = name+"="+value+expires+"; path=/";
      document.location="Capabilities.html";
      }
      function getCookie(name)
      {
      if (document.cookie.length>0)
        {
        c_start=document.cookie.indexOf(name + "=");
        if (c_start!=-1)
          {
          c_start=c_start + name.length+1;
          c_end=document.cookie.indexOf(";",c_start);
          if (c_end==-1) c_end=document.cookie.length;
          return unescape(document.cookie.substring(c_start,c_end));
          }
        }
      return "";
      }

       


      function load()
      {
      var url = getCookie(name);
      document.getElementById('idframe').src=url;
      document.getElementById('idframe').load = 0;
      var w = document.getElementById("idframe")
      w.contentWindow.location.replace(url)
      }