[jQuery] Re: simple query does not work
thank you ricardo,that was helpful. On Apr 13, 6:42 am, Ricardo ricardob...@gmail.com wrote: .get(0) returns a DOM element, not a jQuery object, so the .css method doesn't exist in it. Try this: $(div#photolinks img).eq(0).css(border,5px solid black;); or $(div#photolinks img:first).css(border,5px solid black;); On Apr 12, 8:03 pm, dongle tetri...@gmail.com wrote: nop, there are too get ; one that acts like the javascript index(i) method:http://docs.jquery.com/Core/get i am referring to that one, :first would not help me here. On Apr 13, 12:57 am, Chuck Harmston cpharms...@gmail.com wrote: I'm not quite sure what you're trying to do here. The $.get() function is used to submit an HTTP GET request. See: http://docs.jquery.com/Ajax/jQuery.get Are you trying to return the first response? Try using $(div#photolinks img:first). Chuck Harmstonhttp://chuckharmston.com On Sun, Apr 12, 2009 at 5:41 PM, dongle tetri...@gmail.com wrote: i am making this(it does not work) : $(document).ready(function(){ $(div#photolinks img).get(0).css(border,5px solid black;); }); if i do this: $(document).ready(function(){ $(div#photolinks img).css(border,5px solid black;); }); it does work, whats wrong? thanks
[jQuery] Re: jquery toggle class, I needed to switch class....
didnt you forget jQuery.fn.switchClass=function ??? On Mar 23, 7:47 pm, Eric Garside gars...@gmail.com wrote: Or: jQuery.fn.switchClass( a, b ){ var t = this.hasClass(a); this.addClass( t ? b : a ).removeClass( t ? a : b ); } On Mar 23, 12:35 pm, T.J. Crowder t...@crowdersoftware.com wrote: Hi, You're creating (or worse, overwriting) global variables 'remove' and 'add' there (because you haven't given the 'var' keyword, and thus are creating implicit globals[1]). The temporaries don't really buy you anything anyway, perhaps simply: jQuery.fn.switchClass = function(class1,class2) { if (this.hasClass(class1)) { this.removeClass(class1).addClass(class2); } else { this.removeClass(class2).addClass(class1); } }; [1]http://blog.niftysnippets.org/2008/03/horror-of-implicit-globals.html FWIW, -- T.J. Crowder tj / crowder software / com Independent Software Engineer, consulting services available On Mar 23, 1:33 pm, Artistan artis...@gmail.com wrote: /// /// Switch Between Classes /// /// jQuery.fn.switchClass = function(class1,class2) { if(this.hasClass(class1)){ remove = class1; add = class2; } else { remove = class2; add = class1; } this.removeClass(remove); this.addClass(add); }; Hope this helps someone out.
[jQuery] Re: ajax post data json - php receives only post data, no json
learn to make a simple ajax query before playing with jquery, to use json data is completely senseless here On Apr 12, 1:32 pm, mcologne blueameri...@web.de wrote: hi... i have a normal email form, where the user can send an email with some data... at first i send it with normal post (no dataType in jquery)... but it was difficult to handle the returning messages from php, e.g. validation messages or ok messages... therefor i tried dataType json... like the code below... now i con better handle the returning messages, but i wonder why i still get single post data in php ($_POST['name'], $_POST['email)'] etc and NO nested json!... is there something wrong with my data format? in firebug i also see only single post data... no json format when posting best regards m, cologne ## $.ajax({ type: POST, url: /mail/process.php5, data: {name:name, email:email, message:message, n:textmail, i:pic}, dataType: json, success: function(res) { if(res.result == 1) { $('#dialog').html(pWE SEND THE EMAIL + res.message + /p); } else if(res.result == 0) { $('#dialog').html(pERROR + res.message + /p); }
[jQuery] Re: Help, friends!
google is your best friend. bye! On Apr 12, 1:13 am, rusllangashik online...@gmail.com wrote: Hi all I need realize a tag cloud in style, how it done here - 4dle.ru (russian site). I khow it jQuery! Can some give me script to realize it? Please!
[jQuery] simple query does not work
i am making this(it does not work) : $(document).ready(function(){ $(div#photolinks img).get(0).css(border,5px solid black;); }); if i do this: $(document).ready(function(){ $(div#photolinks img).css(border,5px solid black;); }); it does work, whats wrong? thanks
[jQuery] Re: simple query does not work
nop, there are too get ; one that acts like the javascript index(i) method: http://docs.jquery.com/Core/get i am referring to that one, :first would not help me here. On Apr 13, 12:57 am, Chuck Harmston cpharms...@gmail.com wrote: I'm not quite sure what you're trying to do here. The $.get() function is used to submit an HTTP GET request. See: http://docs.jquery.com/Ajax/jQuery.get Are you trying to return the first response? Try using $(div#photolinks img:first). Chuck Harmstonhttp://chuckharmston.com On Sun, Apr 12, 2009 at 5:41 PM, dongle tetri...@gmail.com wrote: i am making this(it does not work) : $(document).ready(function(){ $(div#photolinks img).get(0).css(border,5px solid black;); }); if i do this: $(document).ready(function(){ $(div#photolinks img).css(border,5px solid black;); }); it does work, whats wrong? thanks
[jQuery] Re: simply toggling a div that contains a flash movie
ok thank you. On Apr 9, 7:45 pm, Ralph Whitbeck ralph.whitb...@gmail.com wrote: object's don't obey traditional css layering. You'll need to hide the object first then toggle your div. On Thu, Apr 9, 2009 at 12:16 PM, tetris tetri...@gmail.com wrote: hello to simply toggle a div that contains a flash movie does not work in firefox,the flash object does not disappear gradually, any thoughts? code: script $(document).ready(function(){ $(button).click(function () { $(div).toggle(slow); }); }); /script /head body buttonToggle 'em/button div object classid=clsid:d27cdb6e-ae6d-11cf-96b8-44455354 codebase=http://download.macromedia.com/pub/shockwave/cabs/flash/ swflash.cab#version=10,0,0,0http://download.macromedia.com/pub/shockwave/cabs/flash/%0Aswflash.ca... width=300 height=250 id=banner align=middle param name=allowScriptAccess value=sameDomain / param name=allowFullScreen value=false / param name=movie value=banner.swf /param name=quality value=best /param name=bgcolor value=#00 / embed src=banner.swf quality=best bgcolor=#00 width=300 height=250 name=banner align=middle allowScriptAccess=sameDomain allowFullScreen=false type=application/x-shockwave-flash pluginspage=http://www.adobe.com/ go/getflashplayer http://www.adobe.com/%0Ago/getflashplayer / /object /div /body