The tester just found that an error occurred while submitting data in Firefox,
I checked and found that it was a piece of JS Code The difference between IE and Firefox was not taken into account during writing.
In IE, document. aspnetform. Action is not recognized in Firefox.
After checking some JS information, modify the following:
Original code:
VaR Path = Document. aspnetform. Action;
Document. aspnetform. Action = '/' + path;
Code after modification:
VaR theform = Document. Forms ['aspnetform'];
If (navigator. appname = 'netscape ')
{
VaR act = theform. Action;
VaR inde = act. lastindexof ("/");
VaR Leng = act. length;
VaR filename = act. substring (INDE, Leng );
Theform. Action = 'HTTP: // '+ window. Location. Host + filename;
}
Else if (theform ){
Theform = Document. aspnetform;
VaR Path = theform. Action;
Theform. Action = '/' + path;
}
When debugging JS, we found that the substring method in JS differs from the substring method in C #.
JS substring Method
Function substring (START: Number, end: Number): String
Parameters
Start is required. Index Integer starting from 0, indicating the starting position of the substring.
End is required. An Index Integer starting from 0, indicating the end position of the substring.
Start from start and end.
C # substring Method
Function substring (string startindex, string number)
The number of characters starting with startindex.
The following is a reference --------- good things should be noted down!
Sets or obtains the specified file name or path of an object.
<SCRIPT>
Alert (window. Location. pathname)
</SCRIPT>
Set or retrieve the entire URL as a string.
<SCRIPT>
Alert (window. Location. href );
</SCRIPT>
Set or obtain the port number associated with the URL.
<SCRIPT>
Alert (window. Location. Port)
</SCRIPT>
Set or obtain the protocol section of the URL.
<SCRIPT>
Alert (window. Location. Protocol)
</SCRIPT>
Set or obtain the segment following the # In the href attribute.
<SCRIPT>
Alert (window. Location. Hash)
</SCRIPT>
Set or obtain the hostname and port numbers of the location or URL.
<SCRIPT>
Alert (window. Location. HOST)
</SCRIPT>
Set or obtain the Section following the question mark in the href attribute.
<SCRIPT>
Alert (window. Location. Search)
</SCRIPT>