Solved

MEta Refresh for cross browser

Posted on 2004-08-03
6
479 Views
Last Modified: 2008-03-06
I hv this meta tag and the refresh rate I have to take from Servlet and refresh it.  Right now from my servlet I'm getting value of 50 which are in seconds, but seems like this is refreshing every 50 micro seconds NS but working fine in IE

<meta http-equiv="refresh" content="<%=interval%>;url=http://localhost:8080/MSquaredWeb/resource/right_live.jsp">

how to reslove this ??

Thx,
0
Comment
Question by:princehyderabad
  • 4
  • 2
6 Comments
 
LVL 14

Expert Comment

by:ziffgone
Comment Utility
Try this in your ASP, although I'm not too familiar with ASP yet, so I may be way off.

Code:
<%
Set objBCap = Server.CreateObject("MSWC.BrowserType")
If objBCap.Browser = "IE" Then
      dim interval = 50
ElseIf objBCap.Browser = "Netscape" Then
      dim interval = 50000
End If
%>

Hope this helps. :)

Regards...
0
 
LVL 14

Expert Comment

by:ziffgone
Comment Utility
Or a javascript version:

<script type="text/javascript">
if(navigator.appName.substr(0,4) =="Micro"){
   document.write('<meta http-equiv="refresh" content="<%=interval%>;url=http://localhost:8080/MSquaredWeb/resource/right_live.jsp">');
}
else{
   document.write('<meta http-equiv="refresh" content="'+<%=interval%>*1000+';url=http://localhost:8080/MSquaredWeb/resource/right_live.jsp">');
}
</script>

Regards...
0
 

Author Comment

by:princehyderabad
Comment Utility
Hello Ziffgone,

I tried what your javascript, but still no output. Still NE is going fast and IE is normal....
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 14

Accepted Solution

by:
ziffgone earned 50 total points
Comment Utility
Are you simply refreshing right_live.jsp with this META refresh? If so, try this:

<script type="text/javascript">
function refreshIt(){
     window.location.href = self.location.href;
}
var interval = <%=interval%>*1000;
setTimeout('refreshIt()',interval);
</script>

If not simply refreshing, but redirecting:

<script type="text/javascript">
function refreshIt(){
     window.location.href = "http://localhost:8080/MSquaredWeb/resource/right_live.jsp";
}
var interval = <%=interval%>*1000;
setTimeout('refreshIt()',interval);
</script>

Hope that helps.

Regards...
0
 

Author Comment

by:princehyderabad
Comment Utility
Thanks Ziffgone, it worked
0
 
LVL 14

Expert Comment

by:ziffgone
Comment Utility
No problem, glad to help. :)

Regards...
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Do you want to insert HTML5 video into your site? This is the tutorial how to do so. What are the main advantages of HTML5 video? 1) Have good compression, good image quality, and low decode processor use. 2) It is royalty-free 3) It is easi…
Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now