www.webdeveloper.com
Results 1 to 4 of 4

Thread: Passing variables (from callback) from one page to another with JQuery/Javascript?

  1. #1
    Join Date
    Dec 2013
    Posts
    8

    Passing variables (from callback) from one page to another with JQuery/Javascript?

    Hi,
    I want to make use of the API of oneall.com (http://docs.oneall.com/api/), with a social media plugin. After the login i want to route the user to the next page, and normally you should verify that with the connection_token (catched from the first page with the social login). On http://docs.oneall.com/services/impl.../social-login/ there is an example how to handle this with PHP.

    PHP Code:
    <?php
     
    //Check if we have received a connection_token
    [B]if ( ! empty ($_POST['connection_token']))[/B]
    {
      
    //Get connection_token
      
    $token $_POST['connection_token'];
    How can we do "if ( ! empty ($_POST['connection_token']))" in javascript/Jquery? Is that technically possible? I dont make use of PHP, thats the reason..

    Thanks a lot in advance.

  2. #2
    Join Date
    Mar 2007
    Location
    localhost
    Posts
    2,346
    Instead of using a $_POST variable, set a session variable and please post this in the PHP forum as this is not a JavaScript question.

    Ta.
    Yes, I know I'm about as subtle as being hit by a bus..(\\.\ Aug08)
    Yep... I say it like I see it, even if it is like a baseball bat in the nutz... (\\.\ Aug08)
    I want to leave this world the same way I came into it, Screaming, Incontinent & No memory!
    I laughed that hard I burst my colostomy bag... (\\.\ May03)
    Life for some is like a car accident... Mine is like a motorway pile up...

    Problems with Vista? :: Getting Cryptic wid it. :: The 'C' word! :: Whois?

  3. #3
    Join Date
    Dec 2013
    Posts
    8
    Any other suggestions? I dont want to do this in PHP. I want to handle this with Jquery/Javascript/Ajax. Is there any possibility to do this?

  4. #4
    Join Date
    Mar 2007
    Location
    localhost
    Posts
    2,346
    Yes, use a form and GET rather than POST, you will need to URL encode the data and decode it between pages.

    You will have an issue over security as you will be exposing information to casual viewers who seek out exploitable sites.
    Yes, I know I'm about as subtle as being hit by a bus..(\\.\ Aug08)
    Yep... I say it like I see it, even if it is like a baseball bat in the nutz... (\\.\ Aug08)
    I want to leave this world the same way I came into it, Screaming, Incontinent & No memory!
    I laughed that hard I burst my colostomy bag... (\\.\ May03)
    Life for some is like a car accident... Mine is like a motorway pile up...

    Problems with Vista? :: Getting Cryptic wid it. :: The 'C' word! :: Whois?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles