2
   

CHAT IN ASP PROBLEM USING IFRAMES REFRESH

 
 
hugo
 
Reply Fri 18 Jun, 2004 10:10 pm
WELL I AM DEVELOPING A CHAT IN ASP AND JAVASCRIPT BUT I NEED TO REFRESH THE IFRAME CONTENTS EACH 5 SECONDS OR 3 SECONDS.PROBLEM IS WHEN I REFRESH FRAMES 1. I GET THE IFRAME CONTENTS BLINKING ON THE SCREEN AND AN CLICK SOUND FROM IE PROBLEM BECAME WORST WHEN I OPEN A PRIVATE EVERY SINGLE IFRAME IS BLINKING DIFERENT TIMES AND CLICK CLICK CLICK NOISE GRRRRRRRR....... Embarrassed Embarrassed SOMEONE I AM REFRESHING IFRAMES DFROM PARENT DOCUMENT WITH THIS FUNCTION


var rpvtrefresh=3000
var rpvtdoc="document.frames['dialogo'].location.href = document.frames['dialogo'].location.href ";
var rpvtdoc2="document.frames['usuarios'].location.href = document.frames['usuarios'].location.href ";

function ViewContent() {

rreload0= setTimeout("ViewContent()",3000)
rreload= setTimeout(rpvtdoc, rpvtrefresh);
rreload2= setTimeout(rpvtdoc2, rpvtrefresh);
}

window.onload=ViewContent

BUT I HA'VE TRIED ALL THIS OTHERS
//var rpvtdoc="document.all.dialogo.src='visualizacion.asp'"
//var rpvtdoc2="document.all.usuarios.scr='activos.asp'"
//var rpvtdoc="parent.frames.dialogo.location.href='visualizacion.asp'"
//var rpvtdoc2="parent.frames.usuarios.location.href='activos.asp'"
//var rpvtdoc="document.frames.dialogo.location.reload()";
//var rpvtdoc2="document.frames.usuarios.location.reload()";
//var rpvtdoc="frames['dialogo'].location.reload(0)";
//var rpvtdoc2="frames['usuarios'].location.reload(0)";
//funcionan pero titilan suenan
//var rpvtdoc="frames['dialogo'].location.href='visualizacion.asp'";
//var rpvtdoc2="frames['usuarios'].location.href='activos.asp'";
//funcionan pero titilan suenan
//var rpvtdoc="frames['dialogo'].scr='visualizacion.asp'";
//var rpvtdoc2="frames['usuarios'].scr='activos.asp'";
//var rpvtdoc2="frames['usuariostop'].location.reload(0)";
//rpvtdoc="document.getElementById('dialogo').src='visualizacion.asp'"
//rpvtdoc2="document.getElementById('usuarios').src='activos.asp'"
//top.document.getElementById('iframename').src =
//document.getElementById('iframename').src =


LET ME KNOW HOW TO QUIET AND SOFT REFRESH MAY I USE ALSO HOW TO GET THE IFRAME CONTENTS SCROLL BAR GOIND DIRECTLY TO THE BOTTOM LINE OF ITS CONTENTS NOT GOING FROM FIRST LINE TO MIDDLE

HELP THIS IS DRIVING ME CRAZZY!!!!!!!!!! Very Happy Very Happy Very Happy
  • Topic Stats
  • Top Replies
  • Link to this Topic
Type: Discussion • Score: 2 • Views: 6,386 • Replies: 2
No top replies

 
Craven de Kere
 
  1  
Reply Fri 18 Jun, 2004 10:22 pm
You can't do it silently as far as I know.

But as to making it go to the bottom have you tried using a page anchor/bookmark and have it load a URL (e.g. thepage.asp#bottom) targeted to the frame instead of refreshing it?
0 Replies
 
DrCool
 
  1  
Reply Sun 8 Aug, 2004 05:38 pm
Refreshing an IFRAME without IE's annoying click sound
Hugo, try this:

function UpdateChat() {
window.frames["ChatIFrame"].document.location.reload();
window.setTimeOut("UpdateChat()", 3000);
}

The secret is the "document.location.reload()" function which will allow it to be refreshed without the annoying IE click sound! Silence is golden. Very Happy

Also, you can make the browser jump to the bottom of your chat IFrame window by doing this. Add a <DIV ID=ScrollHere></DIV> at the bottom of the ChatIFrame html. Then, right after that, add this JavaScript:

<SCRIPT LANGUAGE=JavaScript>
document.getElementById("ScrollHere").scrollTop = 99999;
</SCRIPT>

This will cause the ScrollHere DIV element to be scrolled to the top of the window every time it the ChatIFrame is reloaded by the previous bit of code I gave you. The "99999" refers to the number of pixels to scroll it by. You can add a few more 9's if you want to. You always want that to be longer than the actual height of the ChatIFrame, no matter how long the chat gets.

One more thing: you can fix the flickering by using a hidden IFRAME which will contain your chat updates. Then just use some JavaScript to check for when the hidden IFRAME has new chat content, grab the new content, and dynamically add it into the visible IFRAME html so the user can see it. By using JavaScript to add things dynamically, you won't have the entire visible page being constantly reloaded... the browser will first clear the page (which results in the visible flicker) then wait for the new content to be loaded... during this wait, which can take a second or two, the user is staring at a blank window. But if you put this into a hidden IFRAME, they never see it. Only when the hidden IFRAME is done loading will the visible content be quietly updated so they just see a new line of chat content appear below the existing content.
0 Replies
 
 

Related Topics

Webdevelopment and hosting - Question by harisit2005
Showing an Ico File - Discussion by Brandon9000
how to earn money in internet - Discussion by rizwanaraj
The version 10 bug. Worse then Y2K! - Discussion by Nick Ashley
CSS Border style colors - Question by meesa
There is no Wisdom in Crowds - Discussion by ebrown p
THANK YOU CRAVEN AND NICK!!! - Discussion by dagmaraka
I'm the developer - Discussion by Nick Ashley
 
  1. Forums
  2. » CHAT IN ASP PROBLEM USING IFRAMES REFRESH
Copyright © 2024 MadLab, LLC :: Terms of Service :: Privacy Policy :: Page generated in 0.03 seconds on 05/10/2024 at 11:25:58