[jQuery] dialog box

2009-12-21 Thread Jojje
Hi! I´m trying to make a dialog box , where you can press ok or cancel. How do i set the function so that when a user press ok it returns true? I'm new to javascript an jQuery so bare with me but this is what i got so far... function dialogBox(type,blockUi,heading,message) { var result;

[jQuery] Re: dialog box

2009-12-21 Thread Jojje
oh ok :) Thanks for taking time to answer :) So now i got this, it works but it sends the ajax calls twice. is it maybe because i set the callback wrong? the callback argument gets: function() { fGbDelete(gbid,link); } Shouldn´t it get just: fGbDelete(gbid,link)? Or why is it triggering

[jQuery] Re: Return values

2009-12-14 Thread Jojje
passing. So instead of return true or return false in a ajax function, it's better to call a function with the true or false as a parameter. Just my two cents ;) On 12 dec, 20:24, Jojje jojjsus_chr...@hotmail.com wrote: How deep in the scope can you go in nested functions and still return

[jQuery] Re: Return values

2009-12-14 Thread Jojje
to suggest the right way to write your code. -Mike On Mon, Dec 14, 2009 at 5:48 AM, Jojje jojjsus_chr...@hotmail.com wrote: Hi! Yeah i got that tip before but i'm not sure i understand this. Could you perhaps give me an example with the code below :) regards George On 14 Dec, 14:27, Rick

[jQuery] Re: Return values

2009-12-14 Thread Jojje
Oh and you type jojje to see how it behaves with an existing username :) On 14 Dec, 18:33, Jojje jojjsus_chr...@hotmail.com wrote: Ok, yes you can check it out athttp://www.sonicconnection.se/se/index.php?site=_misc/register It´s in swedish but its the first field that uses the code to check

[jQuery] Re: Return values

2009-12-14 Thread Jojje
, 2009 at 9:33 AM, Jojje jojjsus_chr...@hotmail.com wrote: Ok, yes you can check it out at http://www.sonicconnection.se/se/index.php?site=_misc/register It´s in swedish but its the first field that uses the code to check if the username already exists, it makes a call to a php script

[jQuery] Re: proper way

2009-12-13 Thread Jojje
Hahaha! You dont have to apologise for that, my mother should apologise to me hahahaha Ok thank you for your very good and easy explanations on this. This was actually part of another qustion i posted here, these rules doesnt apply in this example right? $.validator.addMethod('userCheck',

[jQuery] Re: proper way

2009-12-13 Thread Jojje
I´m not sure i follow you on this one: Fortunately, there is a much simpler solution. In your success callback, *call a function* and pass it your ajax result. In fact, that's the reason why there is a success callback in the first place. $.ajax calls your success callback when the ajax data

[jQuery] Re: proper way

2009-12-12 Thread Jojje
Ok, thank you for your anwer :) Appreciate it! One more question. If i use the code in example 2 the function gets triggered without me clicking the link, in example 2 it gets triggered only when i click the link. Dont know if i´m doin anything wrong here? Shouldnt both examples work the same?

[jQuery] Re: proper way

2009-12-12 Thread Jojje
Oh ok :) So in order for me to pass arguments without triggering clickFunction1 immediately,and instead triggering it when the link is clicked, i have to call it through another function thats not passed any arguments? So it´s still ok to use an anonymous function like in my example to achieve

[jQuery] Return values

2009-12-12 Thread Jojje
How deep in the scope can you go in nested functions and still return a value? For example: $.validator.addMethod('userCheck', function (value) { $.ajax({ type: POST, url: _scripts/send_message.php, data: action=checkuser username= + value, success:

[jQuery] Return values

2009-12-12 Thread Jojje
How deep in the scope can you go in nested functions and still return a value? For example: $.validator.addMethod('userCheck', function (value) { $.ajax({ type: POST, url: _scripts/send_message.php, data: action=checkuser username= + value, success:

[jQuery] ajax

2009-12-11 Thread Jojje
Hi! I have a question regarding ajax. In my script i have a lot of css rules set with jquery. And when i use the .load ajax function the page gets loaded but the css rules from the script doesnt, or the script does not get loaded, so i have to refresh the page. Is there a way to get the script

[jQuery] Variables

2009-12-11 Thread Jojje
Hi all! I'm adding a userCheck method to the validation plugin. It checks if the username i available, and if not an error message diplays, its done with ajax, my script does not work properly. I'm pretty new to javascript and jquery so maybe its an easy problem... its done with ajax and if the

[jQuery] proper way

2009-12-11 Thread Jojje
My question is about syntax, or how to wite jquery code. Is the example below ok? Putting all your code between document.ready all your code with anonymous functions? $(document).ready(function() { $('a.link1').click(function() { //code }); $('a.link2').click(function() {

[jQuery] Re: Variables

2009-12-11 Thread Jojje
Noticed that whn i do rhis synchronized it works? But that locks up the browser while the request is sent. Maybe that helps to solve the problem? I don´t understand why when i use asynchronized request, the first time the variable is undefined and then when i type for instance Joe i get back Jo

[jQuery] Re: ajax

2009-12-11 Thread Jojje
to encode it? George On 12 Dec, 03:25, Charlie charlie...@gmail.com wrote: page that gets loaded doesn't include head have you tried $.getScript? or you can insert script in body of page being loadedhttp://docs.jquery.com/Ajax/jQuery.getScript#urlcallback Jojje wrote:Hi! I have a question

[jQuery] Validation

2009-11-15 Thread Jojje
doing wrong? help would be mch apreciated. Thanks in advance Jojje