There are the javascript codes inside a web application which was developed with through Microsoft Visual Basic.When to run javascript code on my local machine,it doesn't working on Windows Server 2003.I'm getting the Microsoft JScript runtime error: Object required error with below code.Also,I check out the IDs, no problem.
Code:
function AlertHata(oObject)
{
var iID='';
var dKDVOran=0.0;
var dKDVTutar=0.0;
var dToplamTutar=0.0;
var x=document.getElementById(oObject)
var index=oObject.indexOf('_',14);
iID= oObject.substring(14,index);
dToplamTutar= parseFloat(document.getElementById('Repeater1__ctl' + iID + '_TB_MFistutar').value);
dKDVOran= parseFloat(doc开发者_如何学运维ument.getElementById('Repeater1__ctl' + iID + '_TB_MFkdvO').value);
dKDVTutar=dToplamTutar-( (dToplamTutar) / ((dKDVOran + 100)/100));
dKDVTutar = dKDVTutar.toFixed(2);
dKDVTutar +="";
document.getElementById('Repeater1__ctl' + iID + '_TB_MFisKdv').value=dKDVTutar.replace(".",",");
}
"Object required" error typically indicates that you are trying to use (e.g. access property of) uninitialized java-script variable. It would be very difficult to tell problematic code from your question because the context (html document, other scripts etc) are missing.
However, you can use any script debugger to trouble-shoot the issue. IE8/9, Firefox with FireBug and Chrome has script debugger included and you can set break-points if needed. You can also use Visual Studio for script debugging. You can also include debugger;
statement in your java-script to force script debugging (make sure to nable script debugging in the IE) - it will typically gives you prompt to select available debuggers (if many).
Once you get set break-point at start of function, just run line by line to see problematic code. Inspect variable values to see which one is uninitialized.
精彩评论