Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 11th, 2003, 05:06 PM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 336
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to alyeng2000
Default

thanks planoie for sharing

the idea is still not cleared(smooth refreshing )
did you see the file update.js
i think there is a functions that is stange to me,it's used for updating frames.....

the smooth refresh in previous mentioned site(conqurechat) is the new difference from all simple chat scripts which use traditional <META HTTP-EQUIV='Refresh' CONTENT='10; URL=file.asp'> to refresh page..

all i need is some clear view for that script (i am not so good at jscript)



Ahmed Ali
Software Developer
 
Old November 12th, 2003, 01:30 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

What do you mean when you say "smooth refresh"? The smoothness of a page refresh mostly depends on how the browser renders a page. Changing the way it refreshes isn't going to help. Refresh is refresh. I'll bet if you dug down enough into that code that you'd see there are just meta tag refreshes and javascript refresh calls in it. Nothing more complicated than that.

Peter
------------------------------------------------------
Work smarter, not harder.
 
Old November 13th, 2003, 09:38 PM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 336
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to alyeng2000
Default

thanks planoie for your patience keep replying to me

below is that jscript code (which i think update functions used)

he also call Refresh function as.. executeRequest('action=refresh');




<!--

    var SERVER_CONTROLLER = "control.asp";

    /**
     * Executes a server request by patching the header request in the
     * current document. The parameters specified will be attached to
     * the request.
     *
     */
    function executeRequest(params) {

        var head = document.getElementsByTagName('head').item(0);
        var old = document.getElementById('lastLoadedCmds');
        if (old) head.removeChild(old);

        script = document.createElement('script');

        parameters = new String(params).split(',');

        var scriptUrl = SERVER_CONTROLLER + '?rnd=' + Math.random();
        for (var i = 0; i < parameters.length; i++) {
            scriptUrl += "&" + parameters[i];
        }

        script.src = scriptUrl;
        script.type = 'text/javascript';
        script.defer = true;
        script.id = 'lastLoadedCmds';

        void(head.appendChild(script));

    } // > function executeRequest(...)


    /**
     * Dynamically updates the content of a frame.
     *
     */
    function update(frame, id, html) {

        var doc = eval(frame + '.document');

        if (doc.layers) {
            var l = doc[id];
            l.document.open();
            l.document.write(html);
            l.document.close();
        } else if (doc.all && doc.all[id]) {
            doc.all[id].innerHTML = html;
        } else if (doc.createRange) {
            var l = doc.getElementById(id);
            var r = doc.createRange();
            while (l.hasChildNodes()) {
                l.removeChild(l.lastChild);
            }
            r.setStartAfter(l);
            var docFrag = r.createContextualFragment(html);
            l.appendChild(docFrag);
        }

    } // > function update(...)


    function updateMessages(id, html) {
        update('parent.messages', id, html);
    }


    function updatePrivateMessages(id, html) {
        update('parent.messages', id, html);
    }


    function updateUsers(id, html) {
        update('parent.users', id, html);
        onUsersChanged(undefined);
    }


    function updateRooms(id, html) {
        update('parent.rooms', id, html);
    }


    function onUsersChanged(data) {
        if (typeof data == 'undefined')
            return;

        if ((typeof parent.message != 'undefined') && (typeof parent.message.onUsersChanged != 'undefined'))
            parent.message.onUsersChanged(data);
    }

    function focusMessageArea() {
        if ((typeof parent.message != 'undefined') && (typeof parent.message.frmControl != 'undefined') && (typeof parent.message.frmControl.message != 'undefined')) {
            parent.message.focus();
            parent.message.frmControl.message.focus();
        }
    }

    function scrollToBottom(bottom) {

        var doc = parent.messages.document;
        var wnd = parent.messages;

        var y = doc.height ? doc.height : doc.body.scrollHeight;

//alert(doc.height + ",bottom="+bottom+",y="+y);

        wnd.scrollTo(
            0,
            ((bottom == 'true') ? y : 0)
        );

    } // > function scrollToBottom(...)



Ahmed Ali
Software Developer





Similar Threads
Thread Thread Starter Forum Replies Last Post
Update Scoreboard - ASP cancer10 Classic ASP Databases 1 October 24th, 2006 08:28 AM
jscript to ASP.net bimboypogi ASP.NET 1.0 and 1.1 Professional 1 April 9th, 2005 04:00 PM
ASP UPDATE CLOB mamasagarika Classic ASP Databases 0 December 2nd, 2004 07:14 AM
Passing Session Variables(ASP.NEt) to Jscript ank2go JSP Basics 1 February 26th, 2004 09:53 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.