Javascript: Difference between revisions

From Sage CRM Knowledge Base
No edit summary
No edit summary
Line 8: Line 8:
         Response.Write("" + x + " = " + Request.ServerVariables(x));  
         Response.Write("" + x + " = " + Request.ServerVariables(x));  
     }
     }
----
Useful function to wrap any content in a nice block
function wrapscreen(title, content)
{
  var themepath="/crm/Themes/img/color/backgrounds/"; 
  var res="";
  //top
  res+="<TABLE border=0 cellpadding=0 cellspacing=0 ><TR><TD colSpan=3><TABLE border=0 cellSpacing=0 cellPadding=0 width=\"100%\">"+
      "<TR>"+
      "<TD vAlign=bottom><IMG title=\"\" border=0 hspace=0 align=top src=\""+themepath+"paneleftcorner.jpg\"></TD>"+
      "<TD class=PANEREPEAT width=\"10%\" noWrap>"+title+"</TD>"+
      "<TD vAlign=bottom><IMG title=\"\" border=0 hspace=0 align=top src=\""+themepath+"panerightcorner.gif\"></TD>"+
      "<TD class=TABLETOPBORDER>&nbsp;</TD>"+
      "<TD class=TABLETOPBORDER vAlign=bottom width=\"90%\" align=right COPSPAN=\"30\">&nbsp;</TD></TR></TBODY></TABLE></TD></TR>";
  //content
  res+="<TR class=CONTENT><TD  class=TABLEBORDERLEFT width=1><IMG title=\"\" border=0 hspace=0 align=top src=\""+themepath+"tabletopborder.gif\"></TD>"+
        "<TD class=VIEWBOXCAPTION height=\"100%\" width=\"100%\">"+content+
        "<TD class=TABLEBORDERRIGHT Rowspan=10 width=1><IMG title=\"\" border=0 hspace=0 align=top src=\""+themepath+"tabletopborder.gif\"></TD></TR><TR>"+
        "<TD class=TABLEBORDERBOTTOM width=1 colSpan=30></TD></TR></TABLE><br />";
  return res;
}

Revision as of 18:23, 7 November 2012

Useful ASP javascript code to see all "Request.ServerVariables"

Could also be used on "Request.Form" etc

   for(f = new Enumerator(Request.ServerVariables()); !f.atEnd(); f.moveNext()) 
   { 
       var x = f.item(); 
       Response.Write("" + x + " = " + Request.ServerVariables(x)); 
   }



Useful function to wrap any content in a nice block

function wrapscreen(title, content) {

 var themepath="/crm/Themes/img/color/backgrounds/";  
 var res="";
 //top

res+="

";
  //content
res+=""+ ""+ "
"+ ""+ ""+ ""+ ""+ ""+ "</TBODY>
<IMG title=\"\" border=0 hspace=0 align=top src=\""+themepath+"paneleftcorner.jpg\">"+title+"<IMG title=\"\" border=0 hspace=0 align=top src=\""+themepath+"panerightcorner.gif\">  
<IMG title=\"\" border=0 hspace=0 align=top src=\""+themepath+"tabletopborder.gif\">"+content+ "<IMG title=\"\" border=0 hspace=0 align=top src=\""+themepath+"tabletopborder.gif\">


";

 return res;

}