Hi All,
We have our home page which we have restricted only to IE and we have displayed the same message in our home page.However when it is run on other browsers the home page is getting loaded.
In index.jsp (home page) I have written a browserCheck function ...
function browserCheck(){
//alert("hai");
var browserName = navigator.appName;
if(browserName == 'Microsoft Internet Explorer')
return true;
else{
//alert("in else");
var url=null;
//url = 'browserCheck.action';
var urlData= '<ptms:url value="/browserCheck.action"/>';
//alert(urlData);
processAjax(urlData,
test,false,null);
return false;
}
//return false;
}
this is processAjax function ...
------------------------------------
function processAjax(url, callbackFun, async, args){
var xmlhttp = null;
if (xmlhttp != null && xmlhttp.readyState != 0 && xmlhttp.readyState != 4){
xmlhttp.abort();
return;
}
if (window.XMLHttpRequest){
xmlhttp = new XMLHttpRequest();
}else if (window.ActiveXObject){
try{
xmlhttp = new ActiveXObject('Msxml2.XMLHTTP');
}catch(e){
xmlhttp = new ActiveXObject('Microsoft.XMLHTTP');
}
}
if (xmlhttp != null){
xmlhttp.open('post',url, async);
//xmlhttp.setRequestHeader('Accept','message/x-jl-formresult');
//xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
xmlhttp.onreadystatechange = function(){
if (xmlhttp.readyState == 4){
if (xmlhttp.status == 200){
var data = xmlhttp.responseText;
callbackFun(data,args);
}else{
alert('Problem retrieving data : ' + xmlhttp.statusText);
}
}
}
xmlhttp.send(null);
}else{
alert('Your browser does not support xmlhttp.')
}
}
currently it is displaying the home page rather than returning false...
Ideally I want to direct to a page(browserTest.jsp) saying " please use IE only" (something on these lines) before the page loads.
Due to paucity of time(EOD) I don't think before load prevent would be feasible...... I am thinking of following options..
1) onLoad of homepage in other browsers ,Highlight the message " This ..... to be viewed in IE only" (increase font size etc)
2) put a glamorous dialog box(best popup or some style possible ) saying " please use IE only"
need inputs.thankyou!
Regards,
Pradeep