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 9, 2014, 9:56 AM


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

Hi Terry,

The first thing I did was check for errors using firebugs console. I encountered the following:

1) jquery.cookie.js was missing, I'm sure you just forgot to include it, if not then you will need to.

2) the common "$ is not defined" error occurred, this is because you didn't include jquery before you start using it. The very first script you should include should be jquery.

Upon re-running I noticed that the user variable wasn't interpolated by javascript properly. This was because you had some odd escape sequences in your nav bar code in dreammenu.js. You need to remove these backslashes i.e. \' + user + \' should be ' + user + '.

Fix these three issues, then let us know if you have any further issues (provide all relevant code again). There are a tonne of other improvements I could discuss, but I don't think its necessary. I'm also still not certain on how you plan to set that user cookie, your current method probably won't be appropriate, depending.

Regards,

Chris


(This post was edited by Zhris on Aug 9, 2014, 10:04 AM)


Edit Log:
Post edited by Zhris (Enthusiast) on Aug 9, 2014, 9:56 AM
Post edited by Zhris (Enthusiast) on Aug 9, 2014, 9:58 AM
Post edited by Zhris (Enthusiast) on Aug 9, 2014, 9:58 AM
Post edited by Zhris (Enthusiast) on Aug 9, 2014, 10:02 AM
Post edited by Zhris (Enthusiast) on Aug 9, 2014, 10:04 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