I am having troubles getting this dialog to work with a cookie, help PLEASE!
|
View:
New views
16 Messages
—
Rating Filter:
Alert me
|
|
|
I am having troubles getting this dialog to work with a cookie, help PLEASE!Hey guys, just pasting my code here; i'm trying ot make it so the
dialog comes up and then when 'x' or close is clicked it creates a cookie which expires in say 2 days and so the dialog wont launch once the cookie is created. I am using the cookie.jquery.js plugin, so heres the code! <script type="text/javascript"> $(function() { $("#dialog") .dialog({ bgiframe: true, modal: true, resizable: false, autoOpen: true, width:200, close: function() { $.cookie('doneDi', 'closed', { expires: 2 }) }, buttons: { Ok: function() { $(this).dialog('close') $.cookie('doneDi', 'closed', { expires: 2 }); } } }); var doneDi = $.cookie('doneDi'); if (doneDi == 'closed') { $("#dialog").dialog( 'disable') ; }; }); </script> Cheers in advance, it's been driving me nuts!! Stefpretty -- You received this message because you are subscribed to the Google Groups "jQuery UI" group. To post to this group, send email to jquery-ui@.... To unsubscribe from this group, send email to jquery-ui+unsubscribe@.... For more options, visit this group at http://groups.google.com/group/jquery-ui?hl=en. |
|
|
Re: I am having troubles getting this dialog to work with a cookie, help PLEASE!Maybe try making the dialog autoOpen: false and then only open it
after checking the cookie: <script type="text/javascript"> $(function() { $("#dialog") .dialog({ bgiframe: true, modal: true, resizable: false, autoOpen: false, width:200, close: function() { $.cookie('doneDi', 'closed', { expires: 2 }) }, buttons: { Ok: function() { $(this).dialog('close') $.cookie('doneDi', 'closed', { expires: 2 }); } } }); var doneDi = $.cookie('doneDi'); if (doneDi != 'closed') { $("#dialog").dialog( 'open') ; }; }); </script> Hth, Dave On Nov 2, 11:48 am, stefpretty <stefpre...@...> wrote: > Hey guys, just pasting my code here; i'm trying ot make it so the > dialog comes up and then when 'x' or close is clicked it creates a > cookie which expires in say 2 days and so the dialog wont launch once > the cookie is created. > > I am using the cookie.jquery.js plugin, so heres the code! > > <script type="text/javascript"> > > $(function() { > $("#dialog") > .dialog({ > bgiframe: true, > modal: true, > resizable: false, > autoOpen: true, > width:200, > close: function() { > $.cookie('doneDi', 'closed', { expires: 2 }) > }, > buttons: { > Ok: function() { > $(this).dialog('close') > $.cookie('doneDi', 'closed', { expires: 2 }); > } > } > > }); > > var doneDi = $.cookie('doneDi'); > > if (doneDi == 'closed') { > $("#dialog").dialog( 'disable') ; > > }; > }); > > </script> > > Cheers in advance, it's been driving me nuts!! > > Stefpretty -- You received this message because you are subscribed to the Google Groups "jQuery UI" group. To post to this group, send email to jquery-ui@.... To unsubscribe from this group, send email to jquery-ui+unsubscribe@.... For more options, visit this group at http://groups.google.com/group/jquery-ui?hl=en. |
|
|
Re: I am having troubles getting this dialog to work with a cookie, help PLEASE!Hmm i like the thought behind this, unfortunately it wont work, i
checked the cookies in my computer and nothing is being stored!? Cheers, Stefpretty -- You received this message because you are subscribed to the Google Groups "jQuery UI" group. To post to this group, send email to jquery-ui@.... To unsubscribe from this group, send email to jquery-ui+unsubscribe@.... For more options, visit this group at http://groups.google.com/group/jquery-ui?hl=en. |
|
|
Re: Re: I am having troubles getting this dialog to work with a cookie, help PLEASE!On Mon, Nov 2, 2009 at 2:07 PM, stefpretty <stefpretty@...> wrote:
> Hmm i like the thought behind this, unfortunately it wont work, i > checked the cookies in my computer and nothing is being stored!? This sounds more likely an issue with the cookie plug-in. Have you verified that you can use the cookies in a simpler scenario? I know that Remy Sharp's http://jsbin.com/ does something much like you're discussing, but it uses PPK's code rather than the cookie plug-in. You might look at that code, though. -- Scott -- You received this message because you are subscribed to the Google Groups "jQuery UI" group. To post to this group, send email to jquery-ui@.... To unsubscribe from this group, send email to jquery-ui+unsubscribe@.... For more options, visit this group at http://groups.google.com/group/jquery-ui?hl=en. |
|
|
Re: I am having troubles getting this dialog to work with a cookie, help PLEASE!Thanks I might try the code they have used if i can't get a solution
for this method first, also the cookies plugin was from jquery ui website. I'm stubborn lol Regards, Stefpretty On Nov 2, 7:20 pm, Scott Sauyet <scott.sau...@...> wrote: > On Mon, Nov 2, 2009 at 2:07 PM, stefpretty <stefpre...@...> wrote: > > Hmm i like the thought behind this, unfortunately it wont work, i > > checked the cookies in my computer and nothing is being stored!? > > This sounds more likely an issue with the cookie plug-in. > > Have you verified that you can use the cookies in a simpler scenario? > > I know that Remy Sharp'shttp://jsbin.com/does something much like > you're discussing, but it uses PPK's code rather than the cookie > plug-in. You might look at that code, though. > > -- Scott -- You received this message because you are subscribed to the Google Groups "jQuery UI" group. To post to this group, send email to jquery-ui@.... To unsubscribe from this group, send email to jquery-ui+unsubscribe@.... For more options, visit this group at http://groups.google.com/group/jquery-ui?hl=en. |
|
|
Re: I am having troubles getting this dialog to work with a cookie, help PLEASE!Anybody else maybe have a solution to my problem?
sorry, running on a deadline. Thanks! Stefpretty On Nov 2, 8:36 pm, stefpretty <stefpre...@...> wrote: > Thanks I might try the code they have used if i can't get a solution > for this method first, also the cookies plugin was from jquery ui > website. I'm stubborn lol > > Regards, > Stefpretty > > On Nov 2, 7:20 pm, Scott Sauyet <scott.sau...@...> wrote: > > > > > On Mon, Nov 2, 2009 at 2:07 PM, stefpretty <stefpre...@...> wrote: > > > Hmm i like the thought behind this, unfortunately it wont work, i > > > checked the cookies in my computer and nothing is being stored!? > > > This sounds more likely an issue with the cookie plug-in. > > > Have you verified that you can use the cookies in a simpler scenario? > > > I know that Remy Sharp'shttp://jsbin.com/doessomething much like > > you're discussing, but it uses PPK's code rather than the cookie > > plug-in. You might look at that code, though. > > > -- Scott -- You received this message because you are subscribed to the Google Groups "jQuery UI" group. To post to this group, send email to jquery-ui@.... To unsubscribe from this group, send email to jquery-ui+unsubscribe@.... For more options, visit this group at http://groups.google.com/group/jquery-ui?hl=en. |
|
|
Re: I am having troubles getting this dialog to work with a cookie, help PLEASE!ok here is what I found for whatever reason 'disable' event doesn't
seem to work so I used 'destroy' event here is the jquery $(document).ready(function(){ $("#dialog").dialog({ bgiframe: true, modal: true, resizable: false, autoOpen: false, width:200, close: function() { $.cookie('doneDi', 'closed', { expires: 2 }); }, buttons: { Ok: function() { $.cookie('doneDi', 'closed', { expires: 2 }); $(this).dialog('close'); } } }); $("#dbutton").click(function(){ if ($.cookie("doneDi") == "closed"){ $("#dialog").dialog('destroy'); }else{ $("#dialog").dialog('open'); } }); }); let me know how this works out for you Mean Mike On Nov 3, 8:40 am, stefpretty <stefpre...@...> wrote: > Anybody else maybe have a solution to my problem? > sorry, running on a deadline. > > Thanks! > > Stefpretty > > On Nov 2, 8:36 pm, stefpretty <stefpre...@...> wrote: > > > Thanks I might try the code they have used if i can't get a solution > > for this method first, also the cookies plugin was from jquery ui > > website. I'm stubborn lol > > > Regards, > > Stefpretty > > > On Nov 2, 7:20 pm, Scott Sauyet <scott.sau...@...> wrote: > > > > On Mon, Nov 2, 2009 at 2:07 PM, stefpretty <stefpre...@...> wrote: > > > > Hmm i like the thought behind this, unfortunately it wont work, i > > > > checked the cookies in my computer and nothing is being stored!? > > > > This sounds more likely an issue with the cookie plug-in. > > > > Have you verified that you can use the cookies in a simpler scenario? > > > > I know that Remy Sharp'shttp://jsbin.com/doessomethingmuch like > > > you're discussing, but it uses PPK's code rather than the cookie > > > plug-in. You might look at that code, though. > > > > -- Scott -- You received this message because you are subscribed to the Google Groups "jQuery UI" group. To post to this group, send email to jquery-ui@.... To unsubscribe from this group, send email to jquery-ui+unsubscribe@.... For more options, visit this group at http://groups.google.com/group/jquery-ui?hl=en. |
|
|
Re: I am having troubles getting this dialog to work with a cookie, help PLEASE!Hmm still doesnt seem to want to work!!!
If you want to take a look at the site itself and the source see if its something else? http://www.wallacegait.co.uk username: wallace pass: gait Thanks again! Stefpretty On Nov 3, 2:29 pm, Mean Mike <mcgra...@...> wrote: > ok here is what I found for whatever reason 'disable' event doesn't > seem to work so I used 'destroy' event > here is the jquery > > $(document).ready(function(){ > $("#dialog").dialog({ > bgiframe: true, > modal: true, > resizable: false, > autoOpen: false, > width:200, > close: function() { > $.cookie('doneDi', 'closed', { expires: 2 }); > }, > buttons: { > Ok: function() { > $.cookie('doneDi', 'closed', { expires: 2 }); > $(this).dialog('close'); > } > } > }); > $("#dbutton").click(function(){ > if ($.cookie("doneDi") == "closed"){ > $("#dialog").dialog('destroy'); > }else{ > $("#dialog").dialog('open'); > } > }); > }); > > let me know how this works out for you > > Mean Mike > > On Nov 3, 8:40 am, stefpretty <stefpre...@...> wrote: > > > > > Anybody else maybe have a solution to my problem? > > sorry, running on a deadline. > > > Thanks! > > > Stefpretty > > > On Nov 2, 8:36 pm, stefpretty <stefpre...@...> wrote: > > > > Thanks I might try the code they have used if i can't get a solution > > > for this method first, also the cookies plugin was from jquery ui > > > website. I'm stubborn lol > > > > Regards, > > > Stefpretty > > > > On Nov 2, 7:20 pm, Scott Sauyet <scott.sau...@...> wrote: > > > > > On Mon, Nov 2, 2009 at 2:07 PM, stefpretty <stefpre...@...> wrote: > > > > > Hmm i like the thought behind this, unfortunately it wont work, i > > > > > checked the cookies in my computer and nothing is being stored!? > > > > > This sounds more likely an issue with the cookie plug-in. > > > > > Have you verified that you can use the cookies in a simpler scenario? > > > > > I know that Remy Sharp'shttp://jsbin.com/doessomethingmuchlike > > > > you're discussing, but it uses PPK's code rather than the cookie > > > > plug-in. You might look at that code, though. > > > > > -- Scott -- You received this message because you are subscribed to the Google Groups "jQuery UI" group. To post to this group, send email to jquery-ui@.... To unsubscribe from this group, send email to jquery-ui+unsubscribe@.... For more options, visit this group at http://groups.google.com/group/jquery-ui?hl=en. |
|
|
Re: Re: I am having troubles getting this dialog to work with a cookie, help PLEASE!On Tue, Nov 3, 2009 at 12:39 PM, stefpretty <stefpretty@...> wrote:
> Hmm still doesnt seem to want to work!!! You're loading jquery.cookie before jquery... And I think your UI loading might be out of order too. -- Scott -- You received this message because you are subscribed to the Google Groups "jQuery UI" group. To post to this group, send email to jquery-ui@.... To unsubscribe from this group, send email to jquery-ui+unsubscribe@.... For more options, visit this group at http://groups.google.com/group/jquery-ui?hl=en. |
|
|
Re: I am having troubles getting this dialog to work with a cookie, help PLEASE!you legend!!!!
I never realised you had to watch the order, wow you do learn something new every day! Thank you soooo much! Now i can expand my knowledge and use it in other applications! THANK YOU! stefpretty On Nov 3, 5:47 pm, Scott Sauyet <scott.sau...@...> wrote: > On Tue, Nov 3, 2009 at 12:39 PM, stefpretty <stefpre...@...> wrote: > > Hmm still doesnt seem to want to work!!! > > You're loading jquery.cookie before jquery... > > And I think your UI loading might be out of order too. > > -- Scott -- You received this message because you are subscribed to the Google Groups "jQuery UI" group. To post to this group, send email to jquery-ui@.... To unsubscribe from this group, send email to jquery-ui+unsubscribe@.... For more options, visit this group at http://groups.google.com/group/jquery-ui?hl=en. |
|
|
Re: I am having troubles getting this dialog to work with a cookie, help PLEASE!swap these two lines around
<script src="scripts/jquery.cookie.js" type="text/javascript"></ script> <script src="scripts/jquery-1.3.2.js" type="text/javascript" charset="utf-8"></script> they are out of order you may potentially have more of them out of order its probably a really bad idea to have $(document).ready(function(){ inside of $(document).ready(function(){ you can loose the second one Mean Mike On Nov 3, 12:47 pm, Scott Sauyet <scott.sau...@...> wrote: > On Tue, Nov 3, 2009 at 12:39 PM, stefpretty <stefpre...@...> wrote: > > Hmm still doesnt seem to want to work!!! > > You're loading jquery.cookie before jquery... > > And I think your UI loading might be out of order too. > > -- Scott -- You received this message because you are subscribed to the Google Groups "jQuery UI" group. To post to this group, send email to jquery-ui@.... To unsubscribe from this group, send email to jquery-ui+unsubscribe@.... For more options, visit this group at http://groups.google.com/group/jquery-ui?hl=en. |
|
|
Re: I am having troubles getting this dialog to work with a cookie, help PLEASE!Ah, I think I found the issue... you are loading the cookie plugin
before jQuery. It depends on jQuery and it's code is not being made available to you. Load it after jquery and then the code I gave you earlier should do the trick. Hth, Dave On Nov 3, 12:39 pm, stefpretty <stefpre...@...> wrote: > Hmm still doesnt seem to want to work!!! > > If you want to take a look at the site itself and the source see if > its something else? > > http://www.wallacegait.co.uk > username: wallace > pass: gait > > Thanks again! > > Stefpretty > > On Nov 3, 2:29 pm, Mean Mike <mcgra...@...> wrote: > > > ok here is what I found for whatever reason 'disable' event doesn't > > seem to work so I used 'destroy' event > > here is the jquery > > > $(document).ready(function(){ > > $("#dialog").dialog({ > > bgiframe: true, > > modal: true, > > resizable: false, > > autoOpen: false, > > width:200, > > close: function() { > > $.cookie('doneDi', 'closed', { expires: 2 }); > > }, > > buttons: { > > Ok: function() { > > $.cookie('doneDi', 'closed', { expires: 2 }); > > $(this).dialog('close'); > > } > > } > > }); > > $("#dbutton").click(function(){ > > if ($.cookie("doneDi") == "closed"){ > > $("#dialog").dialog('destroy'); > > }else{ > > $("#dialog").dialog('open'); > > } > > }); > > }); > > > let me know how this works out for you > > > Mean Mike > > > On Nov 3, 8:40 am, stefpretty <stefpre...@...> wrote: > > > > Anybody else maybe have a solution to my problem? > > > sorry, running on a deadline. > > > > Thanks! > > > > Stefpretty > > > > On Nov 2, 8:36 pm, stefpretty <stefpre...@...> wrote: > > > > > Thanks I might try the code they have used if i can't get a solution > > > > for this method first, also the cookies plugin was from jquery ui > > > > website. I'm stubborn lol > > > > > Regards, > > > > Stefpretty > > > > > On Nov 2, 7:20 pm, Scott Sauyet <scott.sau...@...> wrote: > > > > > > On Mon, Nov 2, 2009 at 2:07 PM, stefpretty <stefpre...@...> wrote: > > > > > > Hmm i like the thought behind this, unfortunately it wont work, i > > > > > > checked the cookies in my computer and nothing is being stored!? > > > > > > This sounds more likely an issue with the cookie plug-in. > > > > > > Have you verified that you can use the cookies in a simpler scenario? > > > > > > I know that Remy Sharp'shttp://jsbin.com/doessomethingmuchlike > > > > > you're discussing, but it uses PPK's code rather than the cookie > > > > > plug-in. You might look at that code, though. > > > > > > -- Scott -- You received this message because you are subscribed to the Google Groups "jQuery UI" group. To post to this group, send email to jquery-ui@.... To unsubscribe from this group, send email to jquery-ui+unsubscribe@.... For more options, visit this group at http://groups.google.com/group/jquery-ui?hl=en. |
|
|
Re: I am having troubles getting this dialog to work with a cookie, help PLEASE!Thanks guys!
Great help, all sorted out now! Stefpretty On Nov 3, 5:55 pm, Fontzter <dmfo...@...> wrote: > Ah, I think I found the issue... you are loading the cookie plugin > before jQuery. It depends on jQuery and it's code is not being made > available to you. Load it after jquery and then the code I gave you > earlier should do the trick. > > Hth, > > Dave > > On Nov 3, 12:39 pm, stefpretty <stefpre...@...> wrote: > > > > > Hmm still doesnt seem to want to work!!! > > > If you want to take a look at the site itself and the source see if > > its something else? > > >http://www.wallacegait.co.uk > > username: wallace > > pass: gait > > > Thanks again! > > > Stefpretty > > > On Nov 3, 2:29 pm, Mean Mike <mcgra...@...> wrote: > > > > ok here is what I found for whatever reason 'disable' event doesn't > > > seem to work so I used 'destroy' event > > > here is the jquery > > > > $(document).ready(function(){ > > > $("#dialog").dialog({ > > > bgiframe: true, > > > modal: true, > > > resizable: false, > > > autoOpen: false, > > > width:200, > > > close: function() { > > > $.cookie('doneDi', 'closed', { expires: 2 }); > > > }, > > > buttons: { > > > Ok: function() { > > > $.cookie('doneDi', 'closed', { expires: 2 }); > > > $(this).dialog('close'); > > > } > > > } > > > }); > > > $("#dbutton").click(function(){ > > > if ($.cookie("doneDi") == "closed"){ > > > $("#dialog").dialog('destroy'); > > > }else{ > > > $("#dialog").dialog('open'); > > > } > > > }); > > > }); > > > > let me know how this works out for you > > > > Mean Mike > > > > On Nov 3, 8:40 am, stefpretty <stefpre...@...> wrote: > > > > > Anybody else maybe have a solution to my problem? > > > > sorry, running on a deadline. > > > > > Thanks! > > > > > Stefpretty > > > > > On Nov 2, 8:36 pm, stefpretty <stefpre...@...> wrote: > > > > > > Thanks I might try the code they have used if i can't get a solution > > > > > for this method first, also the cookies plugin was from jquery ui > > > > > website. I'm stubborn lol > > > > > > Regards, > > > > > Stefpretty > > > > > > On Nov 2, 7:20 pm, Scott Sauyet <scott.sau...@...> wrote: > > > > > > > On Mon, Nov 2, 2009 at 2:07 PM, stefpretty <stefpre...@...> wrote: > > > > > > > Hmm i like the thought behind this, unfortunately it wont work, i > > > > > > > checked the cookies in my computer and nothing is being stored!? > > > > > > > This sounds more likely an issue with the cookie plug-in. > > > > > > > Have you verified that you can use the cookies in a simpler scenario? > > > > > > > I know that Remy Sharp'shttp://jsbin.com/doessomethingmuchlike > > > > > > you're discussing, but it uses PPK's code rather than the cookie > > > > > > plug-in. You might look at that code, though. > > > > > > > -- Scott -- You received this message because you are subscribed to the Google Groups "jQuery UI" group. To post to this group, send email to jquery-ui@.... To unsubscribe from this group, send email to jquery-ui+unsubscribe@.... For more options, visit this group at http://groups.google.com/group/jquery-ui?hl=en. |
|
|
Re: Re: I am having troubles getting this dialog to work with a cookie, help PLEASE!On Tue, Nov 3, 2009 at 12:58 PM, stefpretty <stefpretty@...> wrote:
> Thanks guys! > Great help, all sorted out now! If you don't already have it, Firebug, a plug-in for Firefox is an indispensable tool for finding errors like this. Once we saw the site, anyone with firebug was able to see the error icon on loading your page and click it to realize that "$" was not defined when the cookie plug-in was trying to use it. From there it's just a quick look at the source... -- Scott -- You received this message because you are subscribed to the Google Groups "jQuery UI" group. To post to this group, send email to jquery-ui@.... To unsubscribe from this group, send email to jquery-ui+unsubscribe@.... For more options, visit this group at http://groups.google.com/group/jquery-ui?hl=en. |
|
|
Re: Re: I am having troubles getting this dialog to work with a cookie, help PLEASE!On Tue, Nov 3, 2009 at 10:06 AM, Scott Sauyet <scott.sauyet@...> wrote:
> > If you don't already have it, Firebug, a plug-in for Firefox is an > indispensable tool for finding errors like this. Once we saw the > site, anyone with firebug was able to see the error icon on loading > your page and click it to realize that "$" was not defined when the > cookie plug-in was trying to use it. From there it's just a quick > look at the source... > > -- Scott > I'd also have to recommend Google Chrome. If you right click and Inspect Element you get much of the firebug capabilities. And if you then press Esc you'll see any errors on the page. Quick and easy to debug. -- You received this message because you are subscribed to the Google Groups "jQuery UI" group. To post to this group, send email to jquery-ui@.... To unsubscribe from this group, send email to jquery-ui+unsubscribe@.... For more options, visit this group at http://groups.google.com/group/jquery-ui?hl=en. |
|
|
Re: I am having troubles getting this dialog to work with a cookie, help PLEASE!Or you could use IE and add an alert to every other line of code to
return key values :) ...couldn't resist :) On Nov 3, 5:22 pm, "J.C." <impressthe...@...> wrote: > On Tue, Nov 3, 2009 at 10:06 AM, Scott Sauyet <scott.sau...@...> wrote: > > > If you don't already have it, Firebug, a plug-in for Firefox is an > > indispensable tool for finding errors like this. Once we saw the > > site, anyone with firebug was able to see the error icon on loading > > your page and click it to realize that "$" was not defined when the > > cookie plug-in was trying to use it. From there it's just a quick > > look at the source... > > > -- Scott > > I'd also have to recommend Google Chrome. If you right click and > Inspect Element you get much of the firebug capabilities. And if you > then press Esc you'll see any errors on the page. Quick and easy to > debug. -- You received this message because you are subscribed to the Google Groups "jQuery UI" group. To post to this group, send email to jquery-ui@.... To unsubscribe from this group, send email to jquery-ui+unsubscribe@.... For more options, visit this group at http://groups.google.com/group/jquery-ui?hl=en. |
| Free embeddable forum powered by Nabble | Forum Help |