[jQuery] Cookie
Hello, I am using JPlayer plugin with 2 buttons. Play and Stop. $(#jquery_jplayer).jPlayer({ ready: function () { $(this).setFile('http://mydomain.com/mymusic.mp3').play(); demoInstanceInfo($(this), $(#jplayer_info)); } }) .jPlayerId(play, play) .jPlayerId(stop, stop) }); I would like to: 1) Play the music on start if: There is no cookie JPlayer OR if there is a Cookie JPlayer with value true; 2) Change the value of JPlayer cookie to false if the button stop is pressed. If there is no cookie JPlayer then create one. 3) Change the value of JPlayer cookie to true if the button play is pressed. If there is no cookie JPlayer then create one. Basically I am trying to memorize the sound setting across pages. Thanks, Miguel
[jQuery] Cookie in JQuery. Create, Update and Get
Hello, I need to add a cookie with value true or false. If the cookie does not exist then created. Otherwise change its value to the new value. Later I need to get the cookie value. Can I do this with JQuery? Do I need a plugin? Which one? Thank You, Miguel
Re: [jQuery] Cookie in JQuery. Create, Update and Get
See http://plugins.jquery.com/project/cookie - Richard On Tue, Dec 1, 2009 at 9:55 PM, shapper mdmo...@gmail.com wrote: Hello, I need to add a cookie with value true or false. If the cookie does not exist then created. Otherwise change its value to the new value. Later I need to get the cookie value. Can I do this with JQuery? Do I need a plugin? Which one? Thank You, Miguel
[jQuery] jQuery cookie solution in Liferay
I am unsure of where to start with this one, and so I'm hoping one of you good people will be able to assist. I am using Liferay, and on the calendar settings there is a value called event-selector. At present when you click to view events, the default is always the top value All Events. What I am trying to achieve is that a cookie will remember the last choice that you selected for the next 30 days (for example). I have limited jQuery skills, but wonderful google skills, which led me to this place!! I'm hoping that somebody will be able to help, or at least point me in the right direction. Thanks! This is the code I grabbed from Firebug: div class=event-selector select onchange=location.href = 'http://localhost:8080/web/guest/ calendar? p_p_id=8p_p_lifecycle=0p_p_state=maximizedp_p_mode=view_8_struts_action= %2Fcalendar %2Fview_8_tabs1=week_8_month=9_8_day=17_8_year=2009_8_eventType=' + this.value; option value=All Events/option option value=anniversaryAnniversary/option option value=appointmentAppointment/option option value=bill-paymentBill Payment/option option value=birthdayBirthday/option option value=breakfastBreakfast/option option value=callCall/option option value=chatChat/option option value=classClass/option option value=club-eventClub Event/option option value=concertConcert/option option value=dinnerDinner/option option value=eventEvent/option option value=graduationGraduation/option option value=happy-hourHappy Hour/option option value=holidayHoliday/option option value=interviewInterview/option option value=lunchLunch/option option value=meetingMeeting/option option value=movieMovie/option option value=net-eventNet Event/option option value=otherOther/option option value=partyParty/option option value=performancePerformance/option option value=press-releasePress Release/option option value=reunionReunion/option option value=sports-eventSports Event/option option value=trainingTraining/option option value=travelTravel/option option value=tv-showTV Show/option option value=vacationVacation/option option value=weddingWedding/option
[jQuery] Looking for assistance implementing jQuery Cookie into Sliding Panel WordPress Plugin.
Hi folks, I'm new to this list and I hope I can find someone to assist. I am using the Sliding Panel WordPress plugin by Justin Tadlock, found here: http://wordpress.org/extend/plugins/sliding-panel Through Justin's forums, he helped me to implement a feature of this plugin where after a user logs in, the sliding panel remains open so the user sees whatever content is underneath. The problem I am experiencing is that when a user closes this panel, and then hits another page on the site, the panel pops open again. I am trying to limit this open panel effect to only happen once, right after the user logs in. I have a lead that maybe the jQuery Cookie plugin could help, but I have absolutely no experience with jQuery. I wonder if anyone here would be interested in having a look at this and if there is a solution? The code used in the plugin is: var $j = jQuery.noConflict(); $j(document).ready( function() { $j ( '#sliding-panel .toggle a.open' ).show(); $j ( '.loggedin #sliding-panel .toggle a.open' ).hide (); $j ( '#sliding-panel .toggle a.close' ).hide(); $j ( '.loggedin #sliding-panel .toggle a.close' ).show (); $j ( '#sliding-panel .open' ).click( function() { $j ( '#sliding- panel .panel' ).slideDown( 'slow' ); $j ( '#sliding-panel .tab' ).addClass ( 'current' ); } ); $j ( '#sliding-panel .close' ).click( function() { $j ( '#sliding-panel .panel' ).slideUp ( 'slow' ); $j ( '#sliding- panel .tab' ).removeClass( 'current' ); } ); $j ( '#sliding-panel .toggle a.close' ).click( function () { $j ( '#sliding-panel .toggle a.close' ).hide(); $j ( '#sliding-panel .toggle a.open' ).show(); } ); $j ( '#sliding-panel .toggle a.open' ).click( function () { $j ( '#sliding-panel .toggle a.open' ).hide(); $j ( '#sliding-panel .toggle a.close' ).show(); } ); } );
[jQuery] jquery cookie text resizer
Hello all, I'm doing a text resizer with a cookie to remember the font size level. I'm running into a little problem and was wondering if someone sees something obvious I'm missing. The cookie is being set/read OK and the text resizer works when triggered manually, but it's not being executed on page load when you navigate to other pages. For example, on the home page, I set it to the largest size, size 3. This gets set to the cookie. If you quit/relaunch the browser, the cookie still reports size 3. Also, when you navigate to another page, onload, it reads the size 3 and it passes it to the textResize() function (these are my console.log() lines), but the text isn't actually resized on page load. If you trigger the text resizer manually, it works. I'm controlling the font size by adding (or removing) a class to the body tag. Anyone have any ideas why the text isn't resizing automatically onload? //START text resizer //on dom ready either set default cookie or read existing cookie $(function() { //if no cookie, set cookie for default textsize of 1 (out of 3 possible sizes) //persist cookie for 365 days, 1 year if (!$.cookie(textsize)){ $.cookie(textsize, 1, { path: '/', expires: 365 }); } //get cookie value and pass to textResize function var cookie_val = $.cookie(textsize); console.log(onload: + cookie_val); textResize(cookie_val); }); function textResize(level){ var body = $(body); console.log(textResize: + level); switch(level) { case 1: body.removeClass('bigText biggerText'); $.cookie(textsize, 1, { path: '/', expires: 365 }); break; case 2: body.removeClass('biggerText').addClass('bigText'); $.cookie(textsize, 2, { path: '/', expires: 365 }); break; case 3: body.addClass('biggerText'); $.cookie(textsize, 3, { path: '/', expires: 365 }); break; } } //END text resizer
[jQuery] Re: jquery cookie text resizer
That was it! And it makes total sense - thanks much for the extra set of eyes, you rock! On Jul 23, 5:22 pm, James james.gp@gmail.com wrote: Inside the textResize() function, on the first line try adding: level = parseInt(level); I'm thinking when you're manually calling textResize, you're doing something like: textResize(3); But when you're doing it through the cookie, it's not an Integer, it's a String: textResize(3); Your switch statement is testing for Integers, so 3 doesn't match anything. And you don't have a default condition either to act on it, so it does nothing. On Jul 23, 1:07 pm, Magnificent imightbewrongbutidontthin...@gmail.com wrote: Hello all, I'm doing a text resizer with a cookie to remember the font size level. I'm running into a little problem and was wondering if someone sees something obvious I'm missing. The cookie is being set/read OK and the text resizer works when triggered manually, but it's not being executed on page load when you navigate to other pages. For example, on the home page, I set it to the largest size, size 3. This gets set to the cookie. If you quit/relaunch the browser, the cookie still reports size 3. Also, when you navigate to another page, onload, it reads the size 3 and it passes it to the textResize() function (these are my console.log() lines), but the text isn't actually resized on page load. If you trigger the text resizer manually, it works. I'm controlling the font size by adding (or removing) a class to the body tag. Anyone have any ideas why the text isn't resizing automatically onload? //START text resizer //on dom ready either set default cookie or read existing cookie $(function() { //if no cookie, set cookie for default textsize of 1 (out of 3 possible sizes) //persist cookie for 365 days, 1 year if (!$.cookie(textsize)){ $.cookie(textsize, 1, { path: '/', expires: 365 }); } //get cookie value and pass to textResize function var cookie_val = $.cookie(textsize); console.log(onload: + cookie_val); textResize(cookie_val); }); function textResize(level){ var body = $(body); console.log(textResize: + level); switch(level) { case 1: body.removeClass('bigText biggerText'); $.cookie(textsize, 1, { path: '/', expires: 365 }); break; case 2: body.removeClass('biggerText').addClass('bigText'); $.cookie(textsize, 2, { path: '/', expires: 365 }); break; case 3: body.addClass('biggerText'); $.cookie(textsize, 3, { path: '/', expires: 365 }); break; }} //END text resizer
[jQuery] Re: jquery cookie text resizer
Inside the textResize() function, on the first line try adding: level = parseInt(level); I'm thinking when you're manually calling textResize, you're doing something like: textResize(3); But when you're doing it through the cookie, it's not an Integer, it's a String: textResize(3); Your switch statement is testing for Integers, so 3 doesn't match anything. And you don't have a default condition either to act on it, so it does nothing. On Jul 23, 1:07 pm, Magnificent imightbewrongbutidontthin...@gmail.com wrote: Hello all, I'm doing a text resizer with a cookie to remember the font size level. I'm running into a little problem and was wondering if someone sees something obvious I'm missing. The cookie is being set/read OK and the text resizer works when triggered manually, but it's not being executed on page load when you navigate to other pages. For example, on the home page, I set it to the largest size, size 3. This gets set to the cookie. If you quit/relaunch the browser, the cookie still reports size 3. Also, when you navigate to another page, onload, it reads the size 3 and it passes it to the textResize() function (these are my console.log() lines), but the text isn't actually resized on page load. If you trigger the text resizer manually, it works. I'm controlling the font size by adding (or removing) a class to the body tag. Anyone have any ideas why the text isn't resizing automatically onload? //START text resizer //on dom ready either set default cookie or read existing cookie $(function() { //if no cookie, set cookie for default textsize of 1 (out of 3 possible sizes) //persist cookie for 365 days, 1 year if (!$.cookie(textsize)){ $.cookie(textsize, 1, { path: '/', expires: 365 }); } //get cookie value and pass to textResize function var cookie_val = $.cookie(textsize); console.log(onload: + cookie_val); textResize(cookie_val); }); function textResize(level){ var body = $(body); console.log(textResize: + level); switch(level) { case 1: body.removeClass('bigText biggerText'); $.cookie(textsize, 1, { path: '/', expires: 365 }); break; case 2: body.removeClass('biggerText').addClass('bigText'); $.cookie(textsize, 2, { path: '/', expires: 365 }); break; case 3: body.addClass('biggerText'); $.cookie(textsize, 3, { path: '/', expires: 365 }); break; }} //END text resizer
[jQuery] jquery cookie plugin
Hello This function works with the jquery cookie plugin (http://plugins.jquery.com/project/cookie) and code from here (http://www.komodomedia.com/blog/2008/07/using-jquery-to-save-form-details/) script type=text/javascript $(document).ready(function(){ remember('[name=field_name]'); }); /script It remembers the input field name field_name. Does anyone know the correct way to add additonal input fields to the remember function? Many Thanks -- View this message in context: http://www.nabble.com/jquery-cookie-plugin-tp24163193s27240p24163193.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] jQuery Cookie Plugin
Hey guys, I'm working on a project where I am using the jquery plugin that Klaus made. The cookie works very well with the exception that when the user closes the browser the cookie expires. I've been trying to figure out how I can set the var for expiry so that this doesn't happen but I am at a loss. Any advice?
[jQuery] Re: jQuery Cookie Plugin
Did you try $.cookie('the_cookie', 'the_value', { expires: 7 }); // expires after 7 days ? The expires option will also accept a Date object. --Klaus On 8 Jun., 20:27, Richard Walsh deviantstu...@me.com wrote: Hey guys, I'm working on a project where I am using the jquery plugin that Klaus made. The cookie works very well with the exception that when the user closes the browser the cookie expires. I've been trying to figure out how I can set the var for expiry so that this doesn't happen but I am at a loss. Any advice?
[jQuery] Cookie 'current' state question for horizontal menu with drop downs
I searched and found this thread... http://groups.google.com/group/jquery-en/browse_thread/thread/f118475a14a5245a/e60e972d364f11d0?lnk=gst which is very helpful for list based menus with a need for a current state. But I have a similar request that I hope to solve with your help. I have a horizontal Nav with drop downs only on a few items in the main nav. I don't want the drop downs to stay persistant on screen with a 'current' state rather I would like to have the parent (main nav) to be 'down' if the child's pages are selected and also of course the parent to be 'down' if on that page. I am using a slightly visually modified version of this: http://be.twixt.us/jquery/suckerFish.php Can you guys help me please? BTW - This is my first post - so thanks in advance!
[jQuery] Cookie problem in Safari 3.1.1
Dear folks, My system is working with AJax and I need to save some of my data with Cookies as you all know I have to handle this with javascript cookie and Server Cookie both when I call the AJAX I change the Value of the Cookie then when the AJAX loads the Server PHP file it recognizes the Cookie and it accepts the change .. I don't have ant Problem in IE7 and FF and netscape but I do have Problem with Safari ... Safari would not Recognize the Change by Javascript unless I refresh the Page ... when REfresh the page everything is allright but ... this is not what I want . Please help me on this... I think I am Clear Thanks Pedram
[jQuery] Cookie issue - path?
I have a draggable menu which remembers its position using a cookie. I want to use this menu all over my site and just use the 1 cookie to read from. It works at first if I drag the menu on the main page and go to a subpage but when I move it on the subpage it appears a new cookie is made with a new path. However I am only using the code below: script type=\text/javascript\ $().ready(function() { $('#sidebar').draggable({ handle: 'div#logo', opacity: 0.8, zIndex: 50, stop: function() { var y = $('#sidebar').css('top'); var x = $('#sidebar').css('left'); jQuery.cookie('menu_position', x+','+y, 20, { expires: 7, path: '/', domain: 'intrellia.com', secure: true }); } }); var pos = jQuery.cookie('menu_position').split(','); $('#sidebar').css({ position: 'absolute', top:pos[1], left:pos[0] }); }); /script What am I missing? Thanks!
[jQuery] Cookie issue - path?
I have a draggable menu which remembers its position using a cookie. I want to use this menu all over my site and just use the 1 cookie to read from. It works at first if I drag the menu on the main page and go to a subpage but when I move it on the subpage it appears a new cookie is made with a new path. However I am only using the code below: script type=\text/javascript\ $().ready(function() { $('#sidebar').draggable({ handle: 'div#logo', opacity: 0.8, zIndex: 50, stop: function() { var y = $('#sidebar').css('top'); var x = $('#sidebar').css('left'); jQuery.cookie('menu_position', x+','+y, 20, { expires: 7, path: '/', domain: 'intrellia.com', secure: true }); } }); var pos = jQuery.cookie('menu_position').split(','); $('#sidebar').css({ position: 'absolute', top:pos[1], left:pos[0] }); }); /script What am I missing? Thanks! -- View this message in context: http://www.nabble.com/Cookie-issue---path--tp14456821s27240p14456821.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: Problem in delete cookie with jQuery Cookie plugin
Yes Klaus, The code is ok, but the cookie isn´t deleting, and I don´t know why? I have tried in FF and IE 6 Regards On Dec 4, 8:16 am, Klaus Hartl [EMAIL PROTECTED] wrote: On 4 Dez., 00:34, Wizzud [EMAIL PROTECTED] wrote: Try setting expires to a negative number to delete the cookie. If the value is null, the value of expires doesn't matter at all. Of course it is obsolete in the function call. That's strange. I can't see anything wrong with the code and it couldn't reproduce a bug. --Klaus
[jQuery] Re: Problem in delete cookie with jQuery Cookie plugin
On 4 Dez., 14:01, Leandro Vieira Pinho [EMAIL PROTECTED] wrote: Yes Klaus, The code is ok, but the cookie isn´t deleting, and I don´t know why? I don't know either. Works for me. Maybe something is wrong with the cookie name. Or some JavaScript error on the page. I can only guess... --Klaus
[jQuery] Problem in delete cookie with jQuery Cookie plugin
Hi Guys, I´m working with this piece of code: $(this).toggle( function() { $(this).children().slideToggle('fast', function() { $.cookie('_wp_el_' + i, i, { expires: 30, path: '/', domain: 'leandrovieira.com' }); }); }, function() { $(this).children().slideToggle('fast', function() { $.cookie('_wp_el_' + i, null, { expires: 30, path: '/', domain: 'leandrovieira.com' }); }); }); The cookie isn´t dele anyway. There´s something wrong? Regards
[jQuery] Re: Problem in delete cookie with jQuery Cookie plugin
Try setting expires to a negative number to delete the cookie. On Dec 3, 5:50 pm, Leandro Vieira Pinho [EMAIL PROTECTED] wrote: Hi Guys, I´m working with this piece of code: $(this).toggle( function() { $(this).children().slideToggle('fast', function() { $.cookie('_wp_el_' + i, i, { expires: 30, path: '/', domain: 'leandrovieira.com' }); }); }, function() { $(this).children().slideToggle('fast', function() { $.cookie('_wp_el_' + i, null, { expires: 30, path: '/', domain: 'leandrovieira.com' }); }); }); The cookie isn´t dele anyway. There´s something wrong? Regards
[jQuery] Cookie Plugin - Trying to get the values of elements in the array of cookies.
I'm using the cookie plugin. And, I have created 4 cookies with it and they are named: Expanded[1]=3 Expanded[2]=18 Expanded[3]=27 Expanded[4]=37 I also keep a count of the number of cookies that have been created and the name of this cookie is this: onExpandCount=4 How do I loop through these cookies? I can't seem to get the syntax right. Here's what I've tried: function expandMenuUsingCookie() { for (var index=0;index$.cookie('onExpandCount');index++) { //console.log(index); YAHOO.widget.TreeView.getNode('menu',$.cookie('Expanded['+index +']')).toggle(); } } There's something wrong with this line right about where I try to get the value of the cookie: YAHOO.widget.TreeView.getNode('menu',$.cookie('Expanded['+index +']')).toggle();
[jQuery] Cookie management with jquery and json
Hi People, I would like to know whether some of you have information about cookie management with jquery and json. In fact, for the moment, I have a function that returns a js hash table containing information about each box ( its column number and rank in the column) on my page. The boxes are draggable. For instance : temp[news] = [2,3] = This means that the div with name news is found on the second column and is in the 3rd position in that column. So I would like to store this information in a cookie, to get back the layout of a particular user. And my problem is that I would like to find a function that encodes the hash table in a json object and eventually, the JsonObject into jsontext, to be saved in a cookie. I tried to use www.json.org/json.js but I have much errors on the onload of my page, even though I haven't implemented the functions. Thanks in advance, Joel