can scroll method be replaced with server pages?!

T

tanya.wang

Hi all,

I have a small piece of javascript that scrolls/moves a table from
bottom to the top and indicates how many unchecked messages a user
has. It's basically loaded on the top of every page when a user logs
in. The Classic ASP will calculate how many unchecked msgs it is and
pass it to javascript for client display. A user can decide if he
wants to receive notice or not by clicking a button (and trigger
ClosePopup()).
Basically the coding is something like this -

//here is index.asp
<frameset rows="0,*" frameborder="no" border="0" framespacing="0">
<frame src="load.asp" name="temp" scrolling="NO" noresize
frameborder="NO" marginwidth="0" marginheight="0">
<frame src="main.asp" name="main" scrolling="AUTO" noresize
frameborder="NO" marginwidth="0" marginheight="0">
</frameset>

//here is javascript - being called everytime a page is loaded
<script language="javascript">
var ThePop = document.getElementById("MsgPop").style;
var divHeight = parseInt(ThePop.height);
var divWidth = parseInt(ThePop.width);

function OpenPopup(x){
ThePop.pixelTop = parseInt(document.body.scrollTop) + docHeight + 10;
ThePop.pixelLeft = parseInt(document.body.scrollLeft) + docWidth -
divWidth - 20;
note.innerHTML="You got <font class='r_9_b'>" + x + "</font> new
msg!";
ThePop.visibility = "visible";
Timer = setInterval("movePopup()",10);
}

function movePopup(){
if (ThePop.pixelTop > (docHeight - divHeight +
parseInt(document.body.scrollTop)))
ThePop.pixelTop-=2;
else
clearInterval(Timer);
}

function ClosePopup(){
parent.temp.location.href="MsgConfirm.asp"
ThePop.visibility = "hidden";
}
</script>

//here is asp - being called everytime a page is loaded
<% 'do some calculation first %>
<% if UnreadMsg >0 then
<script language="javascript">
parent.main.OpenPopup(<%= UnreadMsg %>);
</script>
<% end if %>


However this piece is very buggy. The OpenPopup was never triggered
because "object doesn't support this property or method." The
ClosePopup is buggy because it says "parent.temp is null or not an
object". So I come up with some solution:

1. Use server side pages (asp) to replace the whole system.
- But can we replace the ScrollTop/ScrollLeft with any server side
technologies?
2. Use Component to display the unchecked message.
- But can a COM be used in a environment that combines the client
script and server pages and "scroll/move content to whatever place we
like on the web page"? I would think of this technique is being used
for application EXE.

3. Fix it - but what can I do if a user turned off his javascript
support in brwoser?

I have been very desperate in this area because it has bugged me for
months. I have tried to Totally no clues here. Any suggestion and
solution to #1 and #2?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,982
Messages
2,570,190
Members
46,736
Latest member
zacharyharris

Latest Threads

Top