[jQuery] Re: Triggering a link with no click event
As I can see quite many posts on this subject I wanted to explain why I need this. I generate links for RokBox modal window - something like test next, I need to trigger these links from jscript function (from the external flash application). I could not figure out the way how to call RokBox directly and have to finc out the way how to trigger links via jquery or mootools or whatsoever. Any suggestions?
[jQuery] Re: $.ajax bug ?!? Maybe i've not understand somethings ....
That's a closure to save the 'callback' variable in it's own scope. Actually it's not needed :) The way that works is we create an anonymous function that will run immediately, accepting as a parameter the callback name, and then return a function which will be assigned to window[callback]; Like myFunctionWithBeef = (function(x){ //'beef' is available in here in the var 'x'; return function(){...}; //this function will be stored in the 'myFunctionWithBeef' variable, and will have access to all vars in this scope })('beef'); Here is how it looks without it: self.timeout = function(){ if (self[callback]){ window[callback] = function(){}; s.onTimeout(s.url); $('head script[src$='+s.url+']').remove(); delete self[callback]; }; }; The function is already declared in the scope where 'callback' is available, so that closure is unnecessary. I think I left it that way because it was originally inside a timeout, which runs in the global scope. One thing you must be aware of is that this script will not allow two consecutive ajax calls with the same callback function, 'cause one will overwrite the other. cheers, - ricardo On 30 jan, 22:14, Stefano Corallo wrote: > :) in effect i've investigated but i'm not a guru of js so i need some > help ... thanks. > > last but not least :D can you explain this code: > > self[callback] = window[callback]; > window[callback] = (function(callback){ > return function(data){ > (window[callback] = self[callback])(data); > delete self[callback]; > clearTimeout(timer); > }; > })(callback); > > On 30 Gen, 23:57, Ricardo Tomasi wrote: > > > Ah, an oversight of mine. I forgot to add the parameter when rewriting > > the callback. > > > Fixed as you can see athttp://jsbin.com/eliwu > > > Never use someone else's code without inspection ;) > > > On Jan 30, 4:34 pm, Stefano Corallo wrote: > > > > On 30 Gen, 19:25, Ricardo Tomasi wrote: > > > > > We can't access the success function of the $.ajax call without > > > > messing with jQuery source code, because the vars that name it are > > > > inside the jQuery function scope. > > > > ok > > > > > In JSONP, the JSON object is passed as an argument to the callback > > > > function. In the example I posted: > > > > > jsonFlickrFeed = function(data){ //do something with data }; > > > > i've tried but data is always undefined,take a look: > > > >http://jsbin.com/ajimu/edit > > > > > On Jan 30, 7:28 am, Stefano Corallo wrote: > > > > > > On 28 Gen, 17:03, Ricardo Tomasi wrote: > > > > > > > It isn't possible to have error/success callbacks for JSONP. You > > > > > > can't > > > > > > cancel the request either. Once you add a
[jQuery] Re: White spots while fading images
Hi Ricardo, What should be the image format ? I am using .jpg as of now. Thanks for the help. Samyak On 1/31/09, Ricardo Tomasi wrote: > > It's a known IE bug, the solutions are 1) change your image format, 2) > set the container background color to black, that will hide the > failure. > > > On 31 jan, 04:44, Samyak Bhuta wrote: > > Hello All, > > > > I am using the animated innerfade pluggin > (http://www.openstudio.fr/Animated-InnerFade-with-JQuery.html?lang=en) > > to provide the image transistion using fade-in/fade-out effects. Every > > thing is working fine in other browser but IE is showing some white > > pixels here and there on the images white they are fading. > > > > > You could see this happening onhttp://www.anvay.net/pnrconsultings/ > > > > > List of images where you can see white spots are > > > > * 2nd image, titled " team spirit " > > * 3rd image, titled "vigor" > > > > Observations : > > * They are effecting the same set of images. > > * They always affecting the same pixels. > > * Only during the fade-in and fade-out you could see that. > > > > Could anyone tell me what is the reason this, I know IE is evil. > > Please help me fight the evil. Can't tell my client and thier end user > > ( client's client ) to switch to better browsers , atleast for now. > > > > Thanks in advance, > > > > Samyak
[jQuery] Triggering a link with no click event
HI All, It could be a silly question, but I cannot find a simple answer... I need to trigger a link with href via an external function, i.e. Emulating click my link function linkClick(){ $("#test").click(); } It does not work and returns nothing. I understanbd that it is because the a#test does not have the actual onclick event. So, how can I emulate click on a#test? Note, that I cannot modify the a link element or add onclick events.
[jQuery] Re: Why no padding controls for ThemeRoller?
http://groups.google.com/group/jquery-ui On 30 jan, 23:07, ferodynamics wrote: > Maybe this is the wrong place to suggest this, but I think it would be > helpful if the ThemeRoller had some padding controls, for example, to > resize the tabs to make them bigger or smaller. I assume this will > require adding padding somewhere with CSS, hopefully I can make the > modification within my html file (there's probably a class or id, too > lazy to Firebug it now) so I can continue using the themeRoller w/o > repeating any tweaks I come up with. > > PS: This is my first post, and still wishing this was vbulletin ;-)
[jQuery] Re: White spots while fading images
It's a known IE bug, the solutions are 1) change your image format, 2) set the container background color to black, that will hide the failure. On 31 jan, 04:44, Samyak Bhuta wrote: > Hello All, > > I am using the animated innerfade pluggin > (http://www.openstudio.fr/Animated-InnerFade-with-JQuery.html?lang=en) > to provide the image transistion using fade-in/fade-out effects. Every > thing is working fine in other browser but IE is showing some white > pixels here and there on the images white they are fading. > > You could see this happening onhttp://www.anvay.net/pnrconsultings/ > > List of images where you can see white spots are > > * 2nd image, titled " team spirit " > * 3rd image, titled "vigor" > > Observations : > * They are effecting the same set of images. > * They always affecting the same pixels. > * Only during the fade-in and fade-out you could see that. > > Could anyone tell me what is the reason this, I know IE is evil. > Please help me fight the evil. Can't tell my client and thier end user > ( client's client ) to switch to better browsers , atleast for now. > > Thanks in advance, > > Samyak
[jQuery] White spots while fading images
Hello All, I am using the animated innerfade pluggin ( http://www.openstudio.fr/Animated-InnerFade-with-JQuery.html?lang=en ) to provide the image transistion using fade-in/fade-out effects. Every thing is working fine in other browser but IE is showing some white pixels here and there on the images white they are fading. You could see this happening on http://www.anvay.net/pnrconsultings/ List of images where you can see white spots are * 2nd image, titled " team spirit " * 3rd image, titled "vigor" Observations : * They are effecting the same set of images. * They always affecting the same pixels. * Only during the fade-in and fade-out you could see that. Could anyone tell me what is the reason this, I know IE is evil. Please help me fight the evil. Can't tell my client and thier end user ( client's client ) to switch to better browsers , atleast for now. Thanks in advance, Samyak
[jQuery] Re: Possible remote and/or messages bug
Could you provide more information, like code and browser specs? On Jan 30, 2:21 pm, WizADSL wrote: > I wanted to post this here first and see if anyone has seen this. > This is easy to reproduce. > > The Prep: > > Create a form with a few fields, on form field 2 add > remote="somepasge.htm" and make it required, create somepage.htm and > put true as the only content of the page and of course set the for to > validate. This is a basic form that would use the remote feature to > check with the server, and the field will always be valid as long is > is not empty. > > The problem: > > In your validate function call, add a messages entry for field 2 and > (this can be require, remote, etc) then submit the form, so far so > good. Now, if you hit "back" in the browser and hit submit again, the > form will not submit (but the remote check will fire), if you hit > submit a second time, it will go. If you remove the messages entry > for the field from the validate function call and try everything again > it works fine every time (no second submit needed). > > It seems that having a messages entry for a field when using remote > will cause incorrect behavior if the form is re-submitted.
[jQuery] [Validate] Possible remote and/or messages bug
I wanted to post this here first and see if anyone has seen this. This is easy to reproduce. The Prep: Create a form with a few fields, on form field 2 add remote="somepasge.htm" and make it required, create somepage.htm and put true as the only content of the page and of course set the for to validate. This is a basic form that would use the remote feature to check with the server, and the field will always be valid as long is is not empty. The problem: In your validate function call, add a messages entry for field 2 and (this can be require, remote, etc) then submit the form, so far so good. Now, if you hit "back" in the browser and hit submit again, the form will not submit (but the remote check will fire), if you hit submit a second time, it will go. If you remove the messages entry for the field from the validate function call and try everything again it works fine every time (no second submit needed). It seems that having a messages entry for a field when using remote will cause incorrect behavior if the form is re-submitted.
[jQuery] Why no padding controls for ThemeRoller?
Maybe this is the wrong place to suggest this, but I think it would be helpful if the ThemeRoller had some padding controls, for example, to resize the tabs to make them bigger or smaller. I assume this will require adding padding somewhere with CSS, hopefully I can make the modification within my html file (there's probably a class or id, too lazy to Firebug it now) so I can continue using the themeRoller w/o repeating any tweaks I come up with. PS: This is my first post, and still wishing this was vbulletin ;-)
[jQuery] Re: cfdiv and jQuery
On Jan 31, 8:33 am, Richard wrote: > so I use $('.userListItem:eq(0)') to select the first occurence of a > div with the userListItem class. This doesn't work when the item is > within a cfdiv, but it does work if I put the item outside a cfdiv. > Sorry, what is a cfdiv?
[jQuery] Re: trouble with adding functions
I think that issue usually happens with and . Try adding a CSS background to the element to see how much it spans on your document, and you may see that the spans 100% horizontally. I usually find using instead to fix the issue. On Jan 30, 8:23 am, surreal5335 wrote: > Ok, well I was able to get to work, but I cant figure out now how to > reduce the hover area. For some reason hovering on any part of the > screen that is horizontal with the text will cause the hover event to > trigger. How can I stop this? > > This the current jquery haddling the event > > $("p#makered").hover(function(){ > $(this).addClass("red"); > > }, > function() { > $("p#makered").removeClass("red"); > $(this).fadeOut(1000); > > }); > > }); > > The css handling the colors and border (which isnt showing up either): > > > > p.green { color: rgb(0,255,0); } > > p.red { > color: rgb(255,0,0); > border: 1px; > } > > > > Here is the html for the text: > > Some text > > Thanks a lot for your help on this matter > > On Jan 30, 11:11 am, surreal5335 wrote: > > > I am having troubles trying to get this function to work. I got the > > first part to work but trying to get the take a whole nother > > action upon hover out. > > > Here is the jquery I am using > > > $("p#makered").hover(function(){ > > $(this).addClass("red"); > > }, > > function() { > > $("p#makered").fadeOut("slow"); > > > }); > > > The css works fine, but with the added jquery function changing the > > text from green to red is no longer happening and firebug says I am > > missing a ' ) ' after "function() {" Tried adding it just to see but > > that doesnt work. Must be something else entirely. > > > Any help? > >
[jQuery] Re: Using $_POST to transmit large key/pair
I think if you use the {key:val} data in $.get() it'll be considered GET data, but I haven't tried it before. On Jan 30, 2:26 pm, Mark Livingstone wrote: > ah, I thought that { key : pair } was just a replacement for > &key=pair... > > On Jan 30, 2:25 pm, Beres Botond wrote: > > > As shown in the docs (link I gave you), it should work > > > $.post("order_send_email.php", > > {order_message : order_message}, // {key : variable} > > function(data) > > { > > alert(data); > > // do something > > }); > > > On Jan 30, 4:03 pm, Mark Livingstone wrote: > > > > Thanks, Beres. > > > > I am reading this order_message from a DIV. How do I 'POST' it? By > > > using form? > > > > Also, to url encode... do I use "escape()"? > > > > On Jan 30, 3:08 am, Beres Botond wrote: > > > > > You want to use POST, but you are sending your data as GET (without > > > > url encoding). > > > > So I'm pretty sure it cuts before "#", because # is a non-alphanumeric > > > > character and you haven't urlencoded your data. > > > > > Data in URL = GET, not POST, even if you are using $.post . > > > > >http://docs.jquery.com/Post > > > > > So either urlencode your data before putting it in the request or send > > > > it as POST. > > > > > Also I'm not sure how it worked for you on server-side, if you were > > > > expecting $_POST... I assume you were expecting > > > > $_REQUEST instead, which is not a good idea in my opinion. > > > > > On Jan 30, 8:08 am, Mark Livingstone wrote: > > > > > > I have the following code: > > > > > > $.post(order_send_email.php?order_message='+order_message) > > > > > > my 'order_message' is: > > > > > > 'Dear '+data['salutation']+" "+data['first_name']+" > > > > > "+data['last_name'] > > > > > +', \n\nThis is to inform you that your order #'+key+" and payment in > > > > > the amount of...'; > > > > > > When using $.POST... the message gets cut before "#". Is there a limit > > > > > on how much cam be transmitted or am I doing something wrong? > > > > > > Thanks.- Hide quoted text - > > > > > - Show quoted text -- Hide quoted text - > > > - Show quoted text - > >
[jQuery] Re: Using $_POST to transmit large key/pair
ah, I thought that { key : pair } was just a replacement for &key=pair... On Jan 30, 2:25 pm, Beres Botond wrote: > As shown in the docs (link I gave you), it should work > > $.post("order_send_email.php", > {order_message : order_message}, // {key : variable} > function(data) > { > alert(data); > // do something > }); > > On Jan 30, 4:03 pm, Mark Livingstone wrote: > > > > > Thanks, Beres. > > > I am reading this order_message from a DIV. How do I 'POST' it? By > > using form? > > > Also, to url encode... do I use "escape()"? > > > On Jan 30, 3:08 am, Beres Botond wrote: > > > > You want to use POST, but you are sending your data as GET (without > > > url encoding). > > > So I'm pretty sure it cuts before "#", because # is a non-alphanumeric > > > character and you haven't urlencoded your data. > > > > Data in URL = GET, not POST, even if you are using $.post . > > > >http://docs.jquery.com/Post > > > > So either urlencode your data before putting it in the request or send > > > it as POST. > > > > Also I'm not sure how it worked for you on server-side, if you were > > > expecting $_POST... I assume you were expecting > > > $_REQUEST instead, which is not a good idea in my opinion. > > > > On Jan 30, 8:08 am, Mark Livingstone wrote: > > > > > I have the following code: > > > > > $.post(order_send_email.php?order_message='+order_message) > > > > > my 'order_message' is: > > > > > 'Dear '+data['salutation']+" "+data['first_name']+" "+data['last_name'] > > > > +', \n\nThis is to inform you that your order #'+key+" and payment in > > > > the amount of...'; > > > > > When using $.POST... the message gets cut before "#". Is there a limit > > > > on how much cam be transmitted or am I doing something wrong? > > > > > Thanks.- Hide quoted text - > > > > - Show quoted text -- Hide quoted text - > > - Show quoted text -
[jQuery] Re: $.ajax bug ?!? Maybe i've not understand somethings ....
:) in effect i've investigated but i'm not a guru of js so i need some help ... thanks. last but not least :D can you explain this code: self[callback] = window[callback]; window[callback] = (function(callback){ return function(data){ (window[callback] = self[callback])(data); delete self[callback]; clearTimeout(timer); }; })(callback); On 30 Gen, 23:57, Ricardo Tomasi wrote: > Ah, an oversight of mine. I forgot to add the parameter when rewriting > the callback. > > Fixed as you can see athttp://jsbin.com/eliwu > > Never use someone else's code without inspection ;) > > On Jan 30, 4:34 pm, Stefano Corallo wrote: > > > On 30 Gen, 19:25, Ricardo Tomasi wrote: > > > > We can't access the success function of the $.ajax call without > > > messing with jQuery source code, because the vars that name it are > > > inside the jQuery function scope. > > > ok > > > > In JSONP, the JSON object is passed as an argument to the callback > > > function. In the example I posted: > > > > jsonFlickrFeed = function(data){ //do something with data }; > > > i've tried but data is always undefined,take a look: > > >http://jsbin.com/ajimu/edit > > > > On Jan 30, 7:28 am, Stefano Corallo wrote: > > > > > On 28 Gen, 17:03, Ricardo Tomasi wrote: > > > > > > It isn't possible to have error/success callbacks for JSONP. You can't > > > > > cancel the request either. Once you add a
[jQuery] Re: 1.3 and toggle()
It looks like you're trying to use a jQuery UI effect - maybe that's why? --John 2009/1/30 gmacgregor : > > Consider this markup: > > > Foo > > Hello! > > > > Since upgrading to 1.3, this no longer works: > > $('div.holder h4').click(function() { >$(this).toggleClass('close'); >$(this).next('.bar').toggle("blind", {direction: "vertical"}, > 600); >return false; > }); > > If I simply call $(this).next('.bar').toggle("fast") instead > everything is fine. Am I completely missing something in the docs with > regards to toggle()? Any help much appreciated... >
[jQuery] 1.3 and toggle()
Consider this markup: Foo Hello! Since upgrading to 1.3, this no longer works: $('div.holder h4').click(function() { $(this).toggleClass('close'); $(this).next('.bar').toggle("blind", {direction: "vertical"}, 600); return false; }); If I simply call $(this).next('.bar').toggle("fast") instead everything is fine. Am I completely missing something in the docs with regards to toggle()? Any help much appreciated...
[jQuery] Re: jQuery Curvy Corners
Thanks, I am going to take a look at this. JRC is worth mentioning as well, it's seems to be a bit faster than curvy corners but it also breaks down with nested HTML and for some reason it's interfering with the UI Dialog call... http://jrc.meerbox.nl/?p=13&cpage=1#comment-1312 Also, any input into curvy corners would be greatly appreciated. On Jan 30, 11:07 am, Rusco wrote: > Hi, > I also tried a lot of rounded corners plug-ins and found out that each > one reveals its weakness once you begin nesting html-tags and messing > around with css. > > The only somewhat reliable rounded corners plugin is imho: > > http://labs.parkerfox.co.uk/cornerz/ > > Rusco. > > On 30 jan, 07:57, Nikola wrote: > > > I just discovered how nice jQuery Curvy Corners is. It works well in > > Firefox but only seems to work in IE7 when using jQuery 1.2.6. I did > > a quick search through the code to look for any obvious problems but I > > couldn't see any. This is a great plug-in and I'd really like to get > > it working. Any input or advice is greatly appreciated. > > >http://blue-anvil.com/jquerycurvycorners/test.html > > > Thanks, > > Nikola
[jQuery] Re: problem in removing and moving
var $fields = $('#div'); // not a good idea for an id var firstDL = $fields.find('dl:first-child')[0]; $(XXX).each(function(){ if ( $(this).prev('dl').is( firstDL ) ) blowUp(); }); or if ( $fields.index( $(this.prev('dl')[0] ) == 0 ) or if ( $(this.prev('dl')[0] == $('#div dl:first')[0] ) On Jan 30, 6:54 pm, Jack Finger wrote: > Anybody knows?
[jQuery] Re: $.ajax bug ?!? Maybe i've not understand somethings ....
Ah, an oversight of mine. I forgot to add the parameter when rewriting the callback. Fixed as you can see at http://jsbin.com/eliwu Never use someone else's code without inspection ;) On Jan 30, 4:34 pm, Stefano Corallo wrote: > On 30 Gen, 19:25, Ricardo Tomasi wrote: > > > We can't access the success function of the $.ajax call without > > messing with jQuery source code, because the vars that name it are > > inside the jQuery function scope. > > ok > > > In JSONP, the JSON object is passed as an argument to the callback > > function. In the example I posted: > > > jsonFlickrFeed = function(data){ //do something with data }; > > i've tried but data is always undefined,take a look: > > http://jsbin.com/ajimu/edit > > > On Jan 30, 7:28 am, Stefano Corallo wrote: > > > > On 28 Gen, 17:03, Ricardo Tomasi wrote: > > > > > It isn't possible to have error/success callbacks for JSONP. You can't > > > > cancel the request either. Once you add a
[jQuery] Re: callback :passing $_POST values after completing form
If you're using a straight-forward form submission, make the form action submit to a script and process it server-side. If you're doing it through AJAX, the following Jquery functions maybe of use to you: serialize() : http://docs.jquery.com/Ajax/serialize serializeArray() : http://docs.jquery.com/Ajax/serializeArray On Jan 30, 2:12 am, dimitri wrote: > i'm all new with jquery and i'm using a validator for my form from > marzapower. > > i was lucky enough to make the script detemine whether the form is > fulfilled correctly or not > whan not it sasy forgotten this or that, when correct it says i made > it. > > but i'm now struggling om how i have to pass the data to my page for > processing en INSERT/UPDATE my database > > Has anyone suggestions on how to solve this
[jQuery] Re: Having a problem with checkboxes
Which version of Jquery are you using? >From version 1.3 on has the @ in selectors deprecated, so the following is not valid anymore: $("inp...@name=paradigm]") Just remove the @. http://docs.jquery.com/Release:jQuery_1.3#Upgrading On Jan 30, 5:27 am, heohni wrote: > Hi, > > I am using this: > > > > $(document).ready(function(){ > $("#paradigm_all").click(function(){ > var > checked_status=this.checked;$("inp...@name=paradigm]").each > (function(){ > this.checked=checked_status; > }); > }); > > }); > > to check and uncheck a list of articles. > Now I want to sumbit the checked articles, but I don't know how to do > that. > > I can't use value="{$value.ver_id}" /> > as then the jquery doesn#t work anymore. > > But how can I transfer all checked Id's to the next page? > Any help? > > Thanks a bunch!
[jQuery] cfdiv and jQuery
Hi All, I have a cfdiv which is bound to a page that displays the results of a query. on the same page as the cfdiv I have a form which get submited using ColdFusion.Ajax.submitForm once the process has been finished I use ColdFusion.navigate to refresh the cfdiv to display the updated query results. Now the problem I have is im trying to select the new item in the query within a jquery function. Each row in the results is surrounded with a div with a class of .userListItem so I use $('.userListItem:eq(0)') to select the first occurence of a div with the userListItem class. This doesn't work when the item is within a cfdiv, but it does work if I put the item outside a cfdiv. Does anyone have any ideas what the problem is? Thanks, Richard
[jQuery] Re: How PHP script can return two variables ?
I prefer this JSON method also. Just remember to define the dataType as JSON! I've made mistakes many time of forgetting that and keep wondering why my JSON objects are always undefined. On Jan 30, 10:01 am, Eric Garside wrote: > That XML is a lot of unnecessary work. If you're running with PHP5, > simply print on success: > > echo json_encode(array('success' => true, message => '')); > > or on failure: > > echo json_encode(array('success' => false, message => '')); > > And for the jQuery bit: > > $.post('somurl.php', function (data){ > if (data.success){ > // Code for successful comment post > } else { > // Code for failed comment post > } > > }, 'json'); > > On Jan 30, 12:42 pm, GreatBigBore wrote: > > > Have your PHP script return an XML document, and then parse that XML > > with JQuery: > > > PHP: > > > /* > > > > > > > > */ > > $document = DOMImplementation::createDocument(); > > $document->formatOutput = true; > > $document->preserveWhitespace = true; > > > $functionResult = $document->createElement('FunctionResult'); > > $document->appendChild($functionResult); > > > $functionStatus = $document->createElement('FunctionStatus'); > > $functionResult->appendChild($functionStatus); > > > $success = true; > > $message = 'Request successful'; > > > ...Do stuff that changes $success and $message if necesssary... > > > $functionStatus->setAttribute('success', $success); > > $functionStatus->setAttribute('message', addslashes($message)); > > > // Now respond to the requestor > > Header("Content-type: text/xml", 1); > > echo $document->saveXML(); > > > Javascript: > > > $.post('http://myserver.com/ajax.php', > > { 'function' : 'getEfforts', > > 'parameter1' : something > > }, > > > function(xml) { > > /* > > > > > > > > */ > > var statusNode = $('FunctionStatus', xml).get(0); > > var success = intToBool(statusNode.getAttribute('success')); > > if(success === true) { > > } else { > > } > > } > > );
[jQuery] Re: Damn ie7!
Ok, thank you very much i got this! Also, just to know is there any site/books that specifically 'speaks' about the limitations of the various web browsers? On Jan 30, 8:31 pm, MorningZ wrote: > So what he talks about > > function showHide() { > if ($(this).val() == "1") { $('#datasingola').hide('slow'); } > > } > > and then > > value="0">Nessuno.. option>Ciao... > > takes the out of the equation, which as you are finding out, > isn't very manipulatable in IE > > On Jan 30, 1:43 pm, GreatBigBore wrote: > > > If adding a click handler in $(document).ready() doesn't work, you > > could always add a change handler to the and just check the > > value. I did this in a recent project and it works fine.
[jQuery] Re: Superfish IE6
I'm having a very similar problem. Here's a short screencast of the issue. http://screencast.com/t/ifi0GiudW First, I show how the menus are supposed to work (in Firefox), then I flip over to Internet Explorer 6. Thanks for any help anyone can provide.
re[jQuery] trieve $_POST vars after submit
this is me using jquery for the first time, and i found the following script that's working. But there is a problem on what to do now. when the required fields are filled correctly, I receive the message that it is correct... but i would like that the page is redirected, together with the inputted values to the page where i procees them en get them in my database... i tried several things but i seem not te be able resolving this... could someone give me an assist $(document).ready(function() { // First example var formValidator1 = new ValidatorClass(); formValidator1.init ( { form: "#klant", errorColors: { isRequired: 'lightgrey', isEmail:'yellow', isNumeric: 'green', isInteger: 'blue', hasRegex: 'lightgray' }, requiredFieldMsg: 'U vergat een of meerdere velden in te geven', emailFieldMsg: 'I campi in giallo devono essere email', numericFieldMsg:'I campi in verde devono contenere numeri', integerFieldMsg:'I campi in blu devono contenere valori interi', isRequired: ['naam', 'voornaam'], bindElement: '#c_klant', callback: function() { //begin alert('You have inserted all the required fields.'); //einde } } ); }); the last thing i tried was $(document).ready(function() { $("#klant").submit(function(){ $.post("jquery-ajax-post.php", { name: $("#naam").val() }); return false;// stop the form send via normal action }); }); -- View this message in context: http://www.nabble.com/retrieve-%24_POST-vars-after-submit-tp21755993s27240p21755993.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: problem in removing and moving
Anybody knows?
[jQuery] Re: jQuery + Cycle Pager Nav Issue in IE
Thanks, Mike. That was it. I appreciate the help! On Jan 30, 12:08 pm, Mike Alsup wrote: > > I'm having a weird problem where IE is adding twice as many nav pager > > elements. As you can see, the script works nicely in FF/Safari, but > > when viewed in IE, the nav gets wonky. I'm having trouble figuring it > > out, so any help is appreciated. Thanks! > > >http://70.32.114.139/bases/naval-base-kitsap-bangor > > You have bad markup: > > > alt="Naval Base Kitsap-Bangor"/> > alt="Naval Base Kitsap-Bangor"/> > alt="Naval Base Kitsap-Bangor"/> > > > Try fixing that first.
[jQuery] Re: jQuery + Cycle Pager Nav Issue in IE
> I'm having a weird problem where IE is adding twice as many nav pager > elements. As you can see, the script works nicely in FF/Safari, but > when viewed in IE, the nav gets wonky. I'm having trouble figuring it > out, so any help is appreciated. Thanks! > > http://70.32.114.139/bases/naval-base-kitsap-bangor You have bad markup: Try fixing that first.
[jQuery] jQuery + Cycle Pager Nav Issue in IE
I'm having a weird problem where IE is adding twice as many nav pager elements. As you can see, the script works nicely in FF/Safari, but when viewed in IE, the nav gets wonky. I'm having trouble figuring it out, so any help is appreciated. Thanks! http://70.32.114.139/bases/naval-base-kitsap-bangor
[jQuery] jQuery + Cycle Plugin (Duplicating Problem with Pager Anchors in IE)
I'm having an issue where the pager is building twice as many anchors as there are pics. I only have this issue in IE. The script is working great in FF/Safari. You can see the difference on the page below. Any help is appreciated. Thanks! http://70.32.114.139/bases/naval-base-kitsap-bangor (Using jQuery Cycle Plugin Version: 2.32)
[jQuery] Re: How PHP script can return two variables ?
That XML is a lot of unnecessary work. If you're running with PHP5, simply print on success: echo json_encode(array('success' => true, message => '')); or on failure: echo json_encode(array('success' => false, message => '')); And for the jQuery bit: $.post('somurl.php', function (data){ if (data.success){ // Code for successful comment post } else { // Code for failed comment post } }, 'json'); On Jan 30, 12:42 pm, GreatBigBore wrote: > Have your PHP script return an XML document, and then parse that XML > with JQuery: > > PHP: > > /* > > > > */ > $document = DOMImplementation::createDocument(); > $document->formatOutput = true; > $document->preserveWhitespace = true; > > $functionResult = $document->createElement('FunctionResult'); > $document->appendChild($functionResult); > > $functionStatus = $document->createElement('FunctionStatus'); > $functionResult->appendChild($functionStatus); > > $success = true; > $message = 'Request successful'; > > ...Do stuff that changes $success and $message if necesssary... > > $functionStatus->setAttribute('success', $success); > $functionStatus->setAttribute('message', addslashes($message)); > > // Now respond to the requestor > Header("Content-type: text/xml", 1); > echo $document->saveXML(); > > Javascript: > > $.post('http://myserver.com/ajax.php', > { 'function' : 'getEfforts', > 'parameter1' : something > }, > > function(xml) { > /* > > > > */ > var statusNode = $('FunctionStatus', xml).get(0); > var success = intToBool(statusNode.getAttribute('success')); > if(success === true) { > } else { > } > } > );
[jQuery] Re: Getting the height of a hidden div in Firefox
Oh, one other thing. If I call .css('display', 'block') on the element before using height() FF gives me the correct value of 240px. Obviously, that breaks the accordion because I want the element hidden! /me scratches head ... Rob. On Jan 30, 7:57 pm, rob303 wrote: > Thanks for the reply Eric. But what have different box models got to > do with it? I'm not setting any border or padding properties on my > hidden div that would effect the height. And the difference between > the two browsers is huge. IE says 240px and FF says 160px. I > certainly don't have 80px worth of padding on that element ... > > Rob. > > On Jan 30, 7:45 pm, Eric Garside wrote: > > > Different box models. I'd read up more on the difference between the > > IE/FF box models to point you in the right direction. I'd give you a > > quick tutorial, but I get out at 3 on Fridays! :D > > > On Jan 30, 1:52 pm, rob303 wrote: > > > > Hi, > > > > I've been working on this for days. The chaps on IRC couldn't find an > > > answer so I thought I'd post it here just in case anyone knows what's > > > going on. > > > > I have a basic accordion type feature. The designer wants to be able > > > to open more than one of hidden the sections at once ... > > > > So, here is my code: > > > > $(".accordion .accordion_header").click(function() { > > > if($(this).hasClass('accordion_selected')) { > > > $(this).removeClass('accordion_selected').next().slideUp > > > ({duration: 'slow', easing: 'easeInOutQuad'}); > > > } else { > > > $(this).addClass('accordion_selected').next().slideDown > > > ({duration: 'slow', easing: 'easeInOutQuad'}); > > > } > > > }).next().hide(); > > > > .accordion { > > > width: 97%; > > > list-style-type: none; > > > > } > > > > .accordion_header { > > > display: block; > > > height: 20px; > > > background: url(../images/bgd_accordion_off.gif) repeat-x; > > > padding: 5px 10px 0 10px; > > > > } > > > > .accordion_header:hover { > > > background: url(../images/bgd_accordion_on.gif) repeat-x; > > > color: #d7d7d9; > > > > } > > > > .accordion_selected { > > > background: url(../images/bgd_accordion_on.gif) repeat-x; > > > color: #d7d7d9; > > > > } > > > > .accordion_section { > > > display: block; > > > line-height: 20px; > > > padding: 0 10px 0 10px; > > > > } > > > > > > > > > > heading > > > > > > A bunch of text > > > > > > > > > > > > > The problem I face is that the content within the hidden div > > > (accordion_section) is db driven so I have no idea what content to put > > > in there. This means I cannot fix the height of those divs. This in > > > turn breaks the animate on the slideDown function. If I set the > > > height of the div the animate is perfect. Without it everythings all > > > jumpy and broken looking. So I figured that all I needed to do was to > > > get the height of the hidden div and then apply it using a css() > > > call. This works fine in IE but Firefox doesn't seem able to give me > > > the correct height for the div. For example if I use this code: > > > > var h = $(this).next().height(); > > > alert(h); > > > > IE gives me 240 - which correct for that particular div. But firefox > > > gives 160 for the same div! Anyone know why? > > > > Many thanks in advance for any help. > > > > Rob.
[jQuery] Re: Getting the height of a hidden div in Firefox
Thanks for the reply Eric. But what have different box models got to do with it? I'm not setting any border or padding properties on my hidden div that would effect the height. And the difference between the two browsers is huge. IE says 240px and FF says 160px. I certainly don't have 80px worth of padding on that element ... Rob. On Jan 30, 7:45 pm, Eric Garside wrote: > Different box models. I'd read up more on the difference between the > IE/FF box models to point you in the right direction. I'd give you a > quick tutorial, but I get out at 3 on Fridays! :D > > On Jan 30, 1:52 pm, rob303 wrote: > > > Hi, > > > I've been working on this for days. The chaps on IRC couldn't find an > > answer so I thought I'd post it here just in case anyone knows what's > > going on. > > > I have a basic accordion type feature. The designer wants to be able > > to open more than one of hidden the sections at once ... > > > So, here is my code: > > > $(".accordion .accordion_header").click(function() { > > if($(this).hasClass('accordion_selected')) { > > $(this).removeClass('accordion_selected').next().slideUp > > ({duration: 'slow', easing: 'easeInOutQuad'}); > > } else { > > $(this).addClass('accordion_selected').next().slideDown > > ({duration: 'slow', easing: 'easeInOutQuad'}); > > } > > }).next().hide(); > > > .accordion { > > width: 97%; > > list-style-type: none; > > > } > > > .accordion_header { > > display: block; > > height: 20px; > > background: url(../images/bgd_accordion_off.gif) repeat-x; > > padding: 5px 10px 0 10px; > > > } > > > .accordion_header:hover { > > background: url(../images/bgd_accordion_on.gif) repeat-x; > > color: #d7d7d9; > > > } > > > .accordion_selected { > > background: url(../images/bgd_accordion_on.gif) repeat-x; > > color: #d7d7d9; > > > } > > > .accordion_section { > > display: block; > > line-height: 20px; > > padding: 0 10px 0 10px; > > > } > > > > > > > heading > > > > A bunch of text > > > > > > > > > The problem I face is that the content within the hidden div > > (accordion_section) is db driven so I have no idea what content to put > > in there. This means I cannot fix the height of those divs. This in > > turn breaks the animate on the slideDown function. If I set the > > height of the div the animate is perfect. Without it everythings all > > jumpy and broken looking. So I figured that all I needed to do was to > > get the height of the hidden div and then apply it using a css() > > call. This works fine in IE but Firefox doesn't seem able to give me > > the correct height for the div. For example if I use this code: > > > var h = $(this).next().height(); > > alert(h); > > > IE gives me 240 - which correct for that particular div. But firefox > > gives 160 for the same div! Anyone know why? > > > Many thanks in advance for any help. > > > Rob.
[jQuery] Re: jquery slider- make handle clickable
Ah- nice- that makes sense- changing it to values worked- Now, is there a way to actually get the index of the handle that was clicked on? short of just figuring it out based on the start value? Thanks for all your help Richard, Mike On Jan 29, 8:22 pm, "Richard D. Worth" wrote: > On Thu, Jan 29, 2009 at 8:16 PM, m...@fonolo.com wrote: > > > So I grabbed a copy of ui.slider and ui.core from trunk, and it does > > indeed fix the issue with clicking on the handle; it is now clickable, > > and it doesn't shift around. > > Glad to hear it. > > > > > BUT > > > it seems when I have multiple handles on a slider (using values: > > [ array of integers ], but NOT using a range), while the handles are > > clickable, and both the start/stop events fire for each handle, the > > ui.value is 0? > > > maybe it's the way I've implemented it? maybe because i've got > > multiple handles on a slider, without a range setting? > > > I've also tried accessing value, not only from ui.value, but from > > > $('#slider2').slider('value', 0), and I still get 0 back as the value > > If you have multiple handles (with or without a range) you need to use the > 'values' method instead of 'value'. It's similar to 'value' except that you > need to pass an index as the first argument. For example > > //get the value of the 3rd handle > var val = $("#slider").slider('values', 2); > > //set the value of the 1st handle to 5 > $("#slider").slider('values', 0, 5); > > - Richard
[jQuery] Re: Getting the height of a hidden div in Firefox
Different box models. I'd read up more on the difference between the IE/FF box models to point you in the right direction. I'd give you a quick tutorial, but I get out at 3 on Fridays! :D On Jan 30, 1:52 pm, rob303 wrote: > Hi, > > I've been working on this for days. The chaps on IRC couldn't find an > answer so I thought I'd post it here just in case anyone knows what's > going on. > > I have a basic accordion type feature. The designer wants to be able > to open more than one of hidden the sections at once ... > > So, here is my code: > > $(".accordion .accordion_header").click(function() { > if($(this).hasClass('accordion_selected')) { > $(this).removeClass('accordion_selected').next().slideUp > ({duration: 'slow', easing: 'easeInOutQuad'}); > } else { > $(this).addClass('accordion_selected').next().slideDown > ({duration: 'slow', easing: 'easeInOutQuad'}); > } > }).next().hide(); > > .accordion { > width: 97%; > list-style-type: none; > > } > > .accordion_header { > display: block; > height: 20px; > background: url(../images/bgd_accordion_off.gif) repeat-x; > padding: 5px 10px 0 10px; > > } > > .accordion_header:hover { > background: url(../images/bgd_accordion_on.gif) repeat-x; > color: #d7d7d9; > > } > > .accordion_selected { > background: url(../images/bgd_accordion_on.gif) repeat-x; > color: #d7d7d9; > > } > > .accordion_section { > display: block; > line-height: 20px; > padding: 0 10px 0 10px; > > } > > > > heading > > A bunch of text > > > > > The problem I face is that the content within the hidden div > (accordion_section) is db driven so I have no idea what content to put > in there. This means I cannot fix the height of those divs. This in > turn breaks the animate on the slideDown function. If I set the > height of the div the animate is perfect. Without it everythings all > jumpy and broken looking. So I figured that all I needed to do was to > get the height of the hidden div and then apply it using a css() > call. This works fine in IE but Firefox doesn't seem able to give me > the correct height for the div. For example if I use this code: > > var h = $(this).next().height(); > alert(h); > > IE gives me 240 - which correct for that particular div. But firefox > gives 160 for the same div! Anyone know why? > > Many thanks in advance for any help. > > Rob.
[jQuery] Re: Damn ie7!
So what he talks about function showHide() { if ($(this).val() == "1") { $('#datasingola').hide('slow'); } } and then Nessuno..Ciao... takes the out of the equation, which as you are finding out, isn't very manipulatable in IE On Jan 30, 1:43 pm, GreatBigBore wrote: > If adding a click handler in $(document).ready() doesn't work, you > could always add a change handler to the and just check the > value. I did this in a recent project and it works fine.
[jQuery] Re: Using $_POST to transmit large key/pair
As shown in the docs (link I gave you), it should work $.post("order_send_email.php", {order_message : order_message}, // {key : variable} function(data) { alert(data); // do something }); On Jan 30, 4:03 pm, Mark Livingstone wrote: > Thanks, Beres. > > I am reading this order_message from a DIV. How do I 'POST' it? By > using form? > > Also, to url encode... do I use "escape()"? > > On Jan 30, 3:08 am, Beres Botond wrote: > > > You want to use POST, but you are sending your data as GET (without > > url encoding). > > So I'm pretty sure it cuts before "#", because # is a non-alphanumeric > > character and you haven't urlencoded your data. > > > Data in URL = GET, not POST, even if you are using $.post . > > >http://docs.jquery.com/Post > > > So either urlencode your data before putting it in the request or send > > it as POST. > > > Also I'm not sure how it worked for you on server-side, if you were > > expecting $_POST... I assume you were expecting > > $_REQUEST instead, which is not a good idea in my opinion. > > > On Jan 30, 8:08 am, Mark Livingstone wrote: > > > > I have the following code: > > > > $.post(order_send_email.php?order_message='+order_message) > > > > my 'order_message' is: > > > > 'Dear '+data['salutation']+" "+data['first_name']+" "+data['last_name'] > > > +', \n\nThis is to inform you that your order #'+key+" and payment in > > > the amount of...'; > > > > When using $.POST... the message gets cut before "#". Is there a limit > > > on how much cam be transmitted or am I doing something wrong? > > > > Thanks.- Hide quoted text - > > > - Show quoted text -
[jQuery] Re: what would be the opposite of top.frames as a jquery selector context?
it ended up being quite easy actually: $('#'+self.name, top.document).hide(); usually whenever I try to so something and it requires more than 1 line of code it's my fault, not jquery's...
[jQuery] Re: Can JQuery solve the iframe height=100% problem?
I think you're going down the wrong path - you shouldnt need to script anything to get a CSS attribute to work. usually when I run into this problem it is because somewhere in my document tree there is a parent lement that has no height attribute set. So if you have html > someDiv > anotherDiv > table > tr >td > iframe every one of the elements should have a parent with height set At least this is how I usually end up solving the dreaded height 100% problem whenever I come to it. Alternatively, you can try $('#myIframe').css({height:$(this).parent('td').height()});
[jQuery] Getting the height of a hidden div in Firefox
Hi, I've been working on this for days. The chaps on IRC couldn't find an answer so I thought I'd post it here just in case anyone knows what's going on. I have a basic accordion type feature. The designer wants to be able to open more than one of hidden the sections at once ... So, here is my code: $(".accordion .accordion_header").click(function() { if($(this).hasClass('accordion_selected')) { $(this).removeClass('accordion_selected').next().slideUp ({duration: 'slow', easing: 'easeInOutQuad'}); } else { $(this).addClass('accordion_selected').next().slideDown ({duration: 'slow', easing: 'easeInOutQuad'}); } }).next().hide(); .accordion { width: 97%; list-style-type: none; } .accordion_header { display: block; height: 20px; background: url(../images/bgd_accordion_off.gif) repeat-x; padding: 5px 10px 0 10px; } .accordion_header:hover { background: url(../images/bgd_accordion_on.gif) repeat-x; color: #d7d7d9; } .accordion_selected { background: url(../images/bgd_accordion_on.gif) repeat-x; color: #d7d7d9; } .accordion_section { display: block; line-height: 20px; padding: 0 10px 0 10px; } heading A bunch of text The problem I face is that the content within the hidden div (accordion_section) is db driven so I have no idea what content to put in there. This means I cannot fix the height of those divs. This in turn breaks the animate on the slideDown function. If I set the height of the div the animate is perfect. Without it everythings all jumpy and broken looking. So I figured that all I needed to do was to get the height of the hidden div and then apply it using a css() call. This works fine in IE but Firefox doesn't seem able to give me the correct height for the div. For example if I use this code: var h = $(this).next().height(); alert(h); IE gives me 240 - which correct for that particular div. But firefox gives 160 for the same div! Anyone know why? Many thanks in advance for any help. Rob.
[jQuery] Re: Unload issue with Firefox
Thanks, Ricardo. I'll give that a look. On Jan 30, 12:31 pm, Ricardo Tomasi wrote: > jQuery will remove all event handlers on unload to avoid memory leaks. > > You should consider event delegation, see the docs for > live():http://docs.jquery.com/Events/live > It will speed up your loading/unloading times considerably. > > cheers, > - ricardo > > On Jan 30, 2:58 pm, dberthia wrote: > > > I've got a jQuery 1.2.6 script that attaches a click handler to every > > hyperlink on a page. We have a small number of pages where the number > > of link are massive (5000+, and yes I know this is ridiculous). On > > these pages, when I try to navigate AWAY from them, Firefox will be > > unresponsive for a couple of minutes. I've determined the length of > > the delay is directly proportional to the number of my click handlers. > > I've tried 1.3.1, but have gotten only marginally better results. I > > don't see the issue in IE or Safari. Any ideas? > > > I've tried doing a manual unbind on the links in window.onunload, to > > no avail. > > > - Dave
[jQuery] Re: Damn ie7!
If adding a click handler in $(document).ready() doesn't work, you could always add a change handler to the and just check the value. I did this in a recent project and it works fine.
[jQuery] Re: Damn ie7!
I have found that IE7 is very uncooperative about nodes. I recommend that you remove onClick, and attach the click handler inside $(document).ready(). Good luck.
[jQuery] Re: $.ajax bug ?!? Maybe i've not understand somethings ....
On 30 Gen, 19:25, Ricardo Tomasi wrote: > We can't access the success function of the $.ajax call without > messing with jQuery source code, because the vars that name it are > inside the jQuery function scope. > ok > In JSONP, the JSON object is passed as an argument to the callback > function. In the example I posted: > > jsonFlickrFeed = function(data){ //do something with data }; > i've tried but data is always undefined,take a look: http://jsbin.com/ajimu/edit > On Jan 30, 7:28 am, Stefano Corallo wrote: > > > On 28 Gen, 17:03, Ricardo Tomasi wrote: > > > > It isn't possible to have error/success callbacks for JSONP. You can't > > > cancel the request either. Once you add a
[jQuery] Re: Unload issue with Firefox
jQuery will remove all event handlers on unload to avoid memory leaks. You should consider event delegation, see the docs for live(): http://docs.jquery.com/Events/live It will speed up your loading/unloading times considerably. cheers, - ricardo On Jan 30, 2:58 pm, dberthia wrote: > I've got a jQuery 1.2.6 script that attaches a click handler to every > hyperlink on a page. We have a small number of pages where the number > of link are massive (5000+, and yes I know this is ridiculous). On > these pages, when I try to navigate AWAY from them, Firefox will be > unresponsive for a couple of minutes. I've determined the length of > the delay is directly proportional to the number of my click handlers. > I've tried 1.3.1, but have gotten only marginally better results. I > don't see the issue in IE or Safari. Any ideas? > > I've tried doing a manual unbind on the links in window.onunload, to > no avail. > > - Dave
[jQuery] Re: $.ajax bug ?!? Maybe i've not understand somethings ....
We can't access the success function of the $.ajax call without messing with jQuery source code, because the vars that name it are inside the jQuery function scope. In JSONP, the JSON object is passed as an argument to the callback function. In the example I posted: jsonFlickrFeed = function(data){ //do something with data }; On Jan 30, 7:28 am, Stefano Corallo wrote: > On 28 Gen, 17:03, Ricardo Tomasi wrote: > > > It isn't possible to have error/success callbacks for JSONP. You can't > > cancel the request either. Once you add a
[jQuery] Re: validation with jquery 1.3
Have you updated to 1.5.1? http://bassistance.de/2009/01/14/releases-jquery-13-and-validation-plugin-151/ Jörn On Fri, Jan 30, 2009 at 5:17 PM, andré wrote: > > Hello, > Thanks for your fabulous validation form. > But I 've a problem.When I use jquery 1.2.6, my form works well on IE, > firefox and safari. But When I use jquery 1.3 in IE the error message > doesn't work Can you help me ? > my script : > $().ready(function() { > >// validate signup form on keyup and submit >$("#InfoClient").validate({ >rules: { >Nom : "required", >Prenom : "required", >DateNaissance : { >date: true >}, >Adresse : "required", >CodePostal : "required", >Ville :"required", >Pays : { >digits: true >}, >TelFixe: { >digits:true, >required: function(element) { >return $("#TelPort").val() <01; >} > > >}, >TelPort: { > >digits:true, >required: function(element) { >return $("#TelFixe").val() <01; >} >} >}, >messages: { >Nom :"Veuillez entrer un nom !", >Prenom :"Veuillez entrer un prénom !", >DateNaissance :"Veuillez entrer une date de naissance > sous la forme > JJ/MM/ !", >Adresse :"Veuillez une adresse !", >CodePostal :"Veuillez un code postal !", >Ville :"Veuillez entrer une ville !", >Pays :"Veuillez entrer un pays !", >TelPort :"Veuillez entrer un numéro de fixe ou de > portable à 10 > chiffres!", >TelFixe :"Veuillez entrer un numéro de fixe ou de > portable à 10 > chiffres !" >} >}); > }); >
[jQuery] Re: trouble with adding functions
Ok, well I was able to get to work, but I cant figure out now how to reduce the hover area. For some reason hovering on any part of the screen that is horizontal with the text will cause the hover event to trigger. How can I stop this? This the current jquery haddling the event $("p#makered").hover(function(){ $(this).addClass("red"); }, function() { $("p#makered").removeClass("red"); $(this).fadeOut(1000); }); }); The css handling the colors and border (which isnt showing up either): p.green { color: rgb(0,255,0); } p.red { color: rgb(255,0,0); border: 1px; } Here is the html for the text: Some text Thanks a lot for your help on this matter On Jan 30, 11:11 am, surreal5335 wrote: > I am having troubles trying to get this function to work. I got the > first part to work but trying to get the take a whole nother > action upon hover out. > > Here is the jquery I am using > > $("p#makered").hover(function(){ > $(this).addClass("red"); > }, > function() { > $("p#makered").fadeOut("slow"); > > }); > > The css works fine, but with the added jquery function changing the > text from green to red is no longer happening and firebug says I am > missing a ' ) ' after "function() {" Tried adding it just to see but > that doesnt work. Must be something else entirely. > > Any help?
[jQuery] Unload issue with Firefox
I've got a jQuery 1.2.6 script that attaches a click handler to every hyperlink on a page. We have a small number of pages where the number of link are massive (5000+, and yes I know this is ridiculous). On these pages, when I try to navigate AWAY from them, Firefox will be unresponsive for a couple of minutes. I've determined the length of the delay is directly proportional to the number of my click handlers. I've tried 1.3.1, but have gotten only marginally better results. I don't see the issue in IE or Safari. Any ideas? I've tried doing a manual unbind on the links in window.onunload, to no avail. - Dave
[jQuery] Re: How PHP script can return two variables ?
Have your PHP script return an XML document, and then parse that XML with JQuery: PHP: /* */ $document = DOMImplementation::createDocument(); $document->formatOutput = true; $document->preserveWhitespace = true; $functionResult = $document->createElement('FunctionResult'); $document->appendChild($functionResult); $functionStatus = $document->createElement('FunctionStatus'); $functionResult->appendChild($functionStatus); $success = true; $message = 'Request successful'; ...Do stuff that changes $success and $message if necesssary... $functionStatus->setAttribute('success', $success); $functionStatus->setAttribute('message', addslashes($message)); // Now respond to the requestor Header("Content-type: text/xml", 1); echo $document->saveXML(); Javascript: $.post('http://myserver.com/ajax.php', { 'function' : 'getEfforts', 'parameter1' : something }, function(xml) { /* */ var statusNode = $('FunctionStatus', xml).get(0); var success = intToBool(statusNode.getAttribute('success')); if(success === true) { } else { } } );
[jQuery] Damn ie7!
Hi to everybody, it's my first post here so it's nice to introduce myself: "my name is David, i currently live in Italy, nice to meet you all and many thank for this wonderful jquery!". I'm starting to get a grasp of jquery (i used prototype before and i find jquery a lot more easy to work with) but I'm puzzled on how this doesn't work in ie7!: $(document).ready(function(){ $('option#nascondidata').click(function() { $('#datasingola').show('slow'); return false; }); }); function showHide() { $('#datasingola').hide('slow'); } And this is the html to hide: Data Fine (lascia vuoto per campagne senza scadenza) This is the one that calls it: Nessuno..Ciao... This does work beautifully in firefox, why doesn't in ie 7? THanks!
[jQuery] Re: Condense this function
Well, it's simply a matter of choice. Using setTimeout is shorter, simpler, more readable and offers the same performance. I consider these advantages. Maybe in some other context setInterval would be a better fit, but in this case I'd go for simplicity. cheers, - ricardo On Jan 30, 3:56 am, RobG wrote: > On Jan 30, 6:57 am, Ricardo Tomasi wrote: > > > I'm not sure there is any difference in performance, > > Nor am I, who mentioned performance? It's about using the tool that's > intended for the job. > > > most animations > > use setTimeout instead of setInterval for better timing too (though > > it's irrelevant in this case). > > Cool, self-deprecating arguments are easy to respond to. > > > And it would require a bit more code. > > It would require different code - less is not always more. Here's a > setInterval version: > > (function(set) { > var i = 0, ref = setInterval(function() { > (set[i])? $(set[i++]).fadeIn(500) : clearTimeout(ref); > },100); > })( $('.sticky:hidden') ); > > which requires about 40 more characters - are programmers *that* > lazy? It can likely be more consise if I knew more about how to > access items in a jQuery object or the OP wanted to call it other than > as an anonymous function. > > The reason for suggesting setInterval is that its purpose is to run a > command at a set interval, which seems to be what the OP is after. > There seems to be a mindset with jQuery that every statement must be > written in the form $(someSelector).doStuff()... rather than looking > at individual problems and coding accordingly. Hence it seems the > more appropriate setInterval function was overlooked in order to fit > in with jQuery's coding style. > > -- > Rob
[jQuery] Re: How PHP script can return two variables ?
Very simple! Please use JSON to return JSON string! With JSON, we can return value easier than XML! With XML, you must echo correct tag=)) 2009/1/31 GreatBigBore : > > Have your PHP script return an XML document: > > PHP: > >/* > > > >*/ >$document = DOMImplementation::createDocument(); >$document->formatOutput = true; >$document->preserveWhitespace = true; > >$functionResult = $document->createElement('FunctionResult'); >$document->appendChild($functionResult); > >$functionStatus = $document->createElement('FunctionStatus'); >$functionResult->appendChild($functionStatus); > >$success = true; >$message = 'Request successful'; > > ...process the request and change $success and $message as > necessary... > >$functionStatus->setAttribute('success', $success); >$functionStatus->setAttribute('message', addslashes($message)); > >// Now respond to the requestor >Header("Content-type: text/xml", 1); >echo $document->saveXML(); >error_log($document->saveXML()); > > Javascript: > >$.post('http://' + serverName + '/ajax.php', >{ 'function' : 'getEfforts', >'parameter1' : something >}, > >function(xml) { >/* > > > >*/ >var statusNode = $('FunctionStatus', xml).get(0); >var success = > intToBool(statusNode.getAttribute('success')); >if(success === true) { >} else { >} >} >); > -- ku...@urbanjar.info / * Người ta thưởng chỉ chú ý đến những kẻ lên như diều gặp gió! Nhưng hỡi ôi, chỉ có cát, bụi và lông hồng mới là những thứ lên nhanh nhất */
[jQuery] Re: next() working in ff but not in iex
That's invalid mark-up, you can only have LIs as child elements of a list. The browser is creating a LI and putting those DIVs inside, that's why you're not finding them. Your code should be like this: Analysis Lorem Ipsum .. On Jan 30, 9:35 am, elduderino wrote: > Hi, > > I'm having a problem wit using next(). I have this code which i've built in > to a simple test page which you could run to see my problem (obviously you > need jquery included in the same directory). > > IN firefox next finds the div and I get the alert back...as expected. the > div is a sibling of the list item and so should allow me to get to the > alert. However in IEx this does not happen. > > Any ideas why? I thought jquery was supposed to deal with browser > inconsitency?! > > anyways heres my code. Thanks in advance for any replies Smile > > Code: > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";> > http://www.w3.org/1999/xhtml";> > > > Untitled Document > > > function accordion() { > var y = $('ul#accordion li'); > y.css({'color' : 'red'}) > y.click( > function() { > var current = $(this).next(); > if ((current.is('div')) && (current.is(':visible'))) { > alert('hi'); > } > } > );} > > > > > > Analysis > > Lorem Ipsum is simply dummy text of the printing and > typesetting industry. Lorem Ipsum has been the industry's standard dummy > text ever since the 1500s, when an unknown printer took a galley of type and > scrambled it to make a type specimen book. It has survived not only five > centuries, but also the leap into electronic typesetting, remaining > essentially unchanged. It was popularised in the 1960s with the release of > Letraset sheets containing Lorem Ipsum passages, and more recently with > desktop publishing software like Aldus PageMaker including versions of Lorem > Ipsum. > > Analysis > > Lorem Ipsum is simply dummy text of the printing and > typesetting industry. Lorem Ipsum has been the industry's standard dummy > text ever since the 1500s, when an unknown printer took a galley of type and > scrambled it to make a type specimen book. It has survived not only five > centuries, but also the leap into electronic typesetting, remaining > essentially unchanged. It was popularised in the 1960s with the release of > Letraset sheets containing Lorem Ipsum passages, and more recently with > desktop publishing software like Aldus PageMaker including versions of Lorem > Ipsum. > > Analysis > > Lorem Ipsum is simply dummy text of the printing and > typesetting industry. Lorem Ipsum has been the industry's standard dummy > text ever since the 1500s, when an unknown printer took a galley of type and > scrambled it to make a type specimen book. It has survived not only five > centuries, but also the leap into electronic typesetting, remaining > essentially unchanged. It was popularised in the 1960s with the release of > Letraset sheets containing Lorem Ipsum passages, and more recently with > desktop publishing software like Aldus PageMaker including versions of Lorem > Ipsum. > > Analysis > > Lorem Ipsum is simply dummy text of the printing and > typesetting industry. Lorem Ipsum has been the industry's standard dummy > text ever since the 1500s, when an unknown printer took a galley of type and > scrambled it to make a type specimen book. It has survived not only five > centuries, but also the leap into electronic typesetting, remaining > essentially unchanged. It was popularised in the 1960s with the release of > Letraset sheets containing Lorem Ipsum passages, and more recently with > desktop publishing software like Aldus PageMaker including versions of Lorem > Ipsum. > > > > accordion(); > > > > -- > View this message in > context:http://www.nabble.com/next%28%29-working-in-ff-but-not-in-iex-tp21745... > Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] trouble with adding functions
I am having troubles trying to get this function to work. I got the first part to work but trying to get the take a whole nother action upon hover out. Here is the jquery I am using $("p#makered").hover(function(){ $(this).addClass("red"); }, function() { $("p#makered").fadeOut("slow"); }); The css works fine, but with the added jquery function changing the text from green to red is no longer happening and firebug says I am missing a ' ) ' after "function() {" Tried adding it just to see but that doesnt work. Must be something else entirely. Any help?
[jQuery] Re: Form Plugin with file upload
Hi Mike, This thread seems to be similar to my problem submitted by email (subjet: about url) On 30 jan, 18:37, Mike Alsup wrote: > > No, you are not supposed to do anything at all with the iframe. The > > plugin handles all of that for you. I'll try to take a look at your > > page tomorrow. > > Well, I have to admit that I'm not sure why your page isn't working. > However, I did create a very simple test case here: > > http://jquery.malsup.com/form/file-test3.html > > This page has a file input and a text input and the form is submitted > to > > http://jquery.malsup.com/form/test-xml.php > > which you can see returns the exact same response as your server (I > think). > > Could you create a simple test case like this and run it on your > server? > > Mike
[jQuery] Re: noob question
Hi bart, let me cite from the spec: "get(): Access all matched DOM elements. This serves as a backwards- compatible way of accessing all matched elements (other than the jQuery object itself, which is, in fact, an array of elements). It is useful if you need to operate on the DOM elements themselves instead of using built-in jQuery functions." .get() returns DOM elements not a jQuery object where all the magic stuff happens. To match the first element in a jQuery you need to do: // either this $('p.fl').eq(0).css('background','red'); // or this $('p.fl').slice(0,1).css('background','red'); // or this $('p.fl:first').css('background','red'); There's a couple of other ways to do that but I guess this is enough. -- Bohdan On Jan 30, 5:31 pm, bart wrote: > Somehow I don't get the concept of get() right. The following > expression gives an error; > > $('p.fl').get(0).css('background', 'red'); > > Now what I'm trying to do here is select the first paragraph from all > the paragraphs with a class of "fl". After that I'm just trying to get > a visual id by making it red but it's more about grabbing the element > really. There's probably a very good reason why this doesn't work but > what I understand from documentation this should work? > > This ultimate goal is to hide a paragraph based on it's index. This > index is gotten from a clicked link. So far I've got this, but it's > stuck on the get() part. > > $('a.leesmeer').click(function() > { > var nmbr = $('a.leesmeer').index(this); > $('p.fl').get(nmbr).hide(); > $('div.case').get(nmbr).show(); > return false; > > });
[jQuery] Re: How PHP script can return two variables ?
Have your PHP script return an XML document: PHP: /* */ $document = DOMImplementation::createDocument(); $document->formatOutput = true; $document->preserveWhitespace = true; $functionResult = $document->createElement('FunctionResult'); $document->appendChild($functionResult); $functionStatus = $document->createElement('FunctionStatus'); $functionResult->appendChild($functionStatus); $success = true; $message = 'Request successful'; ...process the request and change $success and $message as necessary... $functionStatus->setAttribute('success', $success); $functionStatus->setAttribute('message', addslashes($message)); // Now respond to the requestor Header("Content-type: text/xml", 1); echo $document->saveXML(); error_log($document->saveXML()); Javascript: $.post('http://' + serverName + '/ajax.php', { 'function' : 'getEfforts', 'parameter1' : something }, function(xml) { /* */ var statusNode = $('FunctionStatus', xml).get(0); var success = intToBool(statusNode.getAttribute('success')); if(success === true) { } else { } } );
[jQuery] Attribute selectors different for XML than for HTML?
I ran into a problem today trying to select elements in an XML tree. I finally got it to work, but I had to make my XML handling different from my HTML handling. Can someone help me to understand whether this is a jquery bug or just a gap in my understanding? To select my desired node in my HTML document, I used this syntax: $('opti...@value="27"]') And it worked fine. Trying the same syntax on XML: $('effo...@weeknumber="5"], xml) Causes the Javascript to fail entirely. But when I remove the @ symbol: $('Effort[weekNumber="5"], xml) It works fine. Why is the syntax different for XML?
[jQuery] Re: Change URL in beforeSend
Figured out a way to do this so wanted to update with what I found. This basically cancels the initial request and creates a new one with all the same values except what you override in the extend function. By doing this, any callback functions, etc, are kept. In addition, I put in an 'if' statement because I only wanted to change certain requests based on the url. $.ajaxSetup({ beforeSend : function() { if([want to change request]) { $.ajax($.extend(this,{ type:"POST", data: { field1:[some value] }, url:[new url] } )); return false; }; } }); vtjiles wrote: > > > I have an app and want to change the url for all ajax requests to give > them a relative path. I tried to set up a global change using > ajaxSetup and beforeSend, but the url was only updated in the config, > not the request object. Any thoughts on how to do this? > > > $.ajaxSetup({ >beforeSend : function(J) { > this.url = "/newpath/" + this.url; >} > }); > > > -- View this message in context: http://www.nabble.com/Change-URL-in-beforeSend-tp20979635s27240p21752039.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: Form Plugin with file upload
> No, you are not supposed to do anything at all with the iframe. The > plugin handles all of that for you. I'll try to take a look at your > page tomorrow. Well, I have to admit that I'm not sure why your page isn't working. However, I did create a very simple test case here: http://jquery.malsup.com/form/file-test3.html This page has a file input and a text input and the form is submitted to http://jquery.malsup.com/form/test-xml.php which you can see returns the exact same response as your server (I think). Could you create a simple test case like this and run it on your server? Mike
[jQuery] Re: cancel jQuery binded event handlers
> Exactly. Does any body know how can I reach jQuery created event > object in first handler. I think this could be a solution... Event delivery order is an implementation detail so you can't be guaranteed which will fire first. However, if the a4j handler is set by the time .ready() fires you could do something like this: $(document).ready(function(){ // select the element... var a4jclick = element.onclick; element.onclick = null; $('element').click(function(e){ // do what you need to here... if ( a4j_event_handler_should_run && a4jclick ) return a4jclick.call(this, e); return whatever... }); });
[jQuery] Re: validation plugin: how to add custom messages for groups
Sorry, the third validator must only get "activated" if both are empty (in other words, it must return true if either is not empty): function validateNameInputs(value, element) { return firstNameInput.value || lastNameInput.value; } On Jan 30, 11:19 am, Mihai Danila wrote: > There was a small typo in validateLastNameInput. Here's the corrected > code. > > > > jQuery.validator.addMethod('first-name-input', validateFirstNameInput, > 'First name is missing.'); > jQuery.validator.addMethod('last-name-input', validateLastNameInput, > 'Last name is missing.'); > jQuery.validator.addMethod('name-input', validateNameInputs, 'First > and Last name are missing.'); > var firstNameInput = document.getElementById('firstNameInput'); > var lastNameInput = document.getElementById('lastNameInput'); > function validateFirstNameInput(value, element) { return ! > lastNameInput.value || value; } // 1 > function validateLastNameInput(value, element) { return ! > firstNameInput.value || value; } // 2 > function validateNameInputs(value, element) { return > firstNameInput.value && lastNameInput.value; } // 3 > > On Jan 30, 11:18 am, Mihai Danila wrote: > > > I think you can put three validators on the fields, with > > jQuery.validator.addMethod. I don't know if you can add multiple > > validators for the same CSS class, so I'm putting extra CSS classes on > > the inputs: > > > > > > > jQuery.validator.addMethod('first-name-input', validateFirstNameInput, > > 'First name is missing.'); > > jQuery.validator.addMethod('last-name-input', validateLastNameInput, > > 'Last name is missing.'); > > jQuery.validator.addMethod('name-input', validateNameInputs, 'First > > and Last name are missing.'); > > > var firstNameInput = document.getElementById('firstNameInput'); > > var lastNameInput = document.getElementById('lastNameInput'); > > function validateFirstNameInput(value, element) { return ! > > lastNameInput.value || value; } // 1 > > function validateLastNameInput(value, element) { return > > firstNameInput.value || value; } // 2 > > function validateNameInputs(value, element) { return > > firstNameInput.value && lastNameInput.value; } // 3 > > > Validator #1 will always run for the first name input, but will choose > > to never display a message as long as the last name input is empty. If > > the last name input is not empty, then this validator will actually > > check the given value (the value of the first name input) and validate > > accordingly. > > > Validator #2 is in a similar situation. > > > Validator #3 will display an error only if both are empty. > > > Think of them as working together to only activate the errors when > > only a subset of the possible conditions get applied. > > > I'm looking for a way to do this with a single validator myself. I > > have dynamic forms and more complex situations, so I can't employ this > > solution. If anyone knows how to do it, please don't hesitate to put > > it in. > > > Mihai > > > On Jan 5, 4:26 pm, claudes wrote: > > > > i have a group that contains both first and last name. i'm wondering if > > > it is > > > possible to have custom messages for groups. i'm trying to achieve > > > something > > > to the following: > > > > a. if both first and last name are not filled in: First and Last name are > > > Required > > > b. if only first is filled in: last name is required > > > c. if only last is filled in: first name is required > > > > is this possible? > > > -- > > > View this message in > > > context:http://www.nabble.com/validation-plugin%3A-how-to-add-custom-messages... > > > Sent from the jQuery General Discussion mailing list archive at > > > Nabble.com.
[jQuery] [autocomplete] making it work with JSON web service data source
I'm trying to replace a MS AJAX.NET autocomplete control with something a bit lighter and more cache-and-compress friendly and I really love how smoothly the Autocomplete plug-in generally works (http://bassistance.de/jquery-plugins/jquery-plugin-autocomplete/). I had to change a couple of things to make it work with our JSON-service- based design: 1) Our application is using web services serialized to JSON and it's working great up until the autocomplete. You can read about the general methodology thanks to Dave over at http://encosia.com/2008/03/27/using-jquery-to-consume-aspnet-json-web-services/. To get around that for proof-of-concept purposes, I went into Autocompleter.request and replaced the existing AJAX call with $.ajax({ type: "POST", url: "ajaxProxy.asmx/TagAutocomplete", data: '{ "prefixText" : "' + lastWord(term) + '", "count" : ' + options.max + '}', contentType: "application/json; charset=utf-8", dataType: "json", success: function(msg) { var mashed = options.parse && options.parse (msg.d) || parse(msg.d); cache.add(term, mashed); success(term, mashed); } }); and altered parse() to just take an array instead of a delimited string (var rows = data; // = data.split("\n");). Now we're currently just returning an array of strings, so this is no problem for us (so long as a user doesn't stick a | or " in terms, though that can likely be modded out as well). Question at this point: Is there a simpler way to get the same JSON callback out of Autocomplete? If not, given the above, can it be added to the official source? 2) Given the above, there was an odd behavior in starting a new term in a multiple-term box -- toss in a ", " and the correct form of the previous term shows up ready to be auto-completed. I fixed that by eliminating the "0-character word" check (//if ($.trim(value))) in trimWords such that an empty string can go into the array. It was a quick fix, but I'm not sure how solid -- the core symptom appears to be that lastWord is treating a 0-length word as not a word and instead skipping to the previous word when onChange is figuring out what to suggest autocompletes. Question at this point: Did I find a bug? If so, is eliminating that length-check when making an array of terms the most effective way of dealing with it? If so, is this something that will be patched in the near future? Thanks!
[jQuery] Large images IE ready event
In IE 6 through 8, whenever I use $(document).ready(function(){ });, it doesn't get triggered if there are still images trying to load. I use a graphic engine to draw huge graphs and it can take up to 5 seconds parsing the images and the code between the ready event doesnt get triggered until the images are fully loaded. It works flawlessly in Firefox. Only IE6-8 has this problem. Is there something I am missing in my code? Is this a known issue with IE? Thanks.
[jQuery] Re: jQuery Curvy Corners
Hi, I also tried a lot of rounded corners plug-ins and found out that each one reveals its weakness once you begin nesting html-tags and messing around with css. The only somewhat reliable rounded corners plugin is imho: http://labs.parkerfox.co.uk/cornerz/ Rusco. On 30 jan, 07:57, Nikola wrote: > I just discovered how nice jQuery Curvy Corners is. It works well in > Firefox but only seems to work in IE7 when using jQuery 1.2.6. I did > a quick search through the code to look for any obvious problems but I > couldn't see any. This is a great plug-in and I'd really like to get > it working. Any input or advice is greatly appreciated. > > http://blue-anvil.com/jquerycurvycorners/test.html > > Thanks, > Nikola
[jQuery] How PHP script can return two variables ?
I use jQuery $.ajax to submit user comment to a PHP Script. The PHP script validate the user data, if it is OK, user comment is written to mysql database. If not it will show error message. Now the script print error message and success message same way. I need PHP script pass one more value, to identify it is an error or success message. If it is success, i need to remove the comment box.
[jQuery] validation with jquery 1.3
Hello, Thanks for your fabulous validation form. But I 've a problem.When I use jquery 1.2.6, my form works well on IE, firefox and safari. But When I use jquery 1.3 in IE the error message doesn't work Can you help me ? my script : $().ready(function() { // validate signup form on keyup and submit $("#InfoClient").validate({ rules: { Nom : "required", Prenom : "required", DateNaissance : { date: true }, Adresse : "required", CodePostal : "required", Ville :"required", Pays : { digits: true }, TelFixe: { digits:true, required: function(element) { return $("#TelPort").val() <01; } }, TelPort: { digits:true, required: function(element) { return $("#TelFixe").val() <01; } } }, messages: { Nom :"Veuillez entrer un nom !", Prenom :"Veuillez entrer un prénom !", DateNaissance :"Veuillez entrer une date de naissance sous la forme JJ/MM/ !", Adresse :"Veuillez une adresse !", CodePostal :"Veuillez un code postal !", Ville :"Veuillez entrer une ville !", Pays :"Veuillez entrer un pays !", TelPort :"Veuillez entrer un numéro de fixe ou de portable à 10 chiffres!", TelFixe :"Veuillez entrer un numéro de fixe ou de portable à 10 chiffres !" } }); });
[jQuery] noob question
Somehow I don't get the concept of get() right. The following expression gives an error; $('p.fl').get(0).css('background', 'red'); Now what I'm trying to do here is select the first paragraph from all the paragraphs with a class of "fl". After that I'm just trying to get a visual id by making it red but it's more about grabbing the element really. There's probably a very good reason why this doesn't work but what I understand from documentation this should work? This ultimate goal is to hide a paragraph based on it's index. This index is gotten from a clicked link. So far I've got this, but it's stuck on the get() part. $('a.leesmeer').click(function() { var nmbr = $('a.leesmeer').index(this); $('p.fl').get(nmbr).hide(); $('div.case').get(nmbr).show(); return false; });
[jQuery] Re: [treeview]
exactly the point.. the file is there...its just being blocked or something but the webhost... On Fri, Jan 30, 2009 at 9:11 PM, Jörn Zaefferer < joern.zaeffe...@googlemail.com> wrote: > > The jquery.cookie.js file is missing. You didn't upload it, or it > links to the wrong location. > > Jörn > > On Fri, Jan 30, 2009 at 3:48 PM, himanshu khatri > wrote: > > jorn didnt quiet get what you meant... > > the only hint i have found is > > http://drupal.org/node/271463 > > > > i hope this helps others aswell who have > > this error>> > > $.cookie is not a function > > > > > > > > On Fri, Jan 30, 2009 at 7:30 PM, Jörn Zaefferer > > wrote: > >> > >> See http://www.trinityindia.org/jquery.cookie.js > >> > >> Jörn > >> > >> On Fri, Jan 30, 2009 at 11:05 AM, kryptos > >> wrote: > >> > > >> > Greets ... > >> > > >> > when i run the tree~menu locally .it works like a breeze. > >> > when i load it up on the webserverit freezes.firebug tells me > >> > the error is at line 176 in >> jquery.treeview.js > >> > > >> > the code in that line is >> > >> > var stored = $.cookie(settings.cookieId); > >> > > >> > the error is >> > >> > $.cookie is not a function > >> > > >> > URL>> > >> > www.trinityindia.org > >> > > >> > the error persists in all the browsers.3 days down alreadyhave > >> > no clue... > >> > > >> > do help :) > >> > > >> > > >> > > >> > > >> > > > > > > > > > -- > > Cheers and Greets > > > > M e d i a s h a l a > > > > Himanshu Khatri > > National Design Business Incubatee - (NDBI) > > NID, Paldi, > > Ahmedabad 380 007, India. > > Phone:(079) 2662 3692 (extn - 5008) > > Mo:+91 9725111531 > > @: himanshu1kha...@gmail.com > > himan...@mediashala.com > > Skype:himanshu1khatri > > > -- Cheers and Greets M e d i a s h a l a Himanshu Khatri National Design Business Incubatee - (NDBI) NID, Paldi, Ahmedabad 380 007, India. Phone:(079) 2662 3692 (extn - 5008) Mo:+91 9725111531 @: himanshu1kha...@gmail.com himan...@mediashala.com Skype:himanshu1khatri
[jQuery] Re: validation plugin: how to add custom messages for groups
There was a small typo in validateLastNameInput. Here's the corrected code. jQuery.validator.addMethod('first-name-input', validateFirstNameInput, 'First name is missing.'); jQuery.validator.addMethod('last-name-input', validateLastNameInput, 'Last name is missing.'); jQuery.validator.addMethod('name-input', validateNameInputs, 'First and Last name are missing.'); var firstNameInput = document.getElementById('firstNameInput'); var lastNameInput = document.getElementById('lastNameInput'); function validateFirstNameInput(value, element) { return ! lastNameInput.value || value; } // 1 function validateLastNameInput(value, element) { return ! firstNameInput.value || value; }// 2 function validateNameInputs(value, element) { return firstNameInput.value && lastNameInput.value; } // 3 On Jan 30, 11:18 am, Mihai Danila wrote: > I think you can put three validators on the fields, with > jQuery.validator.addMethod. I don't know if you can add multiple > validators for the same CSS class, so I'm putting extra CSS classes on > the inputs: > > > > jQuery.validator.addMethod('first-name-input', validateFirstNameInput, > 'First name is missing.'); > jQuery.validator.addMethod('last-name-input', validateLastNameInput, > 'Last name is missing.'); > jQuery.validator.addMethod('name-input', validateNameInputs, 'First > and Last name are missing.'); > > var firstNameInput = document.getElementById('firstNameInput'); > var lastNameInput = document.getElementById('lastNameInput'); > function validateFirstNameInput(value, element) { return ! > lastNameInput.value || value; } // 1 > function validateLastNameInput(value, element) { return > firstNameInput.value || value; } // 2 > function validateNameInputs(value, element) { return > firstNameInput.value && lastNameInput.value; } // 3 > > Validator #1 will always run for the first name input, but will choose > to never display a message as long as the last name input is empty. If > the last name input is not empty, then this validator will actually > check the given value (the value of the first name input) and validate > accordingly. > > Validator #2 is in a similar situation. > > Validator #3 will display an error only if both are empty. > > Think of them as working together to only activate the errors when > only a subset of the possible conditions get applied. > > I'm looking for a way to do this with a single validator myself. I > have dynamic forms and more complex situations, so I can't employ this > solution. If anyone knows how to do it, please don't hesitate to put > it in. > > Mihai > > On Jan 5, 4:26 pm, claudes wrote: > > > i have a group that contains both first and last name. i'm wondering if it > > is > > possible to have custom messages for groups. i'm trying to achieve something > > to the following: > > > a. if both first and last name are not filled in: First and Last name are > > Required > > b. if only first is filled in: last name is required > > c. if only last is filled in: first name is required > > > is this possible? > > -- > > View this message in > > context:http://www.nabble.com/validation-plugin%3A-how-to-add-custom-messages... > > Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: validation plugin: how to add custom messages for groups
I think you can put three validators on the fields, with jQuery.validator.addMethod. I don't know if you can add multiple validators for the same CSS class, so I'm putting extra CSS classes on the inputs: jQuery.validator.addMethod('first-name-input', validateFirstNameInput, 'First name is missing.'); jQuery.validator.addMethod('last-name-input', validateLastNameInput, 'Last name is missing.'); jQuery.validator.addMethod('name-input', validateNameInputs, 'First and Last name are missing.'); var firstNameInput = document.getElementById('firstNameInput'); var lastNameInput = document.getElementById('lastNameInput'); function validateFirstNameInput(value, element) { return ! lastNameInput.value || value; } // 1 function validateLastNameInput(value, element) { return firstNameInput.value || value; }// 2 function validateNameInputs(value, element) { return firstNameInput.value && lastNameInput.value; } // 3 Validator #1 will always run for the first name input, but will choose to never display a message as long as the last name input is empty. If the last name input is not empty, then this validator will actually check the given value (the value of the first name input) and validate accordingly. Validator #2 is in a similar situation. Validator #3 will display an error only if both are empty. Think of them as working together to only activate the errors when only a subset of the possible conditions get applied. I'm looking for a way to do this with a single validator myself. I have dynamic forms and more complex situations, so I can't employ this solution. If anyone knows how to do it, please don't hesitate to put it in. Mihai On Jan 5, 4:26 pm, claudes wrote: > i have a group that contains both first and last name. i'm wondering if it is > possible to have custom messages for groups. i'm trying to achieve something > to the following: > > a. if both first and last name are not filled in: First and Last name are > Required > b. if only first is filled in: last name is required > c. if only last is filled in: first name is required > > is this possible? > -- > View this message in > context:http://www.nabble.com/validation-plugin%3A-how-to-add-custom-messages... > Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: [jquery.form.js v2.18] file upload field and standard fields
I replace my code by this one: "; var_dump($_POST); ?> and the result is: VAR DUMP:array(3) { ["nom"]=> string(0) "" ["prenom"]=> string(0) "" ["MAX_FILE_SIZE"]=> string(6) "10" } File: 2.gif (6160 bytes)VAR DUMP:array(3) { ["nom"]=> string(0) "" ["prenom"]=> string(0) "" ["MAX_FILE_SIZE"]=> string(6) "10" } File: 2.gif (6160 bytes)VAR DUMP:array(3) { ["nom"]=> string(0) "" ["prenom"]=> string(0) "" ["MAX_FILE_SIZE"]=> string(6) "10" } File: 2.gif (6160 bytes) On 30 jan, 01:34, l...@onsight.ie wrote: > Might just be a typo, but just in case - it should be $_POST > > > > > What does the error field say? And I'm pretty sure that MAX_FILE_SIZE > > must come immediately before your file input element. > > > Also, are you sure the file is within your upload limit? > > > On Thu, Jan 29, 2009 at 1:01 PM,phicarre wrote: > > >> jquery.form.js v2.18 > > >> I have a form with a lot of fields and one upload file field: > > >> > >> > > >> > >> Nom: >> name='nom' /> > >> Prénom: >> id="prenom" name="prenom" /> > >> Photo: >> id="photo" name="photo" /> > >> > >> > >> > > >> $('#form1').ajaxSubmit( > >> { > >> type: 'POST', > >> url: 'create.php', > >> beforeSubmit: showRequest , > >> success: function(msg) {}, > >> error: function(requete,iderror) {alert(iderror);} > >> } > >> ); > > >> In create.php, the $_FILES is correct (name,size,type,tmp name,error) > >> BUT the $POST is empty ! > >> Why ?
[jQuery] Re: Jquery remove dd problem
Yes. That was the problem. After I did post it here, I did realize the dumb mistake I've done :ninja: Thanks a lot for the reply! amuhlou wrote: > > > It looks like $("#list_sucesso dt dd").remove(); is the problem. The > way you've written the selector, it would look inside the for the > to remove. > > $("#list_successo dl dd").remove(); should get the one you're after. > > > > > -- View this message in context: http://www.nabble.com/Jquery-remove-dd-problem-tp21747270s27240p21749870.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: All is well except in IE - links initially not clickable
Hi, Yes, I'm using the bind() method with 'click'. Is that the correct approach? Precar. On Jan 28, 9:47 am, amuhlou wrote: > It looks like it's not appending the "selected" class to the li > onClick in IE7. Are you using the bind() method to apply the click > functionality? > > On Jan 28, 10:34 am, precar wrote: > > > > > Hi, > > > My site (http://pthesis.com) works fine in Firefox/Opera/Safari, but > > inIE7 there is a small hitch. Sometimes when I click the portfolio > > link and open it, the links to the sites in the left column aren't > > clickable. If I close it and re-open it, they work, and if I do > > "Refine by category" and then click, they work. > > > As I mentioned, this only happens inIE7. I've tested inIE8 beta 2 > > and it works fine. > > > Does anyone have any suggestions for a workaround? If it would be > > helpful I'll post the page code here, or you may view it directly from > > the site. > > > Thanks for your help, > > Precar.- Hide quoted text - > > - Show quoted text -
[jQuery] Re: Having a problem with checkboxes
Does it work, to write all checked id's into a hidden field? Which then gets submitted? On 30 Jan., 16:27, heohni wrote: > Hi, > > I am using this: > > > > $(document).ready(function(){ > $("#paradigm_all").click(function(){ > var > checked_status=this.checked;$("inp...@name=paradigm]").each > (function(){ > this.checked=checked_status; > }); > }); > > }); > > to check and uncheck a list of articles. > Now I want to sumbit the checked articles, but I don't know how to do > that. > > I can't use value="{$value.ver_id}" /> > as then the jquery doesn#t work anymore. > > But how can I transfer all checked Id's to the next page? > Any help? > > Thanks a bunch!
[jQuery] Re: changing value of hidden input
Anyone? I've been playing around with it, and the following will work if I want to set the hidden value to "test"... $("#account").result(function(event, data, formatted) { $("#account_value").val("test"); }); ...but I'm still not sure how to get the value from the "id" key value of the selected row in the array. Does that make sense? (If I select "Account One" from the auto-complete, I want the value of my hidden input to be "0001".)
[jQuery] Re: [treeview]
The jquery.cookie.js file is missing. You didn't upload it, or it links to the wrong location. Jörn On Fri, Jan 30, 2009 at 3:48 PM, himanshu khatri wrote: > jorn didnt quiet get what you meant... > the only hint i have found is > http://drupal.org/node/271463 > > i hope this helps others aswell who have > this error>> > $.cookie is not a function > > > > On Fri, Jan 30, 2009 at 7:30 PM, Jörn Zaefferer > wrote: >> >> See http://www.trinityindia.org/jquery.cookie.js >> >> Jörn >> >> On Fri, Jan 30, 2009 at 11:05 AM, kryptos >> wrote: >> > >> > Greets ... >> > >> > when i run the tree~menu locally .it works like a breeze. >> > when i load it up on the webserverit freezes.firebug tells me >> > the error is at line 176 in >> jquery.treeview.js >> > >> > the code in that line is >> >> > var stored = $.cookie(settings.cookieId); >> > >> > the error is >> >> > $.cookie is not a function >> > >> > URL>> >> > www.trinityindia.org >> > >> > the error persists in all the browsers.3 days down alreadyhave >> > no clue... >> > >> > do help :) >> > >> > >> > >> > >> > > > > > -- > Cheers and Greets > > M e d i a s h a l a > > Himanshu Khatri > National Design Business Incubatee - (NDBI) > NID, Paldi, > Ahmedabad 380 007, India. > Phone:(079) 2662 3692 (extn - 5008) > Mo:+91 9725111531 > @: himanshu1kha...@gmail.com > himan...@mediashala.com > Skype:himanshu1khatri >
[jQuery] Having a problem with checkboxes
Hi, I am using this: $(document).ready(function(){ $("#paradigm_all").click(function(){ var checked_status=this.checked;$("inp...@name=paradigm]").each (function(){ this.checked=checked_status; }); }); }); to check and uncheck a list of articles. Now I want to sumbit the checked articles, but I don't know how to do that. I can't use as then the jquery doesn#t work anymore. But how can I transfer all checked Id's to the next page? Any help? Thanks a bunch!
[jQuery] Initial Event Registration
Hi, Is there a plugin kicking around anywhere that would let me declare events on object in a more declarative manner eg instead of $('#button1').click(function(){..}).blur(function(){...}) $('#button2').click(function(){..}) etc etc $('#button3').click(function(){..}) Doing it this way $.register( '#button1:click' : function(){...}, '#button1:blur : function(){...}, '#button2:click' : function(){...} '#button3:click' : function(){...} ) or $.register( '#button1' :{ click:function(){...} blur:function(){...} } '#button2:click' : function(){...} '#button3:click' : function(){...} ) Anyone know of something like this? James This e-mail is intended solely for the addressee and is strictly confidential; if you are not the addressee please destroy the message and all copies. Any opinion or information contained in this email or its attachments that does not relate to the business of Kainos is personal to the sender and is not given by or endorsed by Kainos. Kainos is the trading name of Kainos Software Limited, registered in Northern Ireland under company number: NI19370, having its registered offices at: Kainos House, 4-6 Upper Crescent, Belfast, BT7 1NT, Northern Ireland. Registered in the UK for VAT under number: 454598802 and registered in Ireland for VAT under number: 9950340E. This email has been scanned for all known viruses by MessageLabs but is not guaranteed to be virus free; further terms and conditions may be found on our website - www.kainos.com
[jQuery] Re: [treeview]
jorn didnt quiet get what you meant... the only hint i have found is http://drupal.org/node/271463 i hope this helps others aswell who have this error>> $.cookie is not a function On Fri, Jan 30, 2009 at 7:30 PM, Jörn Zaefferer < joern.zaeffe...@googlemail.com> wrote: > > See http://www.trinityindia.org/jquery.cookie.js > > Jörn > > On Fri, Jan 30, 2009 at 11:05 AM, kryptos > wrote: > > > > Greets ... > > > > when i run the tree~menu locally .it works like a breeze. > > when i load it up on the webserverit freezes.firebug tells me > > the error is at line 176 in >> jquery.treeview.js > > > > the code in that line is >> > > var stored = $.cookie(settings.cookieId); > > > > the error is >> > > $.cookie is not a function > > > > URL>> > > www.trinityindia.org > > > > the error persists in all the browsers.3 days down alreadyhave > > no clue... > > > > do help :) > > > > > > > > > > > -- Cheers and Greets M e d i a s h a l a Himanshu Khatri National Design Business Incubatee - (NDBI) NID, Paldi, Ahmedabad 380 007, India. Phone:(079) 2662 3692 (extn - 5008) Mo:+91 9725111531 @: himanshu1kha...@gmail.com himan...@mediashala.com Skype:himanshu1khatri
[jQuery] Re: Jquery remove dd problem
It looks like $("#list_sucesso dt dd").remove(); is the problem. The way you've written the selector, it would look inside the for the to remove. $("#list_successo dl dd").remove(); should get the one you're after.
[jQuery] Editable new feature $(selector).editable('disable')
This new version of editable supports $(selector).editable(options) $(selector).editable('disable') $(selector).editable('enable') $(selector).editable('destroy') for more information check: http://arashkarimzadeh.com/index.php/jquery/7-editable-jquery-plugin.html or read how to extend for supporting more types here: http://arashkarimzadeh.com/index.php/jquery/9-how-to-extend-jquery-editable.html
[jQuery] Re: High Point Village Website
Thanks mcologne, appreciated. On Jan 30, 2:09 pm, mcologne wrote: > nice work, i like it! > > without going into details of programming, the site differs from that > classic style often seen > nowadays on many websites... > > you know what i mean... buttons, tabs... > > i like the big graphics in the backgrounds... > > best regards m > cologne > > On Jan 30, 2:38 pm, kim3er wrote: > > > Thanks for your feedback. > > > With this project we wanted to create something that was interesting > > to but still functional without reliance on either JS or Flash. The > > end result, I hope, is a website that is functional and fully styled > > without JS turned on. With JS turned on, the site becomes more > > interactive and hopefully more engaging. For users with Flash 9 or > > above, more functionality is exposed, for example music, animated > > tooltips and the red people. What we didn't want was for any of the > > functionality to be dependant on Flash, that's where we draw the line. > > > In hindsight the home page scroll would have been a lot smoother and > > consistent across browsers, if done in Flash. That said, I'm still > > very happy with the result. > > > I'm not sure what you mean by the "background fades" bug, but I have > > discovered the random woman between animations. Thanks again. > > > Rich > > > On Jan 29, 9:33 pm, Ricardo Tomasi wrote: > > > > I also had that problem. Sometimes I hover a + and it doesn't slide > > > down. Also experiencied two other bugs: > > > - when you click the + button, the background fades from black again > > > - inside a section like 'bar' or 'boutique hotel', when I click > > > another section (gym/pool/etc), an unrelated image flashes in the > > > background (a woman laying back in a chair) > > > > Very nice design. Do you develop in Flash too? Was it worth the extra > > > work to do it all in JS? > > > > cheers, > > > - ricardo > > > > On Jan 29, 6:54 pm, David Meiser wrote: > > > > > It has a nice user experience. However, you might want to think about > > > > the > > > > hoverintent plugin - things seemed "shaky" when I tried to click on > > > > them (eg > > > > - the animation kept moving when I wanted to hover over an item) in FF3. > > > > > On Thu, Jan 29, 2009 at 12:58 PM, kim3er wrote: > > > > > > Hi, > > > > > > I've just finished working on a new web site using jQuery 1.3.1 and > > > > > would appreciate feedback. > > > > > >http://www.highpointvillage.co.uk/ > > > > > > Rich
[jQuery] Re: High Point Village Website
Thanks for your feedback. With this project we wanted to create something that was interesting to but still functional without reliance on either JS or Flash. The end result, I hope, is a website that is functional and fully styled without JS turned on. With JS turned on, the site becomes more interactive and hopefully more engaging. For users with Flash 9 or above, more functionality is exposed, for example music, animated tooltips and the red people. What we didn't want was for any of the functionality to be dependant on Flash, that's where we draw the line. In hindsight the home page scroll would have been a lot smoother and consistent across browsers, if done in Flash. That said, I'm still very happy with the result. I'm not sure what you mean by the "background fades" bug, but I have discovered the random woman between animations. Thanks again. Rich On Jan 29, 9:33 pm, Ricardo Tomasi wrote: > I also had that problem. Sometimes I hover a + and it doesn't slide > down. Also experiencied two other bugs: > - when you click the + button, the background fades from black again > - inside a section like 'bar' or 'boutique hotel', when I click > another section (gym/pool/etc), an unrelated image flashes in the > background (a woman laying back in a chair) > > Very nice design. Do you develop in Flash too? Was it worth the extra > work to do it all in JS? > > cheers, > - ricardo > > On Jan 29, 6:54 pm, David Meiser wrote: > > > It has a nice user experience. However, you might want to think about the > > hoverintent plugin - things seemed "shaky" when I tried to click on them (eg > > - the animation kept moving when I wanted to hover over an item) in FF3. > > > On Thu, Jan 29, 2009 at 12:58 PM, kim3er wrote: > > > > Hi, > > > > I've just finished working on a new web site using jQuery 1.3.1 and > > > would appreciate feedback. > > > >http://www.highpointvillage.co.uk/ > > > > Rich
[jQuery] Re: High Point Village Website
nice work, i like it! without going into details of programming, the site differs from that classic style often seen nowadays on many websites... you know what i mean... buttons, tabs... i like the big graphics in the backgrounds... best regards m cologne On Jan 30, 2:38 pm, kim3er wrote: > Thanks for your feedback. > > With this project we wanted to create something that was interesting > to but still functional without reliance on either JS or Flash. The > end result, I hope, is a website that is functional and fully styled > without JS turned on. With JS turned on, the site becomes more > interactive and hopefully more engaging. For users with Flash 9 or > above, more functionality is exposed, for example music, animated > tooltips and the red people. What we didn't want was for any of the > functionality to be dependant on Flash, that's where we draw the line. > > In hindsight the home page scroll would have been a lot smoother and > consistent across browsers, if done in Flash. That said, I'm still > very happy with the result. > > I'm not sure what you mean by the "background fades" bug, but I have > discovered the random woman between animations. Thanks again. > > Rich > > On Jan 29, 9:33 pm, Ricardo Tomasi wrote: > > > I also had that problem. Sometimes I hover a + and it doesn't slide > > down. Also experiencied two other bugs: > > - when you click the + button, the background fades from black again > > - inside a section like 'bar' or 'boutique hotel', when I click > > another section (gym/pool/etc), an unrelated image flashes in the > > background (a woman laying back in a chair) > > > Very nice design. Do you develop in Flash too? Was it worth the extra > > work to do it all in JS? > > > cheers, > > - ricardo > > > On Jan 29, 6:54 pm, David Meiser wrote: > > > > It has a nice user experience. However, you might want to think about the > > > hoverintent plugin - things seemed "shaky" when I tried to click on them > > > (eg > > > - the animation kept moving when I wanted to hover over an item) in FF3. > > > > On Thu, Jan 29, 2009 at 12:58 PM, kim3er wrote: > > > > > Hi, > > > > > I've just finished working on a new web site using jQuery 1.3.1 and > > > > would appreciate feedback. > > > > >http://www.highpointvillage.co.uk/ > > > > > Rich
[jQuery] Re: Using $_POST to transmit large key/pair
Thanks, Beres. I am reading this order_message from a DIV. How do I 'POST' it? By using form? Also, to url encode... do I use "escape()"? On Jan 30, 3:08 am, Beres Botond wrote: > You want to use POST, but you are sending your data as GET (without > url encoding). > So I'm pretty sure it cuts before "#", because # is a non-alphanumeric > character and you haven't urlencoded your data. > > Data in URL = GET, not POST, even if you are using $.post . > > http://docs.jquery.com/Post > > So either urlencode your data before putting it in the request or send > it as POST. > > Also I'm not sure how it worked for you on server-side, if you were > expecting $_POST... I assume you were expecting > $_REQUEST instead, which is not a good idea in my opinion. > > On Jan 30, 8:08 am, Mark Livingstone wrote: > > > > > I have the following code: > > > $.post(order_send_email.php?order_message='+order_message) > > > my 'order_message' is: > > > 'Dear '+data['salutation']+" "+data['first_name']+" "+data['last_name'] > > +', \n\nThis is to inform you that your order #'+key+" and payment in > > the amount of...'; > > > When using $.POST... the message gets cut before "#". Is there a limit > > on how much cam be transmitted or am I doing something wrong? > > > Thanks.- Hide quoted text - > > - Show quoted text -
[jQuery] Re: Problem with superfish example
Cheers I think my IE6 problem was due to not having the right path to jquery specified in the tag too. So using IE7 fixed that as a side- effect. I might have a Z index problem to ask shortly, but I'll save that for a time other than 1am :) On Jan 30, 9:58 pm, Joel Birch wrote: > Hi Kieren, > > Note that if you browse to the example.html online, what you are > seeing in the browsers that the menu does appear to work in is a CSS- > only menu, as the paths to the JS files are set to be correct only > when example.html is viewed from within the zip file's main folder. > What you are seeing in IE6 is due to that browser not being capable of > displaying CSS-only dropdowns. > > I have now changed the paths so that example.html works correctly when > browsed to online. I hope this avoids further confusion. Thanks for > the feedback. > > Joel Birch.
[jQuery] Re: validate the field, but not required
Using the validation plugin (http://bassistance.de/jquery-plugins/jquery-plugin-validation/), just specify rules for fields, but leave out required: jQuery.validator.addMethod("lettersonly", function(value, element) { return this.optional(element) || /^[a-z]+$/i.test(value); }, "Letters only please"); $("#myform").validate({ rules: { firstname: { lettersonly: true } } }); Jörn On Fri, Jan 30, 2009 at 9:08 AM, scvinodkumar wrote: > > hi there, > > i found jquery is very useful to validate to html page. Thanks for > all your effort. > > Now i want to validate the form but they are not required. only if the > text box or other field needs to validate onblur or onclick. > > For example, if there is first name field, then it should contain only > letters. so this should be validate. and at the same time they submit > the form without filling the first name. > > i searched google, but dont find the solution for this. please tell me > how to do this. > >
[jQuery] Re: [treeview]
See http://www.trinityindia.org/jquery.cookie.js Jörn On Fri, Jan 30, 2009 at 11:05 AM, kryptos wrote: > > Greets ... > > when i run the tree~menu locally .it works like a breeze. > when i load it up on the webserverit freezes.firebug tells me > the error is at line 176 in >> jquery.treeview.js > > the code in that line is >> > var stored = $.cookie(settings.cookieId); > > the error is >> > $.cookie is not a function > > URL>> > www.trinityindia.org > > the error persists in all the browsers.3 days down alreadyhave > no clue... > > do help :) > > > > >
[jQuery] Jquery remove dd problem
Hi, I'm currently using the plugin jQueryForm. With it I want to retrieve some info from the Ajax request. In order to do that, each time the user submit the form, I need to clean the information retrieved previously. In my XHTML code I have some div in charge of those messages, which is this: Sucesso! As seguintes operações foram realizadas: In the JS part, I did set this: $(document).ready(function() { $("#form").ajaxForm(function(data){ $("#list_sucesso dt dd").remove(); $("#ok").fadeIn(); $("#list_sucesso dt").after(""+ data + ""); }); }); The problem is that the line $("#list_sucesso dt dd").remove(); isn't removing the dd tags. I tried to use empty() as well, and still didn't work. Tried with html(""), and didn't happen as expected. It's always just adding a DD tag after the one that was created on the previously submission. Any ideas? I appreciate any advice. Nicholas -- View this message in context: http://www.nabble.com/Jquery-remove-dd-problem-tp21747270s27240p21747270.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] jqUploader using action does not work with HTTP.
This form action not working: http://localhost/argofile/ index.php/upload/do_upload" method="POST" class="a_form"> I'm using code igniter framework, this type of url is the path for the "file" : http://localhost/argofile/index.php/upload/do_upload When i click the upload button, this error happens: HTTP error: with NAMEofFILE: error #404 See this print-screen: http://hermes.araripina.com.br/imagens/jqUploader.png When not using the framework, php normal use. Directing the form to the file, it works normally. When not using the framework, php normal use. Directing the form to the file, it works normally. Someone can help me solve this? Well I have to use framework without using HTTP address on the form. I await any response, Hermes Alves
[jQuery] Re: Long Image Scroller (jCarousel)
Glad to help! Use the background-image approach is only to make calculating the position easier - it allows you to use percentages and avoid messy calculations. But as long as it was some help to you. Liam Sbudah wrote: I declare you a God. It works although I still need to change it from being a background image to a div that changes position but this has helped me and has most definitely given me ideas. You may see it in action at http://www.myfuche.com/ Thanks Liam. On Jan 29, 11:41 pm, Liam Byrne wrote: MUCH simpler than that. 1) Put the image into the background of the 500px div 2) Capture / track the mouse position 3) Divide the x-position by 5 4) Use that to set the x-axis percentage of the background position Just make sure you set the IE6 background image cache so that it doesn't flicker in that browser. Liam Sbudah wrote: Hi Guys, I have a long image that is about 2200 px wide that I need to display within a 500px div. I need a solution similar to jCarousel (Lite) that would allow users to scroll horizontal either using a Mouse Wheel or simply hover a button (preferably right or left half of the image to move to the sides). So far I have managed to do it if I cut the image into pieces and use jCarousel Lite (with Fraction Config) to scroll but I need something that would scroll through the whole image without cutting it. I'd hate to use Flash; please help! Thanks, Sbudah No virus found in this incoming message. Checked by AVG -http://www.avg.com Version: 8.0.176 / Virus Database: 270.10.15/1923 - Release Date: 29/01/2009 07:13 No virus found in this incoming message. Checked by AVG - http://www.avg.com Version: 8.0.176 / Virus Database: 270.10.16/1925 - Release Date: 30/01/2009 07:37
[jQuery] Re: High Point Village Website
Thanks for the feedback. Things get a bit shaky in FF2 & FF3, I understand this is because FF redraws every frame of an animation. The sole occasion I've encountered when ie6 provides a better end result, though I'm sure Mozilla have there reasons. In order to improve things on the home page, a couple of the flash elements have been disabled including the flash tooltips, which have been replaced with JS versions in FF and non flash browsers. Rich On Jan 29, 8:54 pm, David Meiser wrote: > It has a nice user experience. However, you might want to think about the > hoverintent plugin - things seemed "shaky" when I tried to click on them (eg > - the animation kept moving when I wanted to hover over an item) in FF3. > > On Thu, Jan 29, 2009 at 12:58 PM, kim3er wrote: > > > Hi, > > > I've just finished working on a new web site using jQuery 1.3.1 and > > would appreciate feedback. > > >http://www.highpointvillage.co.uk/ > > > Rich
[jQuery] Re: Delay triggering modal on mouseover
hoverIntent is your guy http://plugins.jquery.com/project/hoverIntent - Richard On Thu, Jan 29, 2009 at 11:21 PM, jdinkelmann wrote: > > Hi I have been searching for a way to not fire off the displaying of a > popup/modal box on mouse over. I have found a couple things that get > me halfway, but I am in a jam and need to get this done ASAP. I am > hoping someone could help: > > Basically I have a list of links that are titles of publications like > > > Title 1 > Title 2 > Title 3 > Title 4 > Title 5 > Title 6 > Title 7 > > When a user hovers over the link to that title a small popup will > appear with information regarding this title. I have all that working > fine. What I can figure out is, how to delay the popup if the user > only briefly mouseover the link. Basically I want the popup only to > appear if the user stops on the link for a certain amount of time > (like a half a second). If you ar familiar with the Gmail UI, I want > the effect that they have implemented when you mouse over a contact in > you left sidebar. > > > I'll continue looking into this, but if anyone has any thoughts, I'd > appreciate it >
[jQuery] Re: High Point Village Website
Thank you for the feedback, it really is very much appreciated. I'm aware of the considerable amount of requests, especially with respect to the amount of JS files we have referenced. Rich On Jan 29, 8:50 pm, Sam Sherlock wrote: > That is a great piece of work, a huge amount of http requests - but appeared > pretty seamless > > 2009/1/29 ksun > > > > > Could see only intro in IE > > > On Jan 29, 12:58 pm, kim3er wrote: > > > Hi, > > > > I've just finished working on a new web site using jQuery 1.3.1 and > > > would appreciate feedback. > > > >http://www.highpointvillage.co.uk/ > > > > Rich
[jQuery] Re: High Point Village Website
Hi ksun, Thanks for the feedback. There are two intros, one constructed in JS and one for users with flash installed, browsers with JS disabled will not see an intro. I have tested the intros in ie6, ie7, ie8rc1, ff2, ff3, s3, c1 and 09, across XP, Vista, OS X and Ubuntu. Is your experiance contradictory to what I've stated above? If so, I'd be very interested any follow up information you could provide. The other browsers you tested the site on along with any user defined settings you belive are relevant. Rich On Jan 29, 8:24 pm, ksun wrote: > Could see only intro in IE > > On Jan 29, 12:58 pm, kim3er wrote: > > > Hi, > > > I've just finished working on a new web site using jQuery 1.3.1 and > > would appreciate feedback. > > >http://www.highpointvillage.co.uk/ > > > Rich
[jQuery] Re: issue with ajax function
Yes, jquery tries to interpret it as JSON data, but that is XML and not JSON, thus the 'parserror'. XML that contains JSON in its "string" node. You should set your datatype to xml, but even then I'm not sure if that will work quite well. In best case you can extract the value of xml string node as a STRING, and then you'll have to parse/interpret that to JSON yourself. (http://json.org/js.html) I'd say, you better decide if you want to use XML or JSON, and not both. On Jan 30, 2:45 pm, graphicsxp wrote: > Well the reponseText property of the XHR object contains : > > > http://tempuri.org/";>{"results": [ > { > "id": "4", > "value": "guardian.co.uk" > } > ]} > > that's what the webservice returns. Since dataType of my jquery ajax > method is set to 'json', this should be interpreted as json data. > > On 30 jan, 11:14, Beres Botond wrote: > > > > > So the AJAX call actually returns some result now? > > > If you alert() the result, before trying to do anything with it, what > > do you get? > > > On Jan 30, 11:35 am, graphicsxp wrote: > > > > >This should only be set if your webservice expects the input parameter > > > >in JSON format as well, and not only the response is JSON. > > > >Is this the case? > > > > Yes, I thought that too. I've removed the contentType parameter. In > > > this case the webservice is reached. > > > But when the AJAX call returns I get the error 'parseerror' . > > > > The webservice method looks like : > > > > [WebMethod] > > > public string GetPublication(String pText) { > > > String result = ""; > > > > result = @"{""results"": [ > > > { > > > ""id"": ""4"", > > > ""value"": ""guardian.co.uk"" > > > } > > > ]}"; > > > > return result; > > > } > > > > On 30 jan, 09:30, Beres Botond wrote: > > > > > A parameter has to be key=>value, in some form, otherwise how is it > > > > identified? > > > > > contentType: "application/json; charset=utf-8", > > > > > This should only be set if your webservice expects the input parameter > > > > in JSON format as well, and not only the response is JSON. > > > > Is this the case? > > > > > How does the code of your webservice look like? (the part which gets > > > > the input parameter) > > > > > On Jan 29, 6:50 pm, graphicsxp wrote: > > > > > > Thanks.. I tried that but I'm getting an error before the webservice > > > > > is reached : "Invalid JSON primitive: pText." > > > > > > Like I said, my webservice's method expects a string, not a JSON key- > > > > > value pair. I'd be surprised if we can't pass a simple string to a > > > > > webservice ? > > > > > > On 29 jan, 16:24, MorningZ wrote: > > > > > > > Right from the docshttp://docs.jquery.com/Ajax/jQuery.ajax#options > > > > > > > "Object must be Key/Value pairs" > > > > > > > something that > > > > > > > data: "pText=some text" > > > > > > > is not (it's a string) > > > > > > > so with that pointed out, try > > > > > > > $.ajax({ > > > > > > url: "Publication.asmx/GetPublication", > > > > > > data: { pText: "some text" }, > > > > > > type: "POST", > > > > > > contentType: "application/json; charset=utf-8", > > > > > > dataType: "json", > > > > > > > }); > > > > > > > On Jan 29, 10:58 am, graphicsxp wrote: > > > > > > > > Hi, > > > > > > > > I'm trying to send a string to my webservice. The method I call > > > > > > > expects a string parameter and returns a string of JSON data. > > > > > > > > I've tried this way : > > > > > > > > $.ajax({ > > > > > > > url: "Publication.asmx/GetPublication", > > > > > > > data: "pText=some text", > > > > > > > type: "POST", > > > > > > > contentType: "application/json; charset=utf-8", > > > > > > > dataType: "json", > > > > > > > > }); > > > > > > > > in which case I get the following error and the webservice is not > > > > > > > even > > > > > > > reached : > > > > > > > > Invalid JSON primitive: pText > > > > > > > > and this way : > > > > > > > > $.ajax({ > > > > > > > url: "Publication.asmx/GetPublication", > > > > > > > data: "pText=some text", > > > > > > > type: "POST", > > > > > > > dataType: "json", > > > > > > > > }); > > > > > > > > in which case the webservice is reached but then when the ajax > > > > > > > call > > > > > > > returns I get the following error : > > > > > > > > parseerror > > > > > > > > What do i need to do to fix this ? > > > > > > > > Thanks