Solved

MEta Refresh for cross browser

Posted on 2004-08-03
6
500 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
6 Comments
 
LVL 14

Expert Comment

by:ziffgone
ID: 11711885
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
ID: 11711897
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
ID: 11718064
Hello Ziffgone,

I tried what your javascript, but still no output. Still NE is going fast and IE is normal....
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 14

Accepted Solution

by:
ziffgone earned 50 total points
ID: 11720676
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
ID: 11721585
Thanks Ziffgone, it worked
0
 
LVL 14

Expert Comment

by:ziffgone
ID: 11723333
No problem, glad to help. :)

Regards...
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
HTML <font style="color:red"> 9 51
CSS Style Effect 2 18
Use Mid in Html 6 22
How do I Enable submit button only if listbox has items 4 30
Someone recently asked me about how to display a progress indicator on a page while an iframe is loading. And I remember when I first came across this myself. It was a bit tricky to get my head around, but really, it's very simple. The most impor…
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

749 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