vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   ajax question (https://vborg.vbsupport.ru/showthread.php?t=219400)

MAORBARI 07-24-2009 11:44 PM

ajax question
 
how i use ajax in vbulletin?
what the function of the request and i use it?
thx for help.

HMBeaty 07-24-2009 11:51 PM

<a href="https://vborg.vbsupport.ru/search.php?searchid=12914337" target="_blank">https://vborg.vbsupport.ru/searc...rchid=12914337</a>

Dismounted 07-25-2009 04:37 AM

Very simple to initiate an AJAX request. vBulletin uses the YUI JavaScript framework.
Code:

YAHOO.util.Connect.asyncRequest('POST', scriptpath + '?do=ajax', {
        success: this.handle_ajax_response,
        failure: this.handle_ajax_error,
        timeout: vB_Default_Timeout,
        scope: this
}, SESSIONURL + 'securitytoken=' + SECURITYTOKEN + '&foo=' + foo);

@Brooks: Links with search IDs won't work after vBulletin cleans up. ;)

IdanB 07-25-2009 06:10 AM

I've posted yesterday tutorial i called "[How-To] AJAX in your Mods - In 5 simple steps" - describing this in a very simple & easy to understand way.
Just follow my sig link and then click "tutorials" section on top tab.

ragtek 07-25-2009 06:38 AM

Quote:

Originally Posted by IdanB (Post 1855046)
I've posted yesterday tutorial i called "[How-To] AJAX in your Mods - In 5 simple steps" - describing this in a very simple & easy to understand way.
Just follow my sig link and then click "tutorials" section on top tab.

Sorry, but your tutorial is not very good.

You shouldn't use the vb ajax handler anymore, instead the developers should use the method yui is providing!
Look at the code, the vb devs have commented it.... ;)

MAORBARI 07-25-2009 09:19 AM

HTML Code:

<script type="text/javascript">
<!--
function iimsg()
{
thisstring = message.value;
YAHOO.util.Connect.asyncRequest('POST', 'savept.php?content=' + thisstring, {
        success: msgstr.handle_ajax_response,
        failure: msgstr.handle_ajax_error,
        timeout: vB_Default_Timeout,
        scope: this
}, SESSIONURL + 'securitytoken=' + SECURITYTOKEN + '&foo=' + foo);
}

function Leaving() {
iimsg();
}
//-->

</script>

why it is dont work?
thx.

Dismounted 07-25-2009 10:38 AM

What are you actually trying to achieve with AJAX?

MAORBARI 07-25-2009 12:34 PM

i try to save the content of the posts that users write when they quit in mistake.
i mean that i do "<body onunload="savept(($editorid}_textarea)">" and i do ajax function..
but this dont work..
i try to add to textarea that his name is "message" action "onkeyup" ad do alert and it is dont work too.
why it is dont work?
thx.

MAORBARI 07-27-2009 04:42 AM

someone?

Dismounted 07-27-2009 06:20 AM

The browser does not initiate any JavaScript events when a user decides to close the page. The browser just closes...


All times are GMT. The time now is 11:39 PM.

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.01136 seconds
  • Memory Usage 1,728KB
  • 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
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete