vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   [Discuss] Developers use of AJAX Technology (https://vborg.vbsupport.ru/showthread.php?t=81677)

Zero Tolerance 05-19-2005 05:27 PM

I guess a 1 minute time out for the data reload wouldn't be too harsh, aslong as the page requested minimal queries, like the session, other requirements and then the data itself.

Depends really how active your site is, a site with 100+ users on most of the time would really need to put the time out higher, say 3/4 minutes, but the content would still remain intact.

But things like getting last x posts would only take 1 query, you could even use the XML output as a feed for your main site :)

- Zero Tolerance

Guy G 05-20-2005 06:14 AM

Great tutorial... For anyone that has no idea on what it is and such just check your Gmail account... Gmail is based on AJAX.

Corriewf 05-20-2005 12:27 PM

Quote:

Originally Posted by Zero Tolerance
I guess a 1 minute time out for the data reload wouldn't be too harsh, aslong as the page requested minimal queries, like the session, other requirements and then the data itself.

Depends really how active your site is, a site with 100+ users on most of the time would really need to put the time out higher, say 3/4 minutes, but the content would still remain intact.

But things like getting last x posts would only take 1 query, you could even use the XML output as a feed for your main site :)

- Zero Tolerance


ZT your the king of refreshing hacks...... I know you could do this.

Have it in the admin control panel where the admin could have it refresh everything and then at what rate (time) OR could just have it refresh certain aspects at inputted rate.

You know how much this would save bandwidth and site speed wise? Members wouldnt have to refresh ( which would be calling everything) just to get up to date info on just post or ect.

Yeah, im likeing this AJAX now.

untold4you 05-24-2005 05:45 AM

Check this one out, http://blog.joshuaeichorn.com/archiv...d-with-jpspan/

Quote:

JPSpan provides a lot more functionality then SAJAX, the biggest difference you notice on the javascript side of thing is that you have mapped objects, on the php side the biggest difference is that you have a server page and a client page.
And another nice tutorial: http://www.webpasties.com/xmlHttpRequest/

Found out what the readyState codes are:
Code:

readyState Status Codes:
        0 = uninitialized
        1 = loading
        2 = loaded
        3 = interactive
        4 = complete


DaveAK 01-01-2006 07:25 PM

This may seem like an obvious question, but I'm trying to clear this up in my mind.

Scenario : Client A sends data to server. Server applies rules checking to data. Client B requests the data from Client A from the server.

OK, so if I get this right Client B "polls" the server for new data, which is similar to refreshing, but the big difference is that only the data is refreshed, not the whole page. Client side scripting takes care of rendering the page with the new data.

So if I'm right, you have to set your script up with a timer that checks the server for new data on a regular basis, i.e. it's not "event" based with the server triggering a client side function.

Did I get this right or have I just talked in circles? :)

So you have to set your timers to a realistic "refresh rate" depending on the size of data/server load these AJAX requests trigger. How is the best way to determine this refresh rate?

DaveAK 01-08-2006 03:38 AM

Anybody? :)

mrpaint 10-26-2006 11:39 AM

HTML Code:

function doTheTask() {
        do_box = new vB_AJAX_Handler(true)
        do_box.onreadystatechange(do_box_Done)
        do_box.send('url','&var1=1&var2=2')
                               
        do_button = new vB_AJAX_Handler(true)
        do_button.onreadystatechange(do_button_Done)
        do_button.send('url')                                                       
}                       
function do_box_Done() {
        if (do_box.handler.readyState == 4 && do_box.handler.status == 200) {
                ....
        }       
}
function do_button_Done() {
        if (do_button.handler.readyState == 4 && do_button.handler.status == 200) {
                ....
        }                       
}

I added this script but I have got this error message:
Quote:

Error: do_box is not defined
Line: if (do_box.handler.readyState == 4 && do_box.handler.status == 200) {
And this one
Quote:

Error: do_button is not defined
Line: if (do_button.handler.readyState == 4 && do_button.handler.status == 200) {
Anybody help me?

Wild-Wing 11-06-2006 11:57 AM

its just now i understand part of it thanks to Zero Tolerance's tutorial

mokujin 07-22-2008 06:38 PM

Does anyone can make some very simple demo script? I think that's better for beginners :)
Thank you so much

Marco van Herwaarden 07-23-2008 07:15 AM

There are plenty of examples around in both the Articles section and in existing modifications.


All times are GMT. The time now is 09:02 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01182 seconds
  • Memory Usage 1,741KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (1)bbcode_html_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete