vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3 Articles (https://vborg.vbsupport.ru/forumdisplay.php?f=187)
-   -   Intergrating AJAX Technology Into Your Modifications (https://vborg.vbsupport.ru/showthread.php?t=93249)

Akex 09-03-2005 09:44 PM

First, thank you for this tutorial, very helpful.

You forgot to put one key world in your javascript code : handler

So this code :

Code:

function My_AJAX_Reciever()
{
        if (My_AJAX_Object.readyState == 4 && My_AJAX_Object.status == 200 && My_AJAX_Object.responseText)
        {
                alert('Data recieved successfully\n\n' + My_AJAX_Object.responseText)
        }
}

Becomes

Code:

function My_AJAX_Reciever()
{
        if (My_AJAX_Object.handler.readyState == 4 && My_AJAX_Object.handler.status == 200 && My_AJAX_Object.handler.responseText)
        {
                alert('Data recieved successfully\n\n' + My_AJAX_Object.handler.responseText)
        }
}

;)

harmor19 10-02-2005 02:04 AM

I did the code above but it didn't work at first.
I changed the $_POST to $_GET then I passed test.php?do=ajax&pagevar=rrr in the address bar and it worked.
But using $_GET is insecure.

Can someone make a small working example like a simple chat?

Jenta 10-02-2005 02:38 AM

look at vbshout
its like a simple chat

DaFire 12-26-2005 01:46 PM

the missing .handler. should really added to the first posts example ;)

PennylessZ28 12-26-2005 10:47 PM

this was very useful, thanks

DaFire 12-28-2005 06:06 PM

yes ;) it's great start to integrate own ajax things.. I used rico.js but looks like it creates problems with some vb javascript so I change everything to vb-ajax now :)

MP3 06-25-2006 07:33 PM

For the JavaScript written in post 7 by " LiveWire " how can we add auto refresh so every 5 min it will check certain variables in a PHP file if its exist then small popup will shown if no nothing will happen and all of this will happen without the manually refresh.

rogersnm 07-02-2006 01:49 PM

so for the:
PHP Code:

if ($_POST['do'] == 'ajax')
{
    echo 
$_POST['pagevar'];
    exit;


could i change it to:
PHP Code:

if ($_POST['do'] == 'ajax')
{
    echo 
$_POST['$variable'];
    exit;


if $variable is defined in the global_start?

akanevsky 07-02-2006 02:44 PM

Yes.

rogersnm 07-02-2006 02:53 PM

PHP Code:

if ($_POST['do'] == 'ajax')
{
    echo 
$_POST[$i] . '|||';
    echo 
$_POST[$really] . '|||';
    echo 
$_POST[$suck] . '|||';
    exit;


So once i have done that can i just put $suck in a template and it will automatically refresh when the user clicks a link?

What should i use for onclick?: eg <a href='#' onclick='return Who knows'>Refresh</a>

DOES ANYONE HAVE A WORKING EXAMPLE OF THIS?


All times are GMT. The time now is 06:53 PM.

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

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01399 seconds
  • Memory Usage 1,733KB
  • 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
  • (2)bbcode_code_printable
  • (3)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)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