CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner: Re: [terrykhatri531] How to pass variable value from perl to Javascript: Edit Log



Zhris
Enthusiast

Aug 10, 2014, 4:55 AM


Views: 18598
Re: [terrykhatri531] How to pass variable value from perl to Javascript

Hi Terry,

That isn't going to work.

The first thing you should print is the header. You have attempted to print html / javascript before the header. Also, you are using a redirect header, therefore anything you print after it will be ignored anyway (I think, I have never tried).

I provided an example of creating the cookies using CGI::Cookie, then setting them when you create the redirect header a few posts ago (post #21). Non http only cookies can be shared between Perl and javascript. Try implementing this, post it you get stuck. If this isn't suitable for some reason then you'll have to change your application design i.e. remove the redirect, or set the cookies in index.pl.

Also don't worry about deleting the cookie, when you set the cookie it will create if it doesn't exist or update the existing.

Chris


(This post was edited by Zhris on Aug 10, 2014, 4:58 AM)


Edit Log:
Post edited by Zhris (Enthusiast) on Aug 10, 2014, 4:58 AM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives