vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   How to access PHP files without opening a new browser window? (https://vborg.vbsupport.ru/showthread.php?t=285805)

claudiuhks 07-21-2012 03:54 PM

How to access PHP files without opening a new browser window?
 
1 Attachment(s)
I want to access a PHP file with a few parameters, for example ?username=1&postid=2&type=3 but I don't want a new window to being opened.

And I want also to know how to auto update a number in the forum when a image, link is being clicked.

The attached file is opening a new browser window and I do not want this.
I want to change the HTML code, the green one which shows the number of reputation ( { vb : raw post.special_reputation } ) using Java Script when plus or minus button is clicked.

Thanks in advance.

kh99 07-21-2012 06:05 PM

I'm not really an expert on javascript, but: what you want to do is take the url out of the href tag, so that clicking the link doesn't take you away from the page. Then in your "onclick" handler you need to call a js function that makes an "ajax" call. when you get a successful reply, in your callback function you can find find the document element that represents the number and change it's innerHTML property. Since I only know the basics and there are plenty examples of ajax calls out there, it's probably better to do a search to find one (or maybe someone else will post one).

claudiuhks 07-21-2012 09:33 PM

I don't know how to call an Ajax function.
I need someone to explain me how to edit the HREF line or the ONCLICK line to stop opening a new window but PHP file to be executed successfuly.

Lynne 07-22-2012 01:46 AM

I don't think it is something that can be explained. You will need to go read up on how to make an ajax function and call. I think there are some articles here about it, in the articles forum, or do a google search for a tutorial on ajax calls.

Simon Lloyd 07-22-2012 02:12 AM

Try this http://www.w3schools.com/jquery/ajax_ajax.asp and there's much more on that site to learn about ajax and JS, or this site http://net.tutsplus.com/tutorials/ja...s-with-jquery/

claudiuhks 07-22-2012 05:26 PM

Thank you so much all, but you forgot to say that I need jquery.js file!


All times are GMT. The time now is 08:31 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.01061 seconds
  • Memory Usage 1,718KB
  • 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)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)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