troubleshooting Question

ASP Classic Page load/Display time issues

Avatar of Craig Lambie
Craig LambieFlag for Australia asked on
Web Languages and StandardsJavaScriptASP
16 Comments1 Solution580 ViewsLast Modified:
Hi Experts,

I am writing to query a page load issue with a Page created using ASP classic.

You can see on the code insert that the page loads within the same second according to the start and end TimeStamps written by the ASP.
The page then does't display for 3 seconds, let alone run the JS Function to set some values on the page.

This is happening with a few of my pages that have larger amounts of data on them.
Any ideas on why this happens?

IE 6
ASP classic
HTML

Cheers

C
<HTML><HEAD><TITLE>Money Market Desk - [Quasar]</TITLE><LINK TYPE=text/css REL=stylesheet HREF=/eucapps/FXManager/css/clientinfo.css></HEAD>
 
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
 
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
 
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
 
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
 
//-->
 
function switchpage(select) {
 var index;
 
 for(index=0; index<select.options.length; index++)
   if(select.options[index].selected)
      {
        if(select.options[index].value!="")
          window.location.href=select.options[index].value;
        break;
      }
}
 
</script> 
<BODY topmargin=0 leftmargin=0 ><table width=100% class=menu cellpadding=0 cellspacing=0><tr><td height=30 align=left valign=middle class=title><table class=menu width=100% cellspacing=0 cellpadding=0><tr><td class=title><img src=images/spacer.gif width=5px height=1px><img src=/EUCApps/FXManager/images/Pru_Logo_DEV.gif ></td><td class=title><td class=title><div align=right></td></td></tr></table></td></tr><tr height=1><td class=mainmenuItem></td></tr><tr height=1><td class=lite></td></tr><tr height=20><td class=mainmenu height=20><table class=menu cellpadding=0 cellspacing=0><tr><td class=lite width=1></td><td height=20 width=84 class=MainMenuButton><a class=menu href=/eucApps/FXManager/Menu/Instructions/Instructions.asp>Instructions</td><td class=dark width=1></td><td class=lite width=1></td><td height=20 width=119 class=MainMenuButton><a class=menu href=/eucApps/FXManager/Menu/FXFwdsDiary/FXFwdsDiary.asp>FX Forwards Diary</td><td class=dark width=1></td><td class=lite width=1></td><td height=20 width=80 class=MainMenuButtonSelected><a class=menu href=/eucApps/FXManager/Menu/Quasar/Quasar.asp>M&G Quasar</td><td class=dark width=1></td><td class=lite width=1></td><td height=20 width=80 class=MainMenuButton><a class=menu href=/eucApps/FXManager/Menu/Dealing/PreDealing.asp>Dealing</td><td class=dark width=1></td><td class=lite width=1></td><td height=20 width=80 class=MainMenuButton><a class=menu href=/eucApps/FXManager/Menu/Fastloader/Exec_FL.asp>Fastloader</td><td class=dark width=1></td><td class=lite width=1></td></tr></table></td></tr><tr height=1><td class=dark></td></tr><tr height=1><td class=lite></td></tr><tr height=3><td class=mainmenu></td></tr><tr height=2><td class=dark></td></tr><tr height=15><td class=nav></td></tr></table><script>
 
function ImageOver(selimage){
	eval('document.images.item("' + selimage + '").src = "../../images/' + selimage + '_Over.gif"')
}
 
function ImageOff(selimage){
	eval('document.images.item("' + selimage + '").src = "../../images/' + selimage + '.gif"')
}
 
</script>
 
 
 
<LINK rel="stylesheet" type="text/css" href="../../CSS/clientinfo.css">
 
<script type="text/javascript" src="../../includes/sorttable.js"></script>
<script type="text/javascript" src="../../includes/selectbox.js"></script>
 
 
<script language="VBScript" type="text/VBScript">
 
 
 
Function txtAmount_onblur(intID)
dim IncDec
 
IncDec = "txtAmount" & intID
 
If document.frmQuasar.elements(IncDec).value = "" then
	document.frmQuasar.elements(IncDec).value  = "0.00"
end if
 
End Function
 
</script>
 
<script type="text/javascript" src="../../includes/CalendarPopupComb.js"></script>
<script type="text/javascript" src="../../includes/inc_formatting.js"></script>
<script type="text/javascript" src="../../includes/ajax.js"></script>
 
 
<SCRIPT ID=clientEventHandlersJS LANGUAGE=javascript>
 
var cal18 = new CalendarPopup("caldiv");
cal18.setCssPrefix("TEST");
cal18.offsetX = 80;
cal18.offsetY = -8;
 
function MoveBal(RowID) {	
	if (currentControl==RowID) {		
		
		//alert(unformatCurrency(document.frmQuasar.elements("txtBalInc" + RowID).value)*-1);
		
		if (unformatCurrency(document.frmQuasar.elements("txtBalInc" + RowID).value) < 0) {
				document.frmQuasar.elements("txtAmount" + RowID).value= formatCurrency(unformatCurrency(document.frmQuasar.elements("txtBalInc" + RowID).value) * -1);
			}
			else {
				document.frmQuasar.elements("txtAmount" + RowID).value= document.frmQuasar.elements("txtBalInc" + RowID).value;
			}		
	}
}
 
var currentControl;
 
function txtAmountOnF(intID) {
	currentControl= intID;
	if (document.frmQuasar.elements('txtAmount' + intID).value == '0' || document.frmQuasar.elements('txtAmount' + intID).value == '0.00') {
		document.frmQuasar.elements('txtAmount' + intID).value  = '';
	}
}
 
function txtAmountOC(varRowID) {
	UpdateMorT(document.frmQuasar.elements('txtAmount'+ varRowID));
	ValidateLine(varRowID);
}
 
 
function ValidateLine(varRowID) {
	//test this line and enable "create" if all fields have a value
 
var varValidateArray = [];
var varSplitable = ('txtBS,txtCCYb,txtAmount,txtCCYc,txtValueDate');
var varInvalid = false;
	
	varValidateArray = varSplitable.split(',');
 
		for (i=0;i<varValidateArray.length;i++) {
			
			//alert(document.frmQuasar.elements(varValidateArray[i]+varRowID).value);
			//alert(document.frmQuasar.elements(varValidateArray[i]+varRowID).name);
			if (document.frmQuasar.elements(varValidateArray[i]+varRowID).value == '' || document.frmQuasar.elements(varValidateArray[i]+varRowID).value == '0.00' || document.frmQuasar.elements(varValidateArray[i]+varRowID).value == '0') {
				varInvalid = true;
				break;
			}				
		}
		
	
		
		//if all fields have a value then enable create button
		if (varInvalid==false) {
			document.frmQuasar.elements('butCreateInst'+varRowID).disabled = false;
		}
}
 
function CreateInstruction (varRowID, varFundCode) {
	
	//Disable Button
	document.frmQuasar.elements('butCreateInst'+varRowID).disabled = false;
	
		if (CheckAmount(varRowID) != true) {
			return;
		}
 
	//create Posting HTTP
var PostingHTTP = 'strFundCode=' + varFundCode;
	PostingHTTP = PostingHTTP + '&strValueDate=' + document.frmQuasar.elements('txtValueDate'+varRowID).value;
	PostingHTTP = PostingHTTP + '&strFXQuasarID=' + document.frmQuasar.elements('txtFXQuasarID'+varRowID).value;
	PostingHTTP = PostingHTTP + '&strCCY=' + document.frmQuasar.elements('txtCCYb'+varRowID).value;
	PostingHTTP = PostingHTTP + '&strAmount=' + document.frmQuasar.elements('txtAmount'+varRowID).value;
	
	if (document.frmQuasar.elements('txtBS'+varRowID).value == 'B') {
		PostingHTTP = PostingHTTP + '&strBuyCCY=' + document.frmQuasar.elements('txtCCYb'+varRowID).value;
		PostingHTTP = PostingHTTP + '&strSellCCY=' + document.frmQuasar.elements('txtCCYc'+varRowID).value;
	} else {
		PostingHTTP = PostingHTTP + '&strBuyCCY=' + document.frmQuasar.elements('txtCCYc'+varRowID).value;
		PostingHTTP = PostingHTTP + '&strSellCCY=' + document.frmQuasar.elements('txtCCYb'+varRowID).value;
	}
 
	//send to Ajax
	//document.write(PostingHTTP);
	//document.location.href = '../../Forms/frmAddFXQuasarInst.asp?'+PostingHTTP;
	GenericAjax('../../Forms/frmAddFXQuasarInst.asp?'+PostingHTTP,'MarkDone('+varRowID+')');
 
}
 
function CheckAmount(varRowID) {
	var frm = document.frmQuasar;
	var varCCYBalInc = unformatCurrency(frm.elements('txtBalInc'+varRowID).value);
	var varAmount = unformatCurrency(frm.elements('txtAmount'+varRowID).value);
	
	if (varCCYBalInc < 0) {
		varCCYBalInc = varCCYBalInc * -1;
	}
	
	var var5Perc = varCCYBalInc * 0.05;
	var TotalToCheck = var5Perc + varCCYBalInc;
	
	
	if (varAmount > TotalToCheck) {
		var varInput_Box = confirm('You have input an Amount greater than 5% of total, continue?');
		if (varInput_Box != true) {
			return false;
		} else {
			return true;
		}
	} else {
		return true;
	}
}
 
function MarkDone(varRowID) { //Indicate Completed on Button 
document.frmQuasar.elements('butCreateInst'+varRowID).value = 'Instructed';
 
	//lock down Fields
var varLockArray = [];
var varSplitable = ('txtBS,txtCCYb,txtAmount,txtCCYc,txtValueDate,butCreateInst')
 
	varLockArray = varSplitable.split(',');
 
	for (i=0;i<varLockArray.length;i++) {
		document.frmQuasar.elements(varLockArray[i]+varRowID).disabled = true;
		}
 
}
 
</Script>
 
 
<body onload="javascript:fncOnLoad();">
	
Start Load: 18/07/2008 09:37:14<table cellpadding=2 cellspacing=2>
<form name=frmQuasar method='post' action='Quasar.asp'>
	<tr>
<td><SELECT type=text name=txtCustodian id=txtCustodian><Option Value=0></Option><Option Value=BBH>BBH</Option>
<Option Value=BONY>BONY</Option>
<Option Value=JPM>JPM</Option>
<Option Value=NORT>NORT</Option>
</Select></td>
		<td>
					<SELECT name=txtCCYFilter id=txtCCYFilter>
						<option value=0></option>
						<Option Value=GBP>GBP</Option>
 
 
					</SELECT>
		</td>
<td><SELECT type=text name=txtFundCode id=txtFundCode>
	<Option Value=0></Option>
 
 
</Select></td>
		<td>
			<INPUT type=Submit name=butSubmit id=butSubmit value=Filter>
		</td>
	</tr>
Start SQL Open: 18/07/2008 09:37:14End SQL Open: 18/07/2008 09:37:14<tr>
	<th class=Bonds>Custodian</td>
	<th class=Bonds>CCY</td>
	<th class=Bonds>Fund Code</td>
	<th class=Bonds>Quasar</td>
	<th class=Bonds>TT</td>
	<th class=Bonds>Date</td>
	<th class=Bonds>CCY Bal Inc</td>
	<th class=Bonds>CCY Bal Ex</td>
	<th class=Bonds>Buy/ Sell</td>
	<th class=Bonds>CCY</td>
	<th class=Bonds>Amount</td>
	<th class=Bonds>Contra CCY</td>
	<th class=Bonds>Contra Amount<font class=subscript>E</font></td>
	<th class=Bonds>Value Date</td>
	<th class=Bonds>Create<br>Instruction</td>
</tr>
<tr>
	<td class=Bonds>NORT</td>
	<td class=Bonds>
		<INPUT type=text class=Bonds name=txtCCYa0 id=txtCCYa0 value="GBP" size=3></td>
	<td class=Bonds>COR</td>
	<td class=Bonds>1855</td>
	<td class=Bonds></td>
	<td class=Bonds>18/07/2008</td>
	<td class=Bonds>
		<INPUT type=text class=Bonds name=txtBalInc0 id=txtBalInc0 value="3,449,357.69" onclick="javascript:MoveBal(0);"></td>
	<td class=Bonds><div align=right>3,449,357.69</div></td>
		<INPUT type=hidden name=txtFXQuasarID0 id=txtFXQuasarID0 value="2501">
	<td class=Bonds>
	<SELECT name=txtBS0 id=txtBS0 onchange="javascript:ValidateLine(0);">
		<option value=0></option>
		<option value=B>Buy</option>
		<option value=S>Sell</option>
	</td>
	<td class=Bonds>
	<SELECT name=txtCCYb0 id=txtCCYb0 onchange="javascript:ValidateLine(0);">
		<option value=0></option>
	</td>
	<td class=Bonds>
		<INPUT type=text class=rightalign name=txtAmount0 id=txtAmount0 value=0.00 size=12 onfocus="javascript:txtAmountOnF(0);" onblur=txtAmount_onblur(0) onchange="javascript:txtAmountOC(0);">
	</td>
	<td class=Bonds>
	<SELECT name=txtCCYc0 id=txtCCYc0 onchange="javascript:ValidateLine(0);">
		<option value=0></option>
	</td>
	<td class=Bonds>
		<INPUT type=text class=readonly name=txtContraAmount0 id=txtContraAmount0 value="0.00" size=12 >
		<INPUT type=hidden name=txtDefContraCCY0 id=txtdefContraCCY0 value="GBP">
	</td>
	<td class=Bonds>
		<INPUT type=text name=txtValueDate0 id=txtValueDate0 onclick="javascript:cal18.select(document.frmQuasar.txtValueDate0,'txtValueDate0','dd/MM/yyyy'); return false;" value=22/07/2008 size=7 onchange="javascript:ValidateLine(0);">
	</td>
	<td class=Bonds>
		<INPUT type=Button disabled name=butCreateInst0 id=butCreateInst0 value="Create" onclick="javascript:CreateInstruction(0,'COR');">
	</td>
</tr>
 
 
......
Repeated for 90 TRs
.....
 
	<td class=Bonds>
		<INPUT type=text class=readonly name=txtContraAmount90 id=txtContraAmount90 value="0.00" size=12 >
		<INPUT type=hidden name=txtDefContraCCY90 id=txtdefContraCCY90 value="USD">
	</td>
	<td class=Bonds>
		<INPUT type=text name=txtValueDate90 id=txtValueDate90 onclick="javascript:cal18.select(document.frmQuasar.txtValueDate90,'txtValueDate90','dd/MM/yyyy'); return false;" value=22/07/2008 size=7 onchange="javascript:ValidateLine(90);">
	</td>
	<td class=Bonds>
		<INPUT type=Button disabled name=butCreateInst90 id=butCreateInst90 value="Create" onclick="javascript:CreateInstruction(90,'SPGT');">
	</td>
</tr>
</table>
<INPUT type=hidden name=intRowCount id=intRowCount value=91>
</form>
<DIV ID="caldiv" STYLE="position:absolute;visibility:hidden;background-color:white;layer-background-color:white;"></DIV>End Load: 18/07/2008 09:37:14
 
 
<SCRIPT LANGUAGE="JavaScript">
 
function fncOnLoad() {
 
alert(Date());
 
for (i=0;i<this.frmQuasar.intRowCount.value;i++) {
	
	Selectbox.selectOnlyOptions(this.frmQuasar.elements("txtCCYb" + i), '^'+this.frmQuasar.elements("txtCCYa"+i).value+'$');
	
}
 
alert(Date());
 
} //end On Load
</SCRIPT>
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 16 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 16 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros