Click here to Skip to main content
15,065,044 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All

i am working with Asp.net web application in this it is giving some problems. those are with visual appearance and JavaScript.

The problems are in the IE7: i am using the menu control in the application but when i browse in the IE7 the menus are not supporting that

means the menus are not visible.

problem with Firefox browser is : when i am clicking on the Textbox/DropDownList we have to populate an confirmbox which shows an

message that "you want to change the values?"

then when we click on the ok button it will opens the drop down or allow to write text in that Text box in IE and chrome but not in FireFox

the JavaScript is as follows

function ChangeMgr(id) {

            if (!confirm("Do You want to change security level?"))

                document.getElementById(id).blur();

        }

and the dropdown tag is as follows

<asp:DropDownList ID="ddlSecurityLevel" runat="server" OnSelectedIndexChanged="ddlSecurityLevel_SelectedIndexChanged"

                                        onfocus="ChangeMgr(id)">

     <asp:ListItem Selected="True">Preparer</asp:ListItem>
     <asp:ListItem>Office Manager</asp:ListItem>
     <asp:ListItem>Owner/Franchisor</asp:ListItem>
</asp:DropDownList>


and the Textbox tag is

<asp:TextBox onfocus="ChangeMgr(id)" ID="txtMangerUserName" runat="server" OnTextChanged="txtMangerUserName_TextChanged"></asp:TextBox>


the above ChangeMgrId JavaScript is works fine in IE and Chrome but not in Firefox


these are the browser compatibility issues please check it and try to resolve these issues or if you find any links for this please send post it

The main Requirement is browser compatibility

how to make an application support all browsers types and versions for the CSS and JavaScript

Thanks to all in advance

Thanks And Regards
V.S.R.Krishna
Posted
Updated 26-Apr-10 5:49am
v2

Hi,

1. For cross browser compatibility, you need to identify which browser client is using. These browser (name and version) can be identified by javascript. Please find the below link which shows how using javascript you can identify which browser it is.

[http://www.quirksmode.org/js/detect.html]

2. Once you detect the browser, then you need to write appropriate code to get your code working in that browser.

In your "ChangeMgr" function, I guess the line " document.getElementById(id).blur();" is not working as expected.(yes as I dont have mozila and hence could not actually verify that indeed ).

You might need to change the logic as following way

var browserName = GetBrowserName();
function ChangeMgr()
{
    if(browserName=="Internet Explorer")
    {
       //current code block here that you have seen working nicely in IE.
    }
    else
    {
       //write new code block to get that working in firefox
    }
}


Hope it helps you,
:thumbsup:
   
Comments
V.SivaRamaKriShnaRaju 4-May-10 1:24am
   
it is good idea but i don't what is the code similar to ChangeMgr in the mozilla firefox please help me how to write the above code in mozilla
it is good idea but i don't what is the code similar to ChangeMgr in the mozilla firefox please help me how to write the above code in mozilla
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900