is it possible to preview a page in a page?

Discussion in 'Web Design & Coding' started by Goober, Jun 1, 2005.

  1. Goober

    Goober THQ's Jester Moderator

    Joined:
    Jul 26, 2004
    Messages:
    2,864
    Likes Received:
    35
    Location:
    Colorado
    I have my website that Im putting together (66.118.221.204, it will only be up when im on) and Ive finaly nailed the gmail counter out of the page source code. all I want to do now is preview the page (it only has the gmail counter on it) in the index.htm, or would I have to put the code for the gmail counter into the index.htm

    thnx Gober
     
    Goober, Jun 1, 2005
    #1
    1. Advertisements

  2. Goober

    James Photojournalist

    Joined:
    Dec 24, 2002
    Messages:
    6,662
    Likes Received:
    35
    Can you give us more info on this counter? Or a peek at the script?
     
    James, Jun 1, 2005
    #2
    1. Advertisements

  3. Goober

    Goober THQ's Jester Moderator

    Joined:
    Jul 26, 2004
    Messages:
    2,864
    Likes Received:
    35
    Location:
    Colorado
    ok I guess my post is a little to vague

    the index.htm is just plain basic html

    but the page counter.html has most of the code from the gmail.com site

    HTML:
    <html>
    
    <script type=text/javascript>
    <!--
      var start_time = (new Date()).getTime();
    // -->
    </script>
    
    <head>
    
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    
    <title>The Gmail Counter</title>
    
    <style type=text/css>
    <!--
    body,td,div,p,a,font,span {font-family: arial,sans-serif}
    body {margin-top:2}
    
    .c {width: 4; height: 4}
    
    .bubble {background-color:#C3D9FF}
    
    .tl {padding: 0; width: 4; text-align: left; vertical-align: top}
    .tr {padding: 0; width: 4; text-align: right; vertical-align: top}
    .bl {padding: 0; width: 4; text-align: left; vertical-align: bottom}
    .br {padding: 0; width: 4; text-align: right; vertical-align: bottom}
    
    .form-noindent {background-color: #ffffff; border: #C3D9FF 1px solid}
    
    // -->
    </style>
    <script type=text/javascript src="https://gmail.google.com/gmail?view=page&name=browser"></script>
    <script type=text/javascript>
    <!--
    
    if (top.location != self.location) {
      top.location = self.location.href;
    }
    
    function SetGmailCookie(name, value) {
      document.cookie = name + "=" + value + ";path=/;domain=.google.com";
    }
    
    function lg() {
      var now = (new Date()).getTime();
    
      var cookie = "T" + start_time + "/" + start_time + "/" + now;
      SetGmailCookie("GMAIL_LOGIN", cookie);
    }
    
    function StripParam(url, param) {
      var start = url.indexOf(param);
      if (start == -1) return url;
      var end = start + param.length;
    
      var charBefore = url.charAt(start-1);
      if (charBefore != '?' && charBefore != '&') return url;
    
      var charAfter = (url.length >= end+1) ? url.charAt(end) : '';
      if (charAfter != '' && charAfter != '&') return url;
    
      if (charBefore == '&') {
    	--start;
      } else if (charAfter == '&') {
    	++end;
      }
      return url.substring(0, start) + url.substring(end);
    }
    
    var fixed = 0;
    
    function FixForm() {
      if (!is_browser_supported) {
    	fixed = 1;
      } else {
    	var form = el("gaia_loginform");
    	if (form && form["continue"]) {
    	  var url = form["continue"].value;
    	  url = StripParam(url, "ui=html");
    	  url = StripParam(url, "zy=l");
    	  form["continue"].value = url;
    	  fixed = 1;
    	}
      }
    }
    
    var login_box_time;
    function IframeOnLoad() {
      if (!login_box_time) {
    	login_box_time = (new Date()).getTime();
      }
    }
    
    function el(id) {
      if (document.getElementById) {
    	return document.getElementById(id);
      } else if (window[id]) {
    	return window[id];
      }
      return null;
    }
    
    var CP = [
     [ 1114930800000, 2150 ],
     [ 1117609200000, 2250 ],
     [ 1120201200000, 2350 ]
    ];
    
    var quota;
    
    var ONE_PX = "https://gmail.google.com/gmail/images/c.gif?t=" +
    			 (new Date()).getTime();
    
    function LogRoundtripTime() {
      var img = new Image();
      var start = (new Date()).getTime();
      img.onload = GetRoundtripTimeFunction(start);
      img.src = ONE_PX;
    }
    
    function GetRoundtripTimeFunction(start) {
      return function() {
    	var end = (new Date()).getTime();
    	SetGmailCookie("GMAIL_RTT", (end - start));
      }
    }
    
    function OnLoad() {
      el("gaia_loginform").onsubmit = lg;
      gaia_setFocus();
      LogRoundtripTime();
      if (!fixed) {
    	FixForm();
      }
      if (!quota) {
    	quota = el("quota");
    	updateQuota();
      }
    }
    
    function updateQuota() { 
      if (!quota) {
    	return;
      }
     
      var now = (new Date()).getTime(); 
      var i;
      for (i = 0; i < CP.length; i++) {
    	if (now < CP[i][0]) {
    	  break;
    	}
      }
      if (i == 0) {
    	setTimeout(updateQuota, 1000); 
      } else if (i == CP.length) {
    	quota.innerHTML = 'Over ' + CP[i - 1][1];
      } else {
    	var ts = CP[i - 1][0];
    	var bs = CP[i - 1][1];
    	quota.innerHTML = format(((now-ts) / (CP[i][0]-ts) * (CP[i][1]-bs)) + bs); 
    	setTimeout(updateQuota, 1000); 
      } 
    } 
     
    var PAD = '.000000'; 
     
    function format(num) { 
      var str = String(num); 
      var dot = str.indexOf('.'); 
      if (dot < 0) { 
    	 return str + PAD; 
      } if (PAD.length > (str.length - dot)) { 
    	return str + PAD.substring(str.length - dot); 
      } else { 
    	return str.substring(0, dot + PAD.length); 
      } 
    } 
    
    // -->
    </script>
    </head>
    <ul>
    <p><font size=-1><b>Do you know how much Gmail disk space you have?</b><br> 
    <span id=quota>Over 2000</span></font></p>
    </ul>
    <script>
    <!--
    quota = el("quota");
    updateQuota();
    // -->
    </script>
    </html> 
    
    I guess Ill just have to put the code in the the index.htm, but I want to be able to just show the counter with out haveing to put the code into the index.htm page
     
    Goober, Jun 2, 2005
    #3
  4. Goober

    TheOneGreatX VIP Member

    Joined:
    Apr 27, 2004
    Messages:
    1,276
    Likes Received:
    16
    Location:
    US
    so, why don't you make another html page with the code, and link to it from the index.htm?
     
    TheOneGreatX, Jun 2, 2005
    #4
  5. Goober

    Goober THQ's Jester Moderator

    Joined:
    Jul 26, 2004
    Messages:
    2,864
    Likes Received:
    35
    Location:
    Colorado
    i did... I just dont think its possible, but I can invision it in my mind
     
    Goober, Jun 2, 2005
    #5
  6. Goober

    RD2DG I smell a bump! VIP Member

    Joined:
    Oct 11, 2003
    Messages:
    549
    Likes Received:
    11
    Location:
    Madison
    Are you wanting to do frames?
     
    RD2DG, Jun 2, 2005
    #6
  7. Goober

    Nickweb Resident Filmaker Moderator

    Joined:
    Nov 7, 2003
    Messages:
    2,532
    Likes Received:
    27
    Location:
    North Wales, Britain
    try an iframe - <iframe width="###" height="###" src="blah blah"></iframe>
     
    Nickweb, Jun 5, 2005
    #7
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.