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



wickedxter
User

Aug 9, 2014, 8:54 PM


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


Code
<HTML> 
<HEAD>
<TITLE> Cookie Issue </TITLE>
<link type="text/css" rel="stylesheet" href="dreamcodes.css" />
<link type="text/css" rel="stylesheet" href="dreamtooltips.css" />
<script type="text/javascript" src="dreamtooltips.js"></script>
<script type="text/javascript" src="dreamcodes.js"></script>
<script type="text/javascript" src="jquery.min.js"></script>
<script src="http://code.jquery.com/jquery-latest.min.js"></script>
<script src="jquery.cookie.js"></script>
</HEAD>
<BODY>
<div class="dtcodes_main">
<script type="text/javascript" src="dreammenu.js"></script>
<noscript>
Navigation menu requires Javascript to be enabled.
</noscript>

<h1>Script dreammenu.js is the one where I am trying to read and assign user value from cookie</h1>

<script type="text/javascript">
//$.cookie('user', 'Terry', { path:'/', expires:1 });
$(document).ready(function() {

$('#user').text($.cookie('user'));
});
</script>
</div>
</BODY>
</HTML>


this is the index.html page


Code
<a href="" title="" id="user">\'+ user+ \'</a>


this is the new link in the dreammenu.js, i added the id so jquery will update the link text to the cookie.


(This post was edited by wickedxter on Aug 9, 2014, 9:00 PM)


Edit Log:
Post edited by wickedxter (User) on Aug 9, 2014, 9:00 PM


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

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