Javascript fail in other browsers version except Internet Explorer 10

CG Sponsors




mutanic

Super Active Member
Joined
May 24, 2009
Messages
5,537
Reaction score
212
Points
73
Salam sume CGRian,

Minta tlg spot & betulkan aku kat mana salah, aku dah test program aku run kat Internet Explorer 10 jer OK tapi IE6-9, Chrome & Firefox fail(script x jalan), ni aku share code kat sini :

HTML:
<script type="text/javascript">
	//Working in IE 10 but fail in other version including Firefox & Chrome
    $(function GetFile(object) {
        var bBrowseFile = document.getElementById('<%= FileUploadExcel.ClientID %>');
        var bGetWorksheet = document.getElementById('<%= ButtonGetSheetName.ClientID %>');
        var bResult = document.getElementById('<%= LabelUpload.ClientID %>');

        $(bBrowseFile).change(function () {
            if ($(this).val()) {
                $(bGetWorksheet).attr('disabled', false);
				bResult.style.color = "Green";
                bResult.innerHTML = "<BR><B>Selected file is : </B>" + bBrowseFile.value;
            **
            else {
                $(bGetWorksheet).attr('disabled', true);
            **
        **);
    **);
</script>
HTML:
<asp:FileUpload ID="FileUploadExcel" runat="server" Width="400px" onchange="GetFile(this);" />
<asp:Button ID="ButtonGetSheetName" OnClick="GetExcelSheetNames" runat="server" Text="Get Worksheet Name" Width="200" Enabled="False" />
Full source code program ada kat sini~X(~X(~X(
 
Sponsored Post

Poinwan

Fun Poster
Joined
Dec 28, 2018
Messages
113
Reaction score
4
Points
15
Where did you get that code ? I assume you really should have some understanding that it's all about different version of JavaScript for each of those feature really. So I do not understand your surprise about all that. But if you will show us where did you get that we can help you with this.
 

Majind

Junior Member
Joined
Apr 25, 2019
Messages
73
Reaction score
2
Points
11
but honestly who use that old versions of that browser you simply really listed there, can you really think of that matter or not ? I am completely lost with such for example. I do hope to make it all possible anyway. I do hope it will help you.
 

syamsoulcc

Super Active Member
Joined
Apr 30, 2014
Messages
9,292
Reaction score
2,039
Points
141
ni masalah javascript je kan??

cuba tengok di browser console, ada keluar ERROR apa?

p/s: aku tak boleh nk test code tu di computer aku...sbb aku tak biasa dgn ASP.NET.....aku biasa dgn PHP saja
 
Sponsored Post
Top
Log in Register