By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,831 Members | 1,031 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,831 IT Pros & Developers. It's quick & easy.

JavaScript code not working in firefox: "length parameter can't be less than zero" error

P: 1
hi there,

im also having problem regarding javascript in fire fox here is my cod ewhich im callin g from server side
it works fine in IE
but fails in FIREFOX

Expand|Select|Wrap|Line Numbers
  1. public static void PrintProgressBar()
  2.     {
  3.         StringBuilder sb = new StringBuilder();
  4.  
  5.  
  6.         sb.Append("<div id='updiv' style='Font-weight:bold;font-size:11pt;Left:320px;COLOR:black;font-family:verdana;Position:absolute;Top:140px;Text-Align:center;'>&nbsp;</div>");
  7.         sb.Append("<script language='javascript' type='text/javascript'> var up_div=document.getElementById('updiv');up_div.innerText='';</script>");
  8.         sb.Append("<script language='javascript' type='text/javascript'>");
  9.         sb.Append("var dts=0; var dtmax=10;");
  10.         sb.Append("function ShowWait()");
  11.         sb.Append("{");
  12.             sb.Append("var output;");
  13.             sb.Append("output='Please wait while uploading!!!';");
  14.             sb.Append("dts++;");
  15.             sb.Append("if(dts>=dtmax)");
  16.                 sb.Append("dts=1;");
  17.             sb.Append("for(var x=0;x < dts; x++)");
  18.             sb.Append("{");
  19.                 sb.Append("output+='σ';");
  20.             sb.Append("}");
  21.             sb.Append("up_div.innerText=output;");
  22.             sb.Append("up_div.style.color='red';");
  23.         sb.Append("}");
  24.         sb.Append("function StartShowWait()");
  25.         sb.Append("{");
  26.             sb.Append("up_div.style.visibility='visible';");
  27.             sb.Append("ShowWait();");
  28.             sb.Append("window.setInterval('ShowWait()',200);");
  29.         sb.Append("}");
  30.         sb.Append("StartShowWait();");
  31.         sb.Append("</script>");
  32.  
  33.  
  34.         HttpContext.Current.Response.Write(sb.ToString());
  35.         HttpContext.Current.Response.Flush();
  36.     }
i call this on the button click event
it shows a progress bar in IE
but not in FireFOx
In FF it give error message

LENGTH PARAMETER CANT BE LESS THAN ZERO: PARAMETER LENGTH

Please post back a reply soon

Its urgent
Thanx in advance
Oct 23 '08 #1
Share this Question
Share on Google+
1 Reply


acoder
Expert Mod 15k+
P: 16,027
Hi

I've split your post from the thread you posted in since it's a different problem.

Please post your code in code tags. See How to Ask a Question. Thanks.

Repost your code showing JavaScript client-side code, not JSP code. You can do that by viewing the source in your browser.
Oct 23 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.