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, 4:43 AM


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

Write a standalone .html that represents this problem and post the code here (attach any relevant .js). Use a javascript debugger such as firefox firebug to check for javascript errors. If there are errors, then its possible the menu won't get written.

E.g.:


Code
<html> 
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script type="text/javascript" src="http://cdn.jsdelivr.net/jquery.cookie/1.4.1/jquery.cookie.js"></script>
<script type="text/javascript">
$.cookie('user', 'terry', { expires: 7, path: '/' });
</script>
<script type="text/javascript">
var user = $.cookie('user');

document.writeln('<div class="dc-rnav"><a href="javascript:history.go(-1)" title="Go Back">Go Back</a> | <a href="login.pl" title="This will log you out">Log out</a> | <a href="" title="" >' + user + '</a></div>');
</script>
</head>
<body>
</body>
</html>


Chris


(This post was edited by Zhris on Aug 9, 2014, 5:06 AM)


Edit Log:
Post edited by Zhris (Enthusiast) on Aug 9, 2014, 4:44 AM
Post edited by Zhris (Enthusiast) on Aug 9, 2014, 4:44 AM
Post edited by Zhris (Enthusiast) on Aug 9, 2014, 4:48 AM
Post edited by Zhris (Enthusiast) on Aug 9, 2014, 4:49 AM
Post edited by Zhris (Enthusiast) on Aug 9, 2014, 5:06 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