[jQuery] Re: Applying a string as a function?
You kidding me? Thats way too easy! :-) From now on, if I'm working on something and it takes me more than 10 minutes, I'm posting the question. :-) Question: I was thinking usng .apply here. But I wasn't 100% sure how that worked. In general, if I see something like this: xxx.apply(x,[y,z]); From what I am understanding, x is this inside the function xxx and x,y is the parameter to the function? Is that correct in general when using .apply? or am I off base completely? g --- HLS On Oct 9, 1:49 am, Michael Geary [EMAIL PROTECTED] wrote: From: Pops var how = (settings.show!=)?settings.show:show; eval($box.+how+()); foo.bar means the same thing as foo['bar'], so this code is the same as: var how = (settings.show!=)?settings.show:show; $box[how](); Or a very clean and simple version: $box[ settings.show || 'show' ](); -Mike
[jQuery] Re: jQuery (Superfish) conflicting with swfobject
Thanks Joel. appreciate the response. I have used a hybrid of a slide out menu and a drop down as the third level. I had cleared my cache, used the alt/refresh technique etc. and still cannot see the drop down portion of the menu. I had a collegue do the same and he can see what I see which as about 3 pixels of the menu and that's it. Thanks for the heads-up on the ie font issue. I will sort that shortly. Front page is now valid xhtml - client has discovered FTP and decided to upload some old files for me over the past couple of days - just to keep me on my toes :-) In the meantime, can you confirm that you can see the drop down as well in the ie's? Cheers, Wes Joel Birch wrote: Hi Wessa, I have checked your link and the menu is actually working in both IE6 and IE7. May I suggest you attempt to reload the page in a way that avoids the cache? Holding Alt down when clicking the refresh button seems to ignore the cache successfully on my PC. I notice however, that you have run into the IE issue where fonts look jaggy due to altering the opacity (fading) on a parent element that does not have an explicitly defined solid background colour. You will find that you need to apply a solid orange to the submenus in IE instead of the pretty gradient you currently have, as this mostly fixes this issue. Good luck. Joel Birch. PS. Invalid HTML. There, I said it. ;) -- View this message in context: http://www.nabble.com/jQuery-%28Superfish%29-conflicting-with-swfobject-tf4545960s27240.html#a13110004 Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: Applying a string as a function?
How do you passing parameters via the settings? An example is passing the speed var settings = { ... show: slideDown(50), ... }; I get a syntax error for: $box[ settings.show || 'show' ](); I guess I have to passing the parameter as setting? var settings = { ... show: slideDown. speed: 50, ... }; $box[ settings.show || 'show' ](settings.speed); Correct? -- HLS On Oct 9, 1:49 am, Michael Geary [EMAIL PROTECTED] wrote: From: Pops var how = (settings.show!=)?settings.show:show; eval($box.+how+()); foo.bar means the same thing as foo['bar'], so this code is the same as: var how = (settings.show!=)?settings.show:show; $box[how](); Or a very clean and simple version: $box[ settings.show || 'show' ](); -Mike
[jQuery] Re: Applying a string as a function?
From: Pops How do you passing parameters via the settings? An example is passing the speed var settings = { ... show: slideDown(50), ... }; I get a syntax error for: $box[ settings.show || 'show' ](); I guess I have to passing the parameter as setting? var settings = { ... show: slideDown. speed: 50, ... }; $box[ settings.show || 'show' ](settings.speed); Correct? Makes sense to me. There are a few ways you could organize this, but that's as good as any depending on your needs. The first example failed because it was equivalent to: $box[ slideDown(50) ](); which *could* be valid code (if slideDown were a function that returned a string containing a method name) but would be unlikely to be what you wanted. -Mike
[jQuery] Re: Applying a string as a function?
You kidding me? Thats way too easy! :-) You win some, you lose some. Next time it will be browser inconsistencies! :-) I was thinking usng .apply here. But I wasn't 100% sure how that worked. In general, if I see something like this: xxx.apply(x,[y,z]); From what I am understanding, x is this inside the function xxx and x,y is the parameter to the function? Is that correct in general when using .apply? or am I off base completely? g 100% correct. foo.call() can also be useful in some situations - the example above would be: xxx.call( x, y, z ); // === xxx.apply( x, [y,z] ); In your first example: var how = (settings.show!=)?settings.show:show; eval($box.+how+()); you don't really need call or apply, since you aren't doing anything special about this and aren't passing any arguments into the function. There's an interesting use of apply in some code I posted earlier today (slightly updated from the original post): $.expire = function( fn, callback, interval, start ) { var timer; function set() { timer = setTimeout( callback, interval ); } if( start ) set(); return function() { clearTimeout( timer ); set(); return fn.apply( this, arguments ); }; }; $.expire takes a function (fn) and returns a replacement function which sets a timeout and then calls the original function. In order to pass through both the this value and the argument list from the original function, the code uses: return fn.apply( this, arguments ); That can be useful for all sorts of things where you want to wrap an existing function inside a new function that adds behavior before or after the original function. -Mike
[jQuery] Re: jQuery (Superfish) conflicting with swfobject
Actually it is sorted now... using ul.SubCategories{margin: 0px;height:800px} So it was a css issue. Thanks anyways for the help. Cheers, Wes Wessa wrote: Thanks Joel. appreciate the response. I have used a hybrid of a slide out menu and a drop down as the third level. I had cleared my cache, used the alt/refresh technique etc. and still cannot see the drop down portion of the menu. I had a collegue do the same and he can see what I see which as about 3 pixels of the menu and that's it. Thanks for the heads-up on the ie font issue. I will sort that shortly. Front page is now valid xhtml - client has discovered FTP and decided to upload some old files for me over the past couple of days - just to keep me on my toes :-) In the meantime, can you confirm that you can see the drop down as well in the ie's? Cheers, Wes Joel Birch wrote: Hi Wessa, I have checked your link and the menu is actually working in both IE6 and IE7. May I suggest you attempt to reload the page in a way that avoids the cache? Holding Alt down when clicking the refresh button seems to ignore the cache successfully on my PC. I notice however, that you have run into the IE issue where fonts look jaggy due to altering the opacity (fading) on a parent element that does not have an explicitly defined solid background colour. You will find that you need to apply a solid orange to the submenus in IE instead of the pretty gradient you currently have, as this mostly fixes this issue. Good luck. Joel Birch. PS. Invalid HTML. There, I said it. ;) -- View this message in context: http://www.nabble.com/jQuery-%28Superfish%29-conflicting-with-swfobject-tf4545960s27240.html#a13110750 Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: jQuery (Superfish) conflicting with swfobject
Ah okay I see now. I thought you meant the second level of menu was not appearing and I wasn't aware of the third level. I now do see that your third level menus are not responding to the IE z-index fix, and fortunately I can see why. An element needs to be position:relative or absolute to have z-index applied to it. If you add position:relative to the rule for .nav li li li it will then appear correctly. Joel Birch.
[jQuery] Re: jQuery (Superfish) conflicting with swfobject
On 10/9/07, Wessa [EMAIL PROTECTED] wrote: Actually it is sorted now... using ul.SubCategories{margin: 0px;height:800px} So it was a css issue. Okay so applying that height sort of gets around the IE bugs, but it is not a good solution because then the ul.subCategories have 800px height and whilst they are invisible with no background colour, they prevent interaction with elements underneath them in better browsers. Try clicking your GO buttons in the left sidebar when even a first level menu is visible. Also, the submenus do not disappear when you hover over part of the 800px below the menu. I guess you could serve the 800px height rule (I'm guessing height:1% will work too though) to IE via conditional comments, but I recommend going with the position:relative solution which makes sense in all browsers and has no side effects. For the record, so far 100% of issues people have with Superfish is CSS related, so it's always the first place to look. Joel Birch.
[jQuery] Re: JSS - New Plug-in
On Oct 8, 3:42 pm, Andy Kent [EMAIL PROTECTED] wrote: snip Yep, absolutely. If you have any ideas on how we could test a browsers support for a selector without maintaining a hard coded list then I would love to hear them. snip $(document).ready(function () { $('body').append( 'div id=r_csstest \ style type=text/css \ div#r_css{ \ width: 0px; \ } \ div[id=r_css]{\ height: 0px;\ } \ div#r_css:nth-child(1){\ position: fixed;\ } \ /style\ div id=r_css\ div id=r_cssc \ /div \ /div \ /div' ); var bc_selectors = { css1: 'div#r_css', css2: 'div[id=r_css]', css3: 'div#r_css:nth-child(1)' }; var bc = { css1: ($(bc_selectors.css1).css('width') == '0px'), css2: ($(bc_selectors.css2).css('height')=='0px'), css3: ($(bc_selectors.css3).css('position')=='fixed') }; $('div#r_csstest').remove(); console.log(bc); }); -- ?php echo 'Just another PHP saint'; ? Email: rrjanbiah-at-Y!comBlog: http://rajeshanbiah.blogspot.com/
[jQuery] Re: Getting a specific option in a select
It was a mistake in cut paste... Tryed also without the star, but I can't get the option. :-( On Oct 8, 9:18 pm, motob [EMAIL PROTECTED] wrote: Try removing the colon (:) after the option element, like so: $('option[value*=\'2\']', $('#category_1')).size() On Oct 8, 12:11 pm, Giovanni Battista Lenoci [EMAIL PROTECTED] wrote: Hi, I'm trying to get the option with a specific value in it. This is the syntax I use and doesn't works: alert($('option:[value*=\'2\']', $('#category_1')).size()); It alerts 0, if I try without the value I get the correct size of the options in the select. Where's the error? Thank you
[jQuery] Re: JSS - New Plug-in
Ok, I'm pleased to say I have updated the plugin and we are now at 0.3 This brings a whole bunch of tweaks but mainly it (hopefully) fixes the IE issues that people where having. Ta, Andy. On 9 Oct, 08:56, R. Rajesh Jeba Anbiah [EMAIL PROTECTED] wrote: On Oct 8, 3:42 pm, Andy Kent [EMAIL PROTECTED] wrote: snip Yep, absolutely. If you have any ideas on how we could test a browsers support for a selector without maintaining a hard coded list then I would love to hear them. snip $(document).ready(function () { $('body').append( 'div id=r_csstest \ style type=text/css \ div#r_css{ \ width: 0px; \} \ div[id=r_css]{\ height: 0px;\} \ div#r_css:nth-child(1){\ position: fixed;\} \ /style\ div id=r_css\ div id=r_cssc \ /div \ /div \ /div' ); var bc_selectors = { css1: 'div#r_css', css2: 'div[id=r_css]', css3: 'div#r_css:nth-child(1)'}; var bc = { css1: ($(bc_selectors.css1).css('width') == '0px'), css2: ($(bc_selectors.css2).css('height')=='0px'), css3: ($(bc_selectors.css3).css('position')=='fixed')}; $('div#r_csstest').remove(); console.log(bc); }); -- ?php echo 'Just another PHP saint'; ? Email: rrjanbiah-at-Y!comBlog:http://rajeshanbiah.blogspot.com/
[jQuery] Re: IE6 Stylesheet Woes
Thanks a heap for your help James, after lots of trial and error I managed to track down the source of the problem. It's a very curious IE issue, your examples work fine provided you don't try to access document.stylesheets first, if you do then that seems to kick IE off on a parsing spree. Oh well, all fixed now, thanks for your help. Andy. On 8 Oct, 17:03, James Dempster [EMAIL PROTECTED] wrote: Thats strange, I've added lots of strange chars and it still works ok for me. Screenshots.http://www.jdempster.com/public/jss/ie6.pnghttp://www.jdempster.com/public/jss/ie7.pnghttp://www.jdempster.com/public/jss/ff2.png I did test it in more but these will do for now. Can any one else check their IE? /James On 10/8/07, Andy Kent [EMAIL PROTECTED] wrote: This has the same issue I'm afraid. It works for all those examples as IE thinks they are valid. Give something like div~p:first a go though and I you get the selector replaced with the string 'UNKOWN' in the innerHTML source code. Thanks for the attempt but sill no prize yet! :( *tears* Andy. On 8 Oct, 14:43, James Dempster [EMAIL PROTECTED] wrote: I've pinched some code from Christian Bach (http://lovepeacenukes.com/ jquery/ie6cssfix/) and put it into it's own test case. Tested it on Win IE 6/7, FF 1.5/2, Safari3, Opera 9 and they all showed the same results. Test it out. Hopefully it can help .http://www.jdempster.com/public/jss/js_css.html On Oct 8, 11:29 am, Andy Kent [EMAIL PROTECTED] wrote: Unfortunately after some experimentation this method still appears to yield 'UNKNOWN' in place of selectors that are not understood by IE. Poo. On 8 Oct, 11:15, Andy Kent [EMAIL PROTECTED] wrote: Thanks Mike, that's a huge help and sounds like it will solve my problem perfectly. I will have a play now. Should jQuery not be clever enough to handle this internally when you call .text() on a style element? Is it worth filing as a bug do you think? Andy. On 8 Oct, 11:07, Michael Geary [EMAIL PROTECTED] wrote: Andy, you can read or write the content of an IE stylesheet with: $('style')[n].styleSheet.cssText where n is the index of the stylesheet you want. Instead of browser detection, I test for the presence of that .styleSheet property, and then either use .styleSheet.cssText or .text() depending. Some example non-jQuery code that I use (shows writing and replacing but not reading): function addStyle( css ) { var style = document.createElement( 'style' ); style.type = 'text/css'; head.appendChild( style ); if( style.styleSheet ) style.styleSheet.cssText = css; else style.appendChild( document.createTextNode(css) ); return style; } function changeStyle( style, css ) { if( style.styleSheet ) style.styleSheet.cssText = css; else style.replaceChild( document.createTextNode(css), style.firstChild ); return style; } -Mike From: Andy Kent I'm working on fixing my JSS plugin for IE, it appears that IE has really problems with showing you the source of stylesheets that are between style tags. $('style').text() - returns null $('style').html() - returns the source but it is modified, e.g. all non-supported selectors are changed to 'UNKOWN' (very unhelpful!) Before I delve deeper into this does anyone have a work around already?? I assume this is supposed to be some sort of security feature but it seems very strange seeing as loading external styles works as expected. Thanks, Andy.
[jQuery] Re: IE6 Stylesheet Woes
Hmm interestingly odd issue. Boo Boo to M$ IE /James On 10/9/07, Andy Kent [EMAIL PROTECTED] wrote: Thanks a heap for your help James, after lots of trial and error I managed to track down the source of the problem. It's a very curious IE issue, your examples work fine provided you don't try to access document.stylesheets first, if you do then that seems to kick IE off on a parsing spree. Oh well, all fixed now, thanks for your help. Andy. On 8 Oct, 17:03, James Dempster [EMAIL PROTECTED] wrote: Thats strange, I've added lots of strange chars and it still works ok for me. Screenshots .http://www.jdempster.com/public/jss/ie6.pnghttp://www.jdempster.com/public/jss/ie7.pnghttp://www.jdempster.com/public/jss/ff2.png I did test it in more but these will do for now. Can any one else check their IE? /James On 10/8/07, Andy Kent [EMAIL PROTECTED] wrote: This has the same issue I'm afraid. It works for all those examples as IE thinks they are valid. Give something like div~p:first a go though and I you get the selector replaced with the string 'UNKOWN' in the innerHTML source code. Thanks for the attempt but sill no prize yet! :( *tears* Andy. On 8 Oct, 14:43, James Dempster [EMAIL PROTECTED] wrote: I've pinched some code from Christian Bach ( http://lovepeacenukes.com/ jquery/ie6cssfix/) and put it into it's own test case. Tested it on Win IE 6/7, FF 1.5/2, Safari3, Opera 9 and they all showed the same results. Test it out. Hopefully it can help .http://www.jdempster.com/public/jss/js_css.html On Oct 8, 11:29 am, Andy Kent [EMAIL PROTECTED] wrote: Unfortunately after some experimentation this method still appears to yield 'UNKNOWN' in place of selectors that are not understood by IE. Poo. On 8 Oct, 11:15, Andy Kent [EMAIL PROTECTED] wrote: Thanks Mike, that's a huge help and sounds like it will solve my problem perfectly. I will have a play now. Should jQuery not be clever enough to handle this internally when you call .text() on a style element? Is it worth filing as a bug do you think? Andy. On 8 Oct, 11:07, Michael Geary [EMAIL PROTECTED] wrote: Andy, you can read or write the content of an IE stylesheet with: $('style')[n].styleSheet.cssText where n is the index of the stylesheet you want. Instead of browser detection, I test for the presence of that .styleSheet property, and then either use .styleSheet.cssText or .text() depending. Some example non-jQuery code that I use (shows writing and replacing but not reading): function addStyle( css ) { var style = document.createElement( 'style' ); style.type = 'text/css'; head.appendChild( style ); if( style.styleSheet ) style.styleSheet.cssText = css; else style.appendChild( document.createTextNode(css) ); return style; } function changeStyle( style, css ) { if( style.styleSheet ) style.styleSheet.cssText = css; else style.replaceChild( document.createTextNode(css), style.firstChild ); return style; } -Mike From: Andy Kent I'm working on fixing my JSS plugin for IE, it appears that IE has really problems with showing you the source of stylesheets that are between style tags. $('style').text() - returns null $('style').html() - returns the source but it is modified, e.g. all non-supported selectors are changed to 'UNKOWN' (very unhelpful!) Before I delve deeper into this does anyone have a work around already?? I assume this is supposed to be some sort of security feature but it seems very strange seeing as loading external styles works as expected. Thanks, Andy.
[jQuery] How width/height is calculated? [2]
Hi, I have the same problem and didn't find a solution yet. Is there any way that I can get the height of elements not visible (because their display css property is set to none or because parent elements properties hide this element, too). Michael On Jun 17, 4:50 am, Fred Janon [EMAIL PROTECTED] wrote: Klaus, Humm, I still can't get the size of an element while it's hidden and absolute... I tried with an element: style=display: none; position: absolute and alert(id: + elt.id + height: + elt.offsetHeight + width: + elt.offsetWidth); alert(id: + elt.id + style.height: + elt.style.height + style.width: + elt.style.width); I still get height:0 and width:0 and style.height as well as style.width. Did you mean that the element position is made absolute, moved off screen and made visible to get its size and then made static and hidden again? Thanks Fred On 6/17/07, Klaus Hartl [EMAIL PROTECTED] wrote: Fred Janon wrote: Hi, I am trying to understand how the height of an element is calculated in jQuery. I don't understand how the height can be calculated especially when the element is hidden with display:none. Thanks Fred Fred, if the particular element is hidden, it is absolutely positioned while invisible (and the parent element its context), instead of display: none, and the height can then be calculated. Thereafter these styles are resetted. There is one issue: If not the element itself but some parent element is hidden via setting display to none, you won't get the correct height. Its just to expensive to use the above described technique for some parent element. --Klaus- Hide quoted text - - Show quoted text -
[jQuery] Re: How width/height is calculated? [2]
Ok, I got it... thanks to extJS ;) var changed = null; function beginMeasure(el) { if(el.length == 0) return; changed = []; while(!el.is(body)) { if(el.css(display) == none) { changed.push({el: el, visibility: el.css(visibility)}); el.css({visibility: hidden, display: block}); } el = el.parent(); } } function endMeasure() { if(changed == null) return; for(var i=0; ichanged.length; i++) { var item = changed[i]; item.el.css({visibility: item.visibility, display: none}); } changed = null; } var e = $j(#hans); beginMeasure(e); alert(e.outerWidth()); endMeasure(); Regards, Michael On Oct 9, 1:01 pm, Michael Schwarz [MVP] [EMAIL PROTECTED] wrote: Hi, I have the same problem and didn't find a solution yet. Is there any way that I can get the height of elements not visible (because their display css property is set to none or because parent elements properties hide this element, too). Michael On Jun 17, 4:50 am, Fred Janon [EMAIL PROTECTED] wrote: Klaus, Humm, I still can't get the size of an element while it's hidden and absolute... I tried with an element: style=display: none; position: absolute and alert(id: + elt.id + height: + elt.offsetHeight + width: + elt.offsetWidth); alert(id: + elt.id + style.height: + elt.style.height + style.width: + elt.style.width); I still get height:0 and width:0 and style.height as well as style.width. Did you mean that the element position is made absolute, moved off screen and made visible to get its size and then made static and hidden again? Thanks Fred On 6/17/07, Klaus Hartl [EMAIL PROTECTED] wrote: Fred Janon wrote: Hi, I am trying to understand how the height of an element is calculated in jQuery. I don't understand how the height can be calculated especially when the element is hidden with display:none. Thanks Fred Fred, if the particular element is hidden, it is absolutely positioned while invisible (and the parent element its context), instead of display: none, and the height can then be calculated. Thereafter these styles are resetted. There is one issue: If not the element itself but some parent element is hidden via setting display to none, you won't get the correct height. Its just to expensive to use the above described technique for some parent element. --Klaus- Hide quoted text - - Show quoted text -- Hide quoted text - - Show quoted text -
[jQuery] Re: jQuery and .Net Postbacks
Jeff, Thank you much. However, I'm handcuffed wrt releasing code/links to the public. It's a proprietary web app -- which makes it really hard to get third-party support :/ Anyway, as I said, thank you much. All I can say is that our app deviates from the plain-vanilla C#.net and is using a framework vaguely resembling the MVC architecture/ pattern. So in postbacks, it does not unload the whole page, just parts of it. It seems, however, that during the postback process all jQuery events get lost/orphaned. It's driving me NUTS! Best, RDO On Oct 8, 5:07 pm, Jeffrey Kretz [EMAIL PROTECTED] wrote: If you have a sample page I could take a look at, I can give it a shot. I have a number of .NET applications that are married with jQuery both for UI work, as well as Ajax calls, and haven't had any troubles. But I'd be happy to take a look at yours if you'd like. JK -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of RDO Sent: Monday, October 08, 2007 8:53 AM To: jQuery (English) Subject: [jQuery] jQuery and .Net Postbacks Hi guys, I'm having problems with .Net postbacks and jQuery. When I first come to the web page I'm working on, everything works fine: all elements that should be present, are. All events are properly attached to their respective elements. It's all honky dory (pardon the cliche), until I send data to the server and get a postback response. All events are lost and the elements act completely unpredictably. Any ideas what might be happening? Your help is much appreciated. Best, RDO
[jQuery] Re: Session management in an Ajax app
There are actually two things to think of here. I don't know about CF specifically but it seems that most web servers should update their session timeout if data has been accessed in any way. I would assume that any AJAX request to the server by the browser would update this status. If your session on the server times out because of inactivity it seems that your UI should alert the user in whatever way is appropriate for your app. The problem is what if your user is actively using your app, however, has not requested any data from the server in a long period of time. It's very possible that the server session expires yet the client session is still active. Great, so now we need to worry about server session and client session? :-) In this case I would setup two JavaScript variables, one with the last time the server was hit and another with the last time the UI was used. I would have some sort of session keep-alive event that fires off a call to the server just a couple of minutes before the server session expires to keep this alive. Any event on the client side should update the client session variable. If, and when, the client side expires then you can fire off a call to the server to invalidate the server session. That way your client side and server side are somewhat synchronized. This way you're not polling the server constantly while keeping the server session alive even if the user isn't physically requesting data from it. Matt Penner From: Rey Bango A buddy of mine, Raymond Camden, posted an interesting question on his blog: How can you timeout a session in an Ajax-based application? http://www.coldfusionjedi.com/index.cfm/2007/10/8/Ask-a-Jedi-How-can-you -tim eout-a-session-in-an-Ajaxbased-application The gist is that if you have a dashboard-type app and you need to determine if your session has timed out on the next Ajax request, how would you go about doing it. He mentioned creating a ping-like service that would poll the server every so often. It seems that this would dramatically increase the number of HTTP requests. Since session management is available in many server-side languages, not just ColdFusion obviously, I think this is a good topic that's applicable to most any project. Is there a better way of doing it? Rey...
[jQuery] jQuery CSS and Superfish not working w/IE
I've got the following site I am working on ( http://www.tolerase.com/test2.php ) and the drop down nav is working as intended on Firefox but in IE it is all over the place. I know the problems are CSS related, can anybody with experience with Superfish and CSS help me understand how I need to tweak my CSS to display nicely in IE? thanks.
[jQuery] appending html from ajax call
Hi, New to JQuery, got some questions: $.ajax({ url: MyPage, success: function(msg){ $(msg).appendTo('body'); } msg is a html page, and it works, now I try to get only the 'h1' elements by doing this: $(msg).find('h1').appendTo('body'); and I see nothing, the javascript console in Safari says: Value undefined (result of expression ret[i].getElementsByTagName) is not object. Any hint on this? Thanks.
[jQuery] Re: Permission denied to get property Window.node Type
Please help me about this problem. SMA wrote: Inside http://www.insiderec.com/ When I clicked on the bottom left text to open a popup image the following error occurs, Permission denied to get property Window.node Type. With the alert which is indicated only in firefox. Working fine with IE. Please tell me how should I solved this problem.
[jQuery] opacity in animations
When I call superfish like this: $(.nav).superfish({animation : {opacity: .5}}); ... it always animates from dark to light on the first time you access a menu, and then on subsequent accesses, it's already at opacity: .5, so it doesn't animate anything. So, how can I achieve what I want, which is to navigate from nothing, to .5, every time I access the menu. Thanks!
[jQuery] Weird problems in IE7 using blur() and $, ff to slow?
I have a table full of cells where i want the user to be able to click on a cell to convert it to an input box for editing (ala excel editing). When the user leaves the cell (onblur event) i want to check the content of the input for any changes, and if changed post it to the server with an .ajax call. In FF it works almost perfectly, except if i click fast from cell to cell, then it somtimes misses and altough the previous is converted back to text and saved to db, the new one is not selected. In IE7 when i click in a cell it gets converted just fine, i can type and when i leave the cell it updates correctly. However, if i click in a cell, then tries to click in the cell again (after its converted to an input), IE7 comes with Error 'undefined' is null or not an object. on this line: var cellOldValue = $(event.target).html(); Here is the relevant code: Setup the event handler: $('tbody td').click(function(event){cellClicked(event);}); Here is the function: function cellClicked(event){ if ($('#selected') != null $('#selected').length 0){ // blur event still firing setTimeout(cellClicked(event),25); //wait until the blur event is done before converting the next field } var cellOldValue = $(event.target).html(); // IE7 bug when clicking on the same cell twice? $(event.target).html('input id=selected type=text value=' + $ (event.target).html() + '/'); $(event.target).children(input:first).focus(); $(event.target).children(input:first).blur(function (event){ if (cellOldValue != $('#selected').val()){ var i = 0; // find the index of the cell, could have used cellIndex but it apparently has some problems in som browsers var td = $(event.target).parent(); while (td.prev().length != 0){ td = td.prev(); i++; } cellPostData($(event.target).parent().parent().attr(id), i, $ ('#selected').val()); //save data } $(event.target).parent().html($('#selected').val()); //remove the input at set the new value in the cell }); }
[jQuery] superfish: how do I turn off animations
Silly Question: How do I call superfish so that it doesn't animate anything? I tried passing it an empty object {}, but that didn't work. Thanks!
[jQuery] accessing offsetHeight
I'm new to Javascript and jQuery, so I'm sorry if this is basic stuff. How do I access offsetHeight for an element? This is what I have, but offsetHeight comes up undefined: var headerElem = $(#header); var headerHeight = headerElem.offsetHeight; whereas this works: var docHeader = document.getElementById(header); headerHeight = docHeader.offsetHeight; Thanks --MERC
[jQuery] Re: jqGrid new version
Hi Tony, Great job, thanks! May I suggest that in multiselect, support SHIFT and CTRL, just like GMail does. Which means that you can press SHIFT and select a range of items. Jiming Tony wrote: I have released a new version of jqGrid. Demo page here: http://trirand.com/jqgrid/jqgrid.html Home page: http://www.trirand.com/blog/ Enjoy.
[jQuery] Re: Interface v1.2 Error with jQuery v1.2.1
Turn off any fx options you have. I had the same problem but then removed Slide and it worked fine. On Sep 18, 3:48 am, moltar [EMAIL PROTECTED] wrote: Hi, I am using the latest jQuery v1.2.1 and the latest available Interface v1.2. Here is the sample code that I have broken down to: $(document).ready(function(){ $('a.slide').click(function() { $('#box').SlideOutLeft('normal'); }); }); Firebug goes bananas when the event is fired and keeps looping over the same error, producing thousands of error messages. The error message reads: this.options.curAnim has no properties. Here is the ZIP archive with test files:http://www.mediafire.com/?9eha1idjyyx
[jQuery] How to push data to parent iFrame?
I have a page that opens an iFrame with selection information on it. When the user selects one of the options, it needs push certain data back to the parent frame regarding what was choosen (i.e. a description to a textarea, option id, etc). How do I reference the parent frame's fields to change their values? Thanks
[jQuery] Chaining actions event handling, newbie.
Hi, One year since I discovered jQuery, it's quite the time to use it. So... Let's go... I'm in trouble with a little ajax i'm trying to set up. How to apply an event handler on ajax loaded content ? In my case, I've got a link which load a form in a div with $.get(). In the success callback, I apply an ajaxSubmit() action on form.submit(). On ajaxSubmit() success, response is parsed and form's div content is replaced by the response. The response can handle form. So, when I submit this new form, there's no ajaxSubmit() applied, too bad. I repeat my question : How to apply an event handler on ajax loaded content ? Best regards.
[jQuery] Re: need a simple jquery alert or prompt example with ok or cancel choices
It looks like the syntax you are using is from jQuery's Impromptu plugin ( http://trentrichardson.com/Impromptu/ ), if this is what you're using then you need $. infront of the prompt like so: $.prompt(Are you sure you want to delete?, { buttons: {Ok:true,Cancel:false } }); otherwise just prompt by itself only handles Ok and Cancel, there is no button option that I'm aware of. On Oct 1, 11:59 am, FrankTudor [EMAIL PROTECTED] wrote: I have a jquery script that gives the user a prompt and a choice to make sure they want to delete a value from a datasource. Here is my code... It prompts funny...and it goes ahead and processes anyways even if you select cancel.. Can someone fix me up here? script type=text/javascript $(document).ready(function() { $(a).click(function() { prompt(Are you sure you want to delete?,{buttons: {Ok:true,Cancel:false}}); } ); } ); /script Thanks, Frank
[jQuery] Chaining actions event handling, newbie.
Hi, One year since I discovered jQuery, it's quite the time to use it. So... Let's go... I'm in trouble with a little ajax i'm trying to set up. How to apply an event handler on ajax loaded content ? In my case, I've got a link which load a form in a div with $.get(). In the success callback, I apply an ajaxSubmit() action on form.submit(). On ajaxSubmit() success, response is parsed and form's div content is replaced by the response. The response can handle form. So, when I submit this new form, there's no ajaxSubmit() applied, too bad. I repeat my question : How to apply an event handler on ajax loaded content ? Best regards.
[jQuery] Re: safari (win, mac) issues with fadeIn + callback
Hi, I googled this thread (having the same problem) and it seems that Safari won't render images that have the CSS-property display: block set. See this site: http://f6design.com/journal/2006/09/29/image-source-swapping-css-and-safari/ This is a serious issue cause the whole library runs on the display property. On Oct 3, 11:28 am, bytte [EMAIL PROTECTED] wrote: Still looking for a Safari mastermind that can help me out on this one... ;) On 1 okt, 14:24, bytte [EMAIL PROTECTED] wrote: I have the latest jQuery version installed. And the problem occurs on the stable 2.0 version ofSafarion Mac. Too bad. Anyone else that has any idea? On 1 okt, 05:26, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: You should update your jQuery version... i had version 1.1.3.1 and it didn't work right inSafari3. With version 1.2.xx it works fine. On Sep 30, 1:51 pm, bytte [EMAIL PROTECTED] wrote: I've been looking into this for the past 12 hours or so. I'm starting to get crazy. Any help would be deeply appreciated. It works in all browsers, yet not inSafari. (sorry for bumping - but this list is my last hope at the moment) On 29 sep, 16:53, bytte [EMAIL PROTECTED] wrote: I have made a very basic slideshow, with help from this list, that looks for images in a database, then displays them. Here's the link:http://www.sum.be/project/item.php?item=14ID=39〈=1(navigate through the pics by using the small arrows to the right of the picture) It works ok in all tested browsers (ff mac/win, ie, opera mac/win), yet not onsafari(mac+win). As you'll see there's a problem with the fadeIn/fadeOut resulting in a blank space where the picture should reside. Here's the code I use to make the old picture fadeOut and the new one fadeIn: function showNewPic(json,lang) { var img = new Image(); img.onload = function(){ $('.jq_loading').hide(); $('.projectpic').fadeOut(fast,function() { $('.projectpic').attr({ src: ../layout/images/ uploads/+json.picture, id: jq_ +json.item_ID+ _ +json.menu_een_ID + _ +json.menu_twee_ID+ _ +lang+ _ +json.ID, alt: json.alt }).fadeIn(fast); }); } img.src = ../layout/images/uploads/+json.picture; } Any idea why it fails inSafari? TheSafariJavascript console gives me no errors whatsoever.
[jQuery] Re: how does jQuery's timeout used?
A timeout is not an error?? On 17 ago, 07:42, Erik Beeson [EMAIL PROTECTED] wrote: I guess thetimeoutjust means it will stop trying to complete the request. I've never actually tried to use it. To get an alert like you want, you might try using your own timer (untested): var ajax_timeout; $.ajax({ ..., beforeSend: function() { ajax_timeout = setTimeout(function() { alert('Request is taking a long time.'); }, 5000); }, success: function() { if(ajax_timeout) { clearTimeout(ajax_timeout); } } }); --Erik On 8/16/07, niner [EMAIL PROTECTED] wrote: i would like to handle thetimeoutsituation with jQuery but could not find a lot of information on that. i know you can specify timeout:5000 as the ajax parameter. but what happens when it times out? i tried it and it does not do anything. what i want is a simple alert() to show when it times out in 5 seconds. how can i accomplish that? thanks.
[jQuery] Re: jQuery Datagrid Plugin v.7
Very interesting little plugin - this may just be what i am after for a project i am currently working on :) I will be looking at this over the next couple of days, hoping that this works with JSON dataset :D then my dreams would be answered!
[jQuery] Re: Any server status if use script tag for XSS?
Maybe you could attach an onload or onerror event to your html element (script) ? Anyway, jQuery has a home made method to let you do this, cross-browser: See http://docs.jquery.com/Ajax/jQuery.getScript#urlcallback Matt 2007/10/9, Jacky [EMAIL PROTECTED]: Hi, I would like to call crossite script. So I use the script tag technique (create script tag, assign src and append to head) to do so. But unlike xmlhttprequest, I cannot get any response status from it. So I just wonder if there is anyway I can detect if the remote script is not available? I tried to use try-catch, which works on Firefox but not IE. Code: $(document).ready(function(){ try{ var s = document.createElement(script); s.type = text/javascript; s.src = http://thisurldoesnotexist/dsfsdlfjk.js ; document.appendChild(s); } catch(e){ alert(any error); } }); -- Best Regards, Jacky 網絡暴民 http://jacky.seezone.net -- Matthias ETIENNE
[jQuery] Re: Using multiple versions of jQuery on the same page
I have exactly the same problem as Glen, that leads me to ask the same question, which is still unanswered: How does it know which jQuery to blow away and which to leave alone ?
[jQuery] [NEWS] jQuery Crash Course Article
My buddy Nick Dominguez sent this over to me: jQuery Crash Course http://www.digital-web.com/articles/jquery_crash_course Rey
[jQuery] Re: Rotate an Image 90 Degrees with jquery-rotate plugin
No demo? -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of cfdvlpr Sent: Monday, October 08, 2007 5:12 PM To: jQuery (English) Cc: jquery-rotate Subject: [jQuery] Rotate an Image 90 Degrees with jquery-rotate plugin I started a rather lengthy discussion about this awhile back and never really found anything to work. However, I just came across this plugin that seems like it might do the trick: http://code.google.com/p/jquery-rotate/ Has anyone else used this plugin? Does it work well for you?
[jQuery] Re: Session management in an Ajax app
Rey, A buddy of mine, Raymond Camden, posted an interesting question on his blog: How can you timeout a session in an Ajax-based application? http://www.coldfusionjedi.com/index.cfm/2007/10/8/Ask-a-Jedi-How-can-you- timeout-a-session-in-an-Ajaxbased-application The gist is that if you have a dashboard-type app and you need to determine if your session has timed out on the next Ajax request, how would you go about doing it. He mentioned creating a ping-like service that would poll the server every so often. It seems that this would dramatically increase the number of HTTP requests. Since session management is available in many server-side languages, not just ColdFusion obviously, I think this is a good topic that's applicable to most any project. Is there a better way of doing it? Instead of pinging the server to keep a session alive, you can use HTTP response headers and let your AJAX code use those to determine what to do. I've put together a little example that shows off 2 approaches. Using a customer response header to track session state and using a 403 - Forbidden status code. You can then use the response header to determine what the AJAX call should do. Here's an example: http://www.pengoworks.com/workshop/jquery/session_expired_example.cfm IMO opinion this is a much simpler and robust solution. -Dan
[jQuery] Which Validation Verison with jQuery 1.2.1?
Hi, all. I'm trying to figure out which version of Joern's validation plug-in works with jQuery 1.2.1 for use with IE 7. Validation version 1.1 works with 1.2.1 on FF2, but not IE 7. Clues, anyone? Rick
[jQuery] Re: Getting a specific option in a select
Hi Giovanni, What are you trying to do with the $('#category_1') part? Is that meant to be a contextual selector? If so, you might have better luck trying it one of these ways: $('option[value*=\'2\']', '#category_1').size() $('#category_1 option[value*=\'2\']').size() $('#category_1').find('option[value*=\'2\']').size() A couple other trivial things: (a) you don't really need to the quotes around the 2, and (b) size() and length are synonymous. So, you could do this, too: $('option[value*=2]', '#category_1').length Hope that works for you. --Karl _ Karl Swedberg www.englishrules.com www.learningjquery.com On Oct 9, 2007, at 4:17 AM, Giovanni Battista Lenoci wrote: It was a mistake in cut paste... Tryed also without the star, but I can't get the option. :-( On Oct 8, 9:18 pm, motob [EMAIL PROTECTED] wrote: Try removing the colon (:) after the option element, like so: $('option[value*=\'2\']', $('#category_1')).size() On Oct 8, 12:11 pm, Giovanni Battista Lenoci [EMAIL PROTECTED] wrote: Hi, I'm trying to get the option with a specific value in it. This is the syntax I use and doesn't works: alert($('option:[value*=\'2\']', $('#category_1')).size()); It alerts 0, if I try without the value I get the correct size of the options in the select. Where's the error? Thank you
[jQuery] jquery to center a block element, footer bottom
I have two questions: How do you center a block as browser window resized? How to make the footer stay bottom of viewport?
[jQuery] Re: Using multiple versions of jQuery on the same page
After looking at the code it seems quite straight-forward. Someone correct me if I've got the wrong end of the stick. Summary: The first version you include will get reinstated, the second version getting blown away. How it works: When you include jQuery, it makes a copy of the window.$ and window.jQuery variables and puts them into _$ and _jQuery (variables inside jQuery itself) respectively. So if there's already a copy of jQuery included on the page (call it v1) and you go include your second copy (call it v2), v1 will get 'backed up' into the _$ and _jQuery variables inside v2 and the second copy you include will go into window.$ and window.jQuery. At this point, if you use the $ function or the jQuery object, you'll be using v2. When you call jQuery.noConflict(true), it will run against v2 because that's what's in window.jQuery and it'll take the variables in _$ and _jQuery (which are v1), put them back into window.$ and window.jQuery, and return you a copy of v2 for you to put into a variable (called jQv2 for example). At this point, window.$ and window.jQuery will be v1 and jQv2 will be v2. So if you want to use v1, you carry on using $(...) or jQuery.whatever(...) and if you want to use v2, you use jQv2('#someId') or jQv2.whatever(...). Hope this makes sense. George. On Oct 4, 12:27 am, Glen Lipka [EMAIL PROTECTED] wrote: We are making a jQuery+stuff script that will go on lots of random pages with unknown libraries. Some of those pages will have jQuery. (Various versions) If I am including our script last; what is the best way to make sure our script doesn't interfere with any of the existing page, including old versions of jQuery. Solution #1: We renamed jQuery in our script everywhere to be veryjQuery. Solution #2: ??? Note: Solution #1 solved the problem, but feels invasive. Is there a noconflict() way to do this? Glen
[jQuery] Superfish embed flash object
Hi Joel, I am using superfish on a page with an embeded flash object, the menu displays behind the flash. Do you know a way to make it show in front of the flash object? See an example of what I mean here. http://www.newportmirage.com.au/files/VirtualTour/low/virtual-tour-low-res.html I have upgraded to jquery 1.2.1 and superfish 1.3.1, however my style sheet is a modified version of an earlier vertical example (has it been modified for 1.3.1?). Thanks Mark
[jQuery] animating multiple items at the same time
Hi! I am relatively new to jQuery and recently ran into the following problem. Let's say I have a few DIVs of the same dimensions on top of each other. I need to expand/shrink them at the same time. I tried running a loop through these DIVs and doing something like: for(i=0;i5;i++){ $('#divid'+i).animate({width: 400}, 'slow'); } this works but the animations don't occur at exactly the same time for each element (loop delay obviously). Is there a way to make all animations start at the same time? Thanks
[jQuery] Re: accessing offsetHeight
Hi Merc, If you want an integer, try this: var headerElem = $(#header); var headerHeight = headerElem.height(); If you want the value with px, try this: var headerElem = $(#header); var headerHeight = headerElem.css('height'); Hope that helps. --Karl _ Karl Swedberg www.englishrules.com www.learningjquery.com On Oct 9, 2007, at 1:02 AM, Merc70 wrote: I'm new to Javascript and jQuery, so I'm sorry if this is basic stuff. How do I access offsetHeight for an element? This is what I have, but offsetHeight comes up undefined: var headerElem = $(#header); var headerHeight = headerElem.offsetHeight; whereas this works: var docHeader = document.getElementById(header); headerHeight = docHeader.offsetHeight; Thanks --MERC
[jQuery] Re: Any server status if use script tag for XSS?
I actually posted to the dev list about a similar issue (using JSONP, which is script-like). I'd like to put a short timer on the script calls and receive a timeout if the callback function fails to fire. Scott On 10/8/07, Jacky [EMAIL PROTECTED] wrote: Hi, I would like to call crossite script. So I use the script tag technique (create script tag, assign src and append to head) to do so. But unlike xmlhttprequest, I cannot get any response status from it. So I just wonder if there is anyway I can detect if the remote script is not available? I tried to use try-catch, which works on Firefox but not IE. Code: $(document).ready(function(){ try{ var s = document.createElement(script); s.type = text/javascript; s.src = http://thisurldoesnotexist/dsfsdlfjk.js ; document.appendChild(s); } catch(e){ alert(any error); } }); -- Best Regards, Jacky 網絡暴民 http://jacky.seezone.net -- -- Scott Trudeau scott.trudeau AT gmail DOT com http://sstrudeau.com/ AIM: sodthestreets
[jQuery] Enable/Disable extension
Am I re-inventing the wheel here? I just want a simple extension to test if a control is enabled and to set jQuery objects quickly. If this has already been done, could you point me to it? If not, please offer comments on my approach. Thanks, Dave jQuery.fn.enabled = function(enableIt) { //sets object(s) to enabled/disabled or returns the enabled state of the first element if (enableIt == null || enableIt == undefined) //nothing passed, just return state of first element { return !($(this).attr(disabled) == disabled); } else //setting element(s) { $(this).each(function(){ if (enableIt) { $(this).removeAttr(disabled); } else { $(this).attr(disabled, disabled); } }); return this; //keep chain } };
[jQuery] Re: animating multiple items at the same time
Simplest way might be to assign a class to each of them. This way you can reference them individually by ID or as part of a group by classname. Or put them all in a parent container and reference them with child selectors: $('#container div') andy -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of petrozza Sent: Tuesday, October 09, 2007 9:17 AM To: jQuery (English) Subject: [jQuery] animating multiple items at the same time Hi! I am relatively new to jQuery and recently ran into the following problem. Let's say I have a few DIVs of the same dimensions on top of each other. I need to expand/shrink them at the same time. I tried running a loop through these DIVs and doing something like: for(i=0;i5;i++){ $('#divid'+i).animate({width: 400}, 'slow'); } this works but the animations don't occur at exactly the same time for each element (loop delay obviously). Is there a way to make all animations start at the same time? Thanks
[jQuery] Re: jQuery 1.2.1 and Validation Plug-in won't run in IE 7...
Yeah, that was the one. It didnt work in IE. I got the september 25 version (on the 26th, I think!) and viola, it worked in IE. Stupid question but - are you sure you're linking to the correct js file, it exists on the server, etc? Here's the one I am using http://comparemyagent.com/fa/js/jquery.validate.js Here's an example of a page that is using it http://comparemyagent.com/fa/fa_buy-sell.cfm -- -- Michael Evangelista, Evangelista Design Web : www.mredesign.com Newsgroups: news://forums.mredesign.com Blog : www.miuaiga.com Rick Faircloth [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Now, I found v. 1.1, dated Sep 25, 2007, but it's not working either. I'll keep looking. what's the date of the one that works for you, Michael? Rick From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Rick Faircloth Sent: Tuesday, October 09, 2007 12:51 AM To: jquery-en@googlegroups.com Subject: [jQuery] Re: jQuery 1.2.1 and Validation Plug-in won't run in IE 7... Hi, Michael. I did find a new version ( 1.1, Jun 21, 2007 ), but it's still not working in IE 7 with jQuery 1.2.1. It works in FF2. It still works with jQuery 1.1.1. Perhaps that's not the latest version? Rick From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of MichaelEvangelista Sent: Tuesday, October 09, 2007 12:04 AM To: jquery-en@googlegroups.com Subject: [jQuery] Re: jQuery 1.2.1 and Validation Plug-in won't run in IE 7... Hi Rick - I had a similar issue with jQuery 1.2 and IE... until I read down towards the bottom of Joern's discussion page for the plugin , and saw a link to a new version posted just a few weeks ago... works great now! Let me know if you don't find it. -- -- Michael Evangelista, Evangelista Design Web : www.mredesign.com Newsgroups: news://forums.mredesign.com Blog : www.miuaiga.com Rick Faircloth [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi, all. I'm trying to run Jorn's validation plug-in ( 1.0, beta 1 ) with jQuery 1.2.1. They work together in Firefox, but not in IE 7. However, I can get them to work in IE 7 if I use jQuery 1.1.1. Any issues going on with jQuery 1.2.1 and Jorn's validation plug-in? Rick
[jQuery] Re: Chaining actions event handling, newbie.
There is a plugin for that called LivejQuery. http://blog.brandonaaron.net/2007/08/19/new-plugin-live-query/ It does exactly what you want. Glen On 10/9/07, ClapClap [EMAIL PROTECTED] wrote: Hi, One year since I discovered jQuery, it's quite the time to use it. So... Let's go... I'm in trouble with a little ajax i'm trying to set up. How to apply an event handler on ajax loaded content ? In my case, I've got a link which load a form in a div with $.get(). In the success callback, I apply an ajaxSubmit() action on form.submit(). On ajaxSubmit() success, response is parsed and form's div content is replaced by the response. The response can handle form. So, when I submit this new form, there's no ajaxSubmit() applied, too bad. I repeat my question : How to apply an event handler on ajax loaded content ? Best regards.
[jQuery] Re: jQuery 1.2.1 and Validation Plug-in won't run in IE 7...
Here's something a little strange. Now, in both FF2 and IE 7, the validation doesn't until I hit enter to submit or click the submit button/ Once that happens, all validation messages show up, and from then on the validation happens as it should. Here's my validation code, js file references, and an HTML sample for error messages display... am I missing something? Everything validates in Firebug... script type=text/javascript src=../js/jquery-1.2.1.js/script script type=text/javascript src=../js/jquery.validate_1.1.js/script (I renamed the validation plug-in so I could keep track of the versions...) script type=text/javascript // $.validator.defaults.debug = true; $().ready(function() { $(#calendar_add_form).validate({ errorPlacement: function(error, element) { error.appendTo(# + element.attr('id') + _error); }, focusInvalid: false, event: keyup, rules: { event_name: {required: true}, event_description: {required: true}, event_date: {required: true, date: true}, event_time: {required: true}, event_location: {required: true}, contact_person: {required: true}, entered_by: {required: true} }, messages: { event_name: {required: Please enter a name for the event.}, event_description: {required: Please enter a description of the event.}, event_date: {required: Please enter the date of the event. (Format: Feb 12, 2007), date: This entry must be a valid date. (Format: Feb 12, 2007)}, event_time: {required: Please enter a valid time for the event. (Format: 10:00 am)}, event_location: {required: Please enter the event location.}, contact_person: {required: Please enter the contact person's name.}, entered_by: {required: Please enter your name.} } }) }); /script HTML for error message display: div style=margin-top:10px; id=event_name_error class=error/div (This part is for the server-side ColdFusion validation) cfif IsDefined(form.fieldnames) and IsDefined(form_errors.event_name) p style=font-weight:bold; class=error cfoutput#form_errors.event_name#/cfoutput /p /cfif -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of MichaelEvangelista Sent: Tuesday, October 09, 2007 10:25 AM To: jquery-en@googlegroups.com Subject: [jQuery] Re: jQuery 1.2.1 and Validation Plug-in won't run in IE 7... Yeah, that was the one. It didnt work in IE. I got the september 25 version (on the 26th, I think!) and viola, it worked in IE. Stupid question but - are you sure you're linking to the correct js file, it exists on the server, etc? Here's the one I am using http://comparemyagent.com/fa/js/jquery.validate.js Here's an example of a page that is using it http://comparemyagent.com/fa/fa_buy-sell.cfm -- -- Michael Evangelista, Evangelista Design Web : www.mredesign.com Newsgroups: news://forums.mredesign.com Blog : www.miuaiga.com Rick Faircloth [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Now, I found v. 1.1, dated Sep 25, 2007, but it's not working either. I'll keep looking. what's the date of the one that works for you, Michael? Rick From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Rick Faircloth Sent: Tuesday, October 09, 2007 12:51 AM To: jquery-en@googlegroups.com Subject: [jQuery] Re: jQuery 1.2.1 and Validation Plug-in won't run in IE 7... Hi, Michael. I did find a new version ( 1.1, Jun 21, 2007 ), but it's still not working in IE 7 with jQuery 1.2.1. It works in FF2. It still works with jQuery 1.1.1. Perhaps that's not the latest version? Rick From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of MichaelEvangelista Sent: Tuesday, October 09, 2007 12:04 AM To: jquery-en@googlegroups.com Subject: [jQuery] Re: jQuery 1.2.1 and Validation Plug-in won't run in IE 7... Hi
[jQuery] apply a class to the active sub menu
Hello, I would like to apply a class to the active sub menu. I used previously to select the sub menu with this: var $path = location.pathname.substring(1); $('#nav [EMAIL PROTECTED]' + $path + ']').addClass('active'); But it failed with the last jquery version I tried: $('#nav a[href=' + $path + ']').addClass('active'); But with no success.. Any idea of the problem in the syntax used or of the syntax to use with the new jquery version? Thanks in advance. Xavier
[jQuery] Re: jQuery 1.2.1 and Validation Plug-in won't run in IE 7...
Hi Rick - let me say right up front I'm no expert. But - have a look at my page's source (link in post above, in this thread) I am calling the rules a bit differently, using the class and title of the input itself, and actually have the onKeyUp validation turned off in this case, so mine works as you describe, on submit, rather than on tabbing through or completing the fields. Sorry not to be more help - I know how frustrating it can be when you are *that* close to perfect... but not quite! -- -- Michael Evangelista, Evangelista Design Web : www.mredesign.com Newsgroups: news://forums.mredesign.com Blog : www.miuaiga.com Rick Faircloth [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Here's something a little strange. Now, in both FF2 and IE 7, the validation doesn't until I hit enter to submit or click the submit button/ Once that happens, all validation messages show up, and from then on the validation happens as it should. Here's my validation code, js file references, and an HTML sample for error messages display... am I missing something? Everything validates in Firebug... script type=text/javascript src=../js/jquery-1.2.1.js/script script type=text/javascript src=../js/jquery.validate_1.1.js/script (I renamed the validation plug-in so I could keep track of the versions...) script type=text/javascript // $.validator.defaults.debug = true; $().ready(function() { $(#calendar_add_form).validate({ errorPlacement: function(error, element) { error.appendTo(# + element.attr('id') + _error); }, focusInvalid: false, event: keyup, rules: { event_name: {required: true}, event_description: {required: true}, event_date: {required: true, date: true}, event_time: {required: true}, event_location: {required: true}, contact_person: {required: true}, entered_by: {required: true} }, messages: { event_name: {required: Please enter a name for the event.}, event_description: {required: Please enter a description of the event.}, event_date: {required: Please enter the date of the event. (Format: Feb 12, 2007), date: This entry must be a valid date. (Format: Feb 12, 2007)}, event_time: {required: Please enter a valid time for the event. (Format: 10:00 am)}, event_location: {required: Please enter the event location.}, contact_person: {required: Please enter the contact person's name.}, entered_by: {required: Please enter your name.} } }) }); /script HTML for error message display: div style=margin-top:10px; id=event_name_error class=error/div (This part is for the server-side ColdFusion validation) cfif IsDefined(form.fieldnames) and IsDefined(form_errors.event_name) p style=font-weight:bold; class=error cfoutput#form_errors.event_name#/cfoutput /p /cfif -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of MichaelEvangelista Sent: Tuesday, October 09, 2007 10:25 AM To: jquery-en@googlegroups.com Subject: [jQuery] Re: jQuery 1.2.1 and Validation Plug-in won't run in IE 7... Yeah, that was the one. It didnt work in IE. I got the september 25 version (on the 26th, I think!) and viola, it worked in IE. Stupid question but - are you sure you're linking to the correct js file, it exists on the server, etc? Here's the one I am using http://comparemyagent.com/fa/js/jquery.validate.js Here's an example of a page that is using it http://comparemyagent.com/fa/fa_buy-sell.cfm -- -- Michael Evangelista, Evangelista Design Web : www.mredesign.com Newsgroups: news://forums.mredesign.com Blog : www.miuaiga.com Rick Faircloth [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Now, I found v. 1.1, dated Sep 25, 2007, but it's not working either. I'll keep looking. what's the date of the one that works for you, Michael? Rick From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Rick Faircloth Sent: Tuesday, October 09, 2007 12:51 AM To: jquery-en@googlegroups.com Subject: [jQuery] Re: jQuery 1.2.1 and Validation Plug-in won't run in IE 7... Hi, Michael. I did find a new version ( 1.1, Jun 21, 2007 ), but it's still not working in IE 7 with jQuery 1.2.1. It works in FF2. It still works with jQuery 1.1.1. Perhaps that's not the latest version? Rick From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of MichaelEvangelista Sent: Tuesday, October 09, 2007 12:04 AM To: jquery-en@googlegroups.com Subject: [jQuery] Re: jQuery 1.2.1 and Validation Plug-in won't run in IE 7... Hi Rick - I had a similar issue with jQuery 1.2 and IE... until I read down towards the bottom of Joern's discussion page for the plugin , and saw a link to a new version posted just a few weeks ago... works great now! Let me know if you don't find it. -- -- Michael Evangelista, Evangelista Design Web : www.mredesign.com Newsgroups: news://forums.mredesign.com Blog : www.miuaiga.com Rick Faircloth [EMAIL PROTECTED] wrote
[jQuery] Re: Rotate an Image 90 Degrees with jquery-rotate plugin
I couldn't find one. :(
[jQuery] Re: jQuery 1.2.1 and Validation Plug-in won't run in IE 7...
Yes, your validation and error display is quite different from mine, but I think the major difference in the validation is what triggers it... for yours its after the form is submitted... for mine it keyup. However, the keyup is only kicking in after I submit the form once. It's not terrible this way... the user has a chance to fill the form out correctly and the form will pass both client-side and server-side validation. However, if there are problems, the keyup validation will kick in, guiding the user through each form field. Might actually be better like this. I just wish it would behave as expected. Who knows what will happen in production! Rick -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of MichaelEvangelista Sent: Tuesday, October 09, 2007 11:39 AM To: jquery-en@googlegroups.com Subject: [jQuery] Re: jQuery 1.2.1 and Validation Plug-in won't run in IE 7... Hi Rick - let me say right up front I'm no expert. But - have a look at my page's source (link in post above, in this thread) I am calling the rules a bit differently, using the class and title of the input itself, and actually have the onKeyUp validation turned off in this case, so mine works as you describe, on submit, rather than on tabbing through or completing the fields. Sorry not to be more help - I know how frustrating it can be when you are *that* close to perfect... but not quite! -- -- Michael Evangelista, Evangelista Design Web : www.mredesign.com Newsgroups: news://forums.mredesign.com Blog : www.miuaiga.com Rick Faircloth [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Here's something a little strange. Now, in both FF2 and IE 7, the validation doesn't until I hit enter to submit or click the submit button/ Once that happens, all validation messages show up, and from then on the validation happens as it should. Here's my validation code, js file references, and an HTML sample for error messages display... am I missing something? Everything validates in Firebug... script type=text/javascript src=../js/jquery-1.2.1.js/script script type=text/javascript src=../js/jquery.validate_1.1.js/script (I renamed the validation plug-in so I could keep track of the versions...) script type=text/javascript // $.validator.defaults.debug = true; $().ready(function() { $(#calendar_add_form).validate({ errorPlacement: function(error, element) { error.appendTo(# + element.attr('id') + _error); }, focusInvalid: false, event: keyup, rules: { event_name: {required: true}, event_description: {required: true}, event_date: {required: true, date: true}, event_time: {required: true}, event_location: {required: true}, contact_person: {required: true}, entered_by: {required: true} }, messages: { event_name: {required: Please enter a name for the event.}, event_description: {required: Please enter a description of the event.}, event_date: {required: Please enter the date of the event. (Format: Feb 12, 2007), date: This entry must be a valid date. (Format: Feb 12, 2007)}, event_time: {required: Please enter a valid time for the event. (Format: 10:00 am)}, event_location: {required: Please enter the event location.}, contact_person: {required: Please enter the contact person's name.}, entered_by: {required: Please enter your name.} } }) }); /script HTML for error message display: div style=margin-top:10px; id=event_name_error class=error/div (This part is for the server-side ColdFusion validation) cfif IsDefined(form.fieldnames) and IsDefined(form_errors.event_name) p style=font-weight:bold; class=error cfoutput#form_errors.event_name#/cfoutput /p /cfif -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of MichaelEvangelista Sent: Tuesday, October 09, 2007 10:25 AM To: jquery-en@googlegroups.com Subject: [jQuery] Re: jQuery 1.2.1 and Validation Plug-in won't run in IE 7... Yeah, that was the one. It didnt work in IE. I got the september 25 version (on the 26th, I think!) and viola, it worked in IE. Stupid question but - are you sure you're linking to the correct js file, it exists on the server, etc? Here's the one I am using http://comparemyagent.com/fa/js/jquery.validate.js Here's an example of a page that is using it http://comparemyagent.com/fa/fa_buy-sell.cfm -- -- Michael Evangelista, Evangelista Design Web : www.mredesign.com Newsgroups: news://forums.mredesign.com Blog : www.miuaiga.com Rick Faircloth [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Now, I found v. 1.1, dated Sep 25, 2007, but it's not working either. I'll keep looking.
[jQuery] Re: accessing offsetHeight
I would change the name of the headerElem variable too. That name clearly indicates that it's supposed to be a DOM element, but it isn't. This will lead to much confusion. $() does not return a DOM element, it returns a jQuery object, which is an array of DOM elements (even in the case where there is only one). Merc, one convention you'll find in a lot of jQuery code is to use $ at the beginning of a variable that contains a jQuery object: var $header = $('#header'); var headerHeight = $header.height(); This gives you a visual reminder that the variable is a jQuery object, since it looks like the $ that was used to create the object in the first place. If you do want to get to the actual DOM element(s) inside a jQuery object, use array indexing. In the case of a #id selector, there is only a single element and you can use [0]: var $header = $('#header'); var headerElement = $header[0]; var headerHeight = headerElement.offsetHeight; -Mike _ From: Karl Swedberg Hi Merc, If you want an integer, try this: var headerElem = $(#header); var headerHeight = headerElem.height(); If you want the value with px, try this: var headerElem = $(#header); var headerHeight = headerElem.css('height'); Hope that helps. --Karl _ Karl Swedberg www.englishrules.com www.learningjquery.com On Oct 9, 2007, at 1:02 AM, Merc70 wrote: I'm new to Javascript and jQuery, so I'm sorry if this is basic stuff. How do I access offsetHeight for an element? This is what I have, but offsetHeight comes up undefined: var headerElem = $(#header); var headerHeight = headerElem.offsetHeight; whereas this works: var docHeader = document.getElementById(header); headerHeight = docHeader.offsetHeight; Thanks --MERC
[jQuery] Re: jQuery 1.2.1 and Validation Plug-in won't run in IE 7...
Have you tried a post on Joern's plug in page? He answers those posts pretty frequently. -- -- Michael Evangelista, Evangelista Design Web : www.mredesign.com Newsgroups: news://forums.mredesign.com Blog : www.miuaiga.com Rick Faircloth [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Yes, your validation and error display is quite different from mine, but I think the major difference in the validation is what triggers it... for yours its after the form is submitted... for mine it keyup. However, the keyup is only kicking in after I submit the form once. It's not terrible this way... the user has a chance to fill the form out correctly and the form will pass both client-side and server-side validation. However, if there are problems, the keyup validation will kick in, guiding the user through each form field. Might actually be better like this. I just wish it would behave as expected. Who knows what will happen in production! Rick -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of MichaelEvangelista Sent: Tuesday, October 09, 2007 11:39 AM To: jquery-en@googlegroups.com Subject: [jQuery] Re: jQuery 1.2.1 and Validation Plug-in won't run in IE 7... Hi Rick - let me say right up front I'm no expert. But - have a look at my page's source (link in post above, in this thread) I am calling the rules a bit differently, using the class and title of the input itself, and actually have the onKeyUp validation turned off in this case, so mine works as you describe, on submit, rather than on tabbing through or completing the fields. Sorry not to be more help - I know how frustrating it can be when you are *that* close to perfect... but not quite! -- -- Michael Evangelista, Evangelista Design Web : www.mredesign.com Newsgroups: news://forums.mredesign.com Blog : www.miuaiga.com Rick Faircloth [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Here's something a little strange. Now, in both FF2 and IE 7, the validation doesn't until I hit enter to submit or click the submit button/ Once that happens, all validation messages show up, and from then on the validation happens as it should. Here's my validation code, js file references, and an HTML sample for error messages display... am I missing something? Everything validates in Firebug... script type=text/javascript src=../js/jquery-1.2.1.js/script script type=text/javascript src=../js/jquery.validate_1.1.js/script (I renamed the validation plug-in so I could keep track of the versions...) script type=text/javascript // $.validator.defaults.debug = true; $().ready(function() { $(#calendar_add_form).validate({ errorPlacement: function(error, element) { error.appendTo(# + element.attr('id') + _error); }, focusInvalid: false, event: keyup, rules: { event_name: {required: true}, event_description: {required: true}, event_date: {required: true, date: true}, event_time: {required: true}, event_location: {required: true}, contact_person: {required: true}, entered_by: {required: true} }, messages: { event_name: {required: Please enter a name for the event.}, event_description: {required: Please enter a description of the event.}, event_date: {required: Please enter the date of the event. (Format: Feb 12, 2007), date: This entry must be a valid date. (Format: Feb 12, 2007)}, event_time: {required: Please enter a valid time for the event. (Format: 10:00 am)}, event_location: {required: Please enter the event location.}, contact_person: {required: Please enter the contact person's name.}, entered_by: {required: Please enter your name.} } }) }); /script HTML for error message display: div style=margin-top:10px; id=event_name_error class=error/div (This part is for the server-side ColdFusion validation) cfif IsDefined(form.fieldnames) and IsDefined(form_errors.event_name) p style=font-weight:bold; class=error cfoutput#form_errors.event_name#/cfoutput /p /cfif -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of MichaelEvangelista Sent: Tuesday, October 09, 2007 10:25 AM To: jquery-en@googlegroups.com Subject: [jQuery] Re: jQuery 1.2.1 and Validation Plug-in won't run in IE 7... Yeah, that was the one. It didnt work in IE. I got the september 25 version (on the 26th, I think!) and viola, it worked in IE. Stupid question but - are you sure you're linking to the correct js file, it exists on the server, etc? Here's the one I am using http://comparemyagent.com/fa/js/jquery.validate.js Here's an example of a page that is using it http://comparemyagent.com/fa/fa_buy-sell.cfm -- -- Michael Evangelista, Evangelista Design Web : www.mredesign.com Newsgroups: news://forums.mredesign.com Blog : www.miuaiga.com Rick Faircloth [EMAIL
[jQuery] Re: 1.2 and XPath Contains Predicate Selector
checked it today - Yep - it did the trick! Thanks Karl! Karl Swedberg-2 wrote: Hi there, In 1.2.x, you would use the CSS equivalent: $(a[id *= smenu]) Or, you could use the Basic XPath plugin. http://jquery.com/plugins/project/xpath Hope that helps, --Karl _ Karl Swedberg www.englishrules.com www.learningjquery.com On Oct 2, 2007, at 11:54 AM, corpore wrote: ..mmh, have a bit of a problem with the XPath Contains Predicate Selector.. Updating code based on jQuery-1.1.3 to jQuery-1.2.1 and changing aforementioned selectors I've found that where something like this used to work: $([EMAIL PROTECTED] *= smenu]) the, obviously only apparent, equivalent: $(a:has(@id *= smenu)) does not. Where do I go wrong? -- View this message in context: http://www.nabble.com/1.2-and--XPath- Contains-Predicate-Selector-tf4555667s27240.html#a13001553 Sent from the jQuery General Discussion mailing list archive at Nabble.com. -- View this message in context: http://www.nabble.com/1.2-and--XPath-Contains-Predicate-Selector-tf4555667s27240.html#a13119039 Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: jQuery 1.2.1 and Validation Plug-in won't run in IE 7...
Not yet... but that sounds like a good idea. I thought maybe he might chime in here. Rick -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of MichaelEvangelista Sent: Tuesday, October 09, 2007 12:09 PM To: jquery-en@googlegroups.com Subject: [jQuery] Re: jQuery 1.2.1 and Validation Plug-in won't run in IE 7... Have you tried a post on Joern's plug in page? He answers those posts pretty frequently. -- -- Michael Evangelista, Evangelista Design Web : www.mredesign.com Newsgroups: news://forums.mredesign.com Blog : www.miuaiga.com Rick Faircloth [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Yes, your validation and error display is quite different from mine, but I think the major difference in the validation is what triggers it... for yours its after the form is submitted... for mine it keyup. However, the keyup is only kicking in after I submit the form once. It's not terrible this way... the user has a chance to fill the form out correctly and the form will pass both client-side and server-side validation. However, if there are problems, the keyup validation will kick in, guiding the user through each form field. Might actually be better like this. I just wish it would behave as expected. Who knows what will happen in production! Rick -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of MichaelEvangelista Sent: Tuesday, October 09, 2007 11:39 AM To: jquery-en@googlegroups.com Subject: [jQuery] Re: jQuery 1.2.1 and Validation Plug-in won't run in IE 7... Hi Rick - let me say right up front I'm no expert. But - have a look at my page's source (link in post above, in this thread) I am calling the rules a bit differently, using the class and title of the input itself, and actually have the onKeyUp validation turned off in this case, so mine works as you describe, on submit, rather than on tabbing through or completing the fields. Sorry not to be more help - I know how frustrating it can be when you are *that* close to perfect... but not quite! -- -- Michael Evangelista, Evangelista Design Web : www.mredesign.com Newsgroups: news://forums.mredesign.com Blog : www.miuaiga.com Rick Faircloth [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Here's something a little strange. Now, in both FF2 and IE 7, the validation doesn't until I hit enter to submit or click the submit button/ Once that happens, all validation messages show up, and from then on the validation happens as it should. Here's my validation code, js file references, and an HTML sample for error messages display... am I missing something? Everything validates in Firebug... script type=text/javascript src=../js/jquery- 1.2.1.js/script script type=text/javascript src=../js/jquery.validate_1.1.js/script (I renamed the validation plug-in so I could keep track of the versions...) script type=text/javascript // $.validator.defaults.debug = true; $().ready(function() { $(#calendar_add_form).validate({ errorPlacement: function(error, element) { error.appendTo(# + element.attr('id') + _error); }, focusInvalid: false, event: keyup, rules: { event_name: {required: true}, event_description: {required: true}, event_date: {required: true, date: true}, event_time: {required: true}, event_location: {required: true}, contact_person: {required: true}, entered_by: {required: true} }, messages: { event_name: {required: Please enter a name for the event.}, event_description: {required: Please enter a description of the event.}, event_date: {required: Please enter the date of the event. (Format: Feb 12, 2007), date: This entry must be a valid date. (Format: Feb 12, 2007)}, event_time: {required: Please enter a valid time for the event. (Format: 10:00 am)}, event_location: {required: Please enter the event location.}, contact_person: {required: Please enter the contact person's name.}, entered_by: {required: Please enter your name.} } }) }); /script HTML for error message display: div style=margin-top:10px; id=event_name_error class=error/div (This part is for the server-side ColdFusion validation) cfif IsDefined(form.fieldnames) and IsDefined(form_errors.event_name) p style=font-weight:bold; class=error cfoutput#form_errors.event_name#/cfoutput /p /cfif -Original Message- From: jquery-en@googlegroups.com [mailto:jquery- [EMAIL PROTECTED] On Behalf Of MichaelEvangelista Sent: Tuesday, October 09, 2007 10:25 AM To:
[jQuery] Re: Any server status if use script tag for XSS?
If the server return something like 404/500 page, I guess it would cause a javascript error when browser try to evaluate, and the try-catch method could work. Timer would be a good idea, but to determine the time to wait would require some specific measure. -- Best Regards, Jacky 網絡暴民 http://jacky.seezone.net On 10/9/07, Scott Trudeau [EMAIL PROTECTED] wrote: I actually posted to the dev list about a similar issue (using JSONP, which is script-like). I'd like to put a short timer on the script calls and receive a timeout if the callback function fails to fire. Scott On 10/8/07, Jacky [EMAIL PROTECTED] wrote: Hi, I would like to call crossite script. So I use the script tag technique (create script tag, assign src and append to head) to do so. But unlike xmlhttprequest, I cannot get any response status from it. So I just wonder if there is anyway I can detect if the remote script is not available? I tried to use try-catch, which works on Firefox but not IE. Code: $(document).ready(function(){ try{ var s = document.createElement(script); s.type = text/javascript; s.src = http://thisurldoesnotexist/dsfsdlfjk.js ; document.appendChild(s); } catch(e){ alert(any error); } }); -- Best Regards, Jacky 網絡暴民 http://jacky.seezone.net -- -- Scott Trudeau scott.trudeau AT gmail DOT com http://sstrudeau.com/ AIM: sodthestreets
[jQuery] Re: Any server status if use script tag for XSS?
If I remember correctly, getScript can't do cross site. -- Best Regards, Jacky 網絡暴民 http://jacky.seezone.net On 10/9/07, Matt [EMAIL PROTECTED] wrote: Maybe you could attach an onload or onerror event to your html element (script) ? Anyway, jQuery has a home made method to let you do this, cross-browser: See http://docs.jquery.com/Ajax/jQuery.getScript#urlcallback Matt 2007/10/9, Jacky [EMAIL PROTECTED]: Hi, I would like to call crossite script. So I use the script tag technique (create script tag, assign src and append to head) to do so. But unlike xmlhttprequest, I cannot get any response status from it. So I just wonder if there is anyway I can detect if the remote script is not available? I tried to use try-catch, which works on Firefox but not IE. Code: $(document).ready(function(){ try{ var s = document.createElement(script); s.type = text/javascript; s.src = http://thisurldoesnotexist/dsfsdlfjk.js ; document.appendChild(s); } catch(e){ alert(any error); } }); -- Best Regards, Jacky 網絡暴民 http://jacky.seezone.net -- Matthias ETIENNE
[jQuery] Improvements to the docs
Wouldn't it be a good idea to mention what version of jQuery functions are available in above each function, much like the PHP docs?
[jQuery] Re: Validation madness
How about these? - beforeSubmit: called before the validation starts - success: called when the form is valid - submitHandler: replaces the default submit, handler must do an ajaxSubmit or whatever Sounds outstanding, as long as the submitHandler only covered an ajaxSubmit. If it was an all out replacement for the default submit handler then there wouldn't really be a need for the other two options, as all of it could be rolled into someone's new 'submit' function, rolling the $(form).submit() within their own handler. I guess it's just a question of implementation and documentation. Thanks again for the excellent work you do with JQuery. -- Steve Cutter Blades Adobe Certified Professional Advanced Macromedia ColdFusion MX 7 Developer _ http://blog.cutterscrossing.com --- The Past is a Memory The Future a Dream But Today is a Gift That's why they call it The Present
[jQuery] Re: Validation madness
Whoops! One last thing. An 'onValidationFailure' type of method, allowing someone to run some scripting should the validation fail (like resetting data changes one might have made in the beforeSubmit call). You may even want to split things further, with a 'beforeValidation' (occurring prior to validation) separate from a 'beforeSubmit' (occurring after validation, and prior to the form submit). Just a thought. On 10/9/07, Steve Blades [EMAIL PROTECTED] wrote: How about these? - beforeSubmit: called before the validation starts - success: called when the form is valid - submitHandler: replaces the default submit, handler must do an ajaxSubmit or whatever Sounds outstanding, as long as the submitHandler only covered an ajaxSubmit. If it was an all out replacement for the default submit handler then there wouldn't really be a need for the other two options, as all of it could be rolled into someone's new 'submit' function, rolling the $(form).submit() within their own handler. I guess it's just a question of implementation and documentation. Thanks again for the excellent work you do with JQuery. -- Steve Cutter Blades Adobe Certified Professional Advanced Macromedia ColdFusion MX 7 Developer _ http://blog.cutterscrossing.com --- The Past is a Memory The Future a Dream But Today is a Gift That's why they call it The Present -- Steve Cutter Blades Adobe Certified Professional Advanced Macromedia ColdFusion MX 7 Developer _ http://blog.cutterscrossing.com --- The Past is a Memory The Future a Dream But Today is a Gift That's why they call it The Present
[jQuery] Replacing text based on language selection
I think what I need to do will work... I just ran into a road block. One of my co-workers has filled out an XML sheet for me, with REAL japanese values i.e. subAboutLocUSロケーション/subAboutLoc subAboutWWグローバルロケーション/subAboutWW subAboutProductOverview製品概要/subAboutProductOverview subAboutTradeShows展示会/subAboutTradeShows subAboutEduTrainingセミナーamp; トレーニング/subAboutEduTraining subAboutCareerOpps就職案内/subAboutCareerOpps subAboutFinancial財政情報/subAboutFinancial subAboutSMCHistory会社沿革 History/subAboutSMCHistory subAboutOrderTrackオーダートラッキング/subAboutOrderTrack My Jquery worked on a test I did for a German Sheet where I just changed it to read German Locations if the language_sheet_de.xml had been loaded because that was the value in the subAboutLoc tag. But it is NOT working and displaying it for the Japanese style sheet. My web page still says US Locations in that menu spot. The JQuery is: // Load XML document based on language var langSheet = language_sheet_ + country + .xml $.ajax({ type: GET, url: langSheet, dataType: xml, // specify the return type as xml success: function(xmlDoc){ $(xmlDoc).find('subAboutLoc').each(function(){ var item_text = $(this).text(); $('#subAboutLoc').text(item_text); }); } }); And at the top of the XML file is: ?xml version=1.0 encoding=utf-8 ?
[jQuery] Re: Any server status if use script tag for XSS?
Hey Jacky, it can now. :-) from http://docs.jquery.com/Ajax/jQuery.getScript#urlcallback: Before jQuery 1.2, getScript was only able to load scripts from the same domain as the original page. As of 1.2, you can now load JavaScript files from any domain. --Karl _ Karl Swedberg www.englishrules.com www.learningjquery.com On Oct 9, 2007, at 12:54 PM, Jacky wrote: If I remember correctly, getScript can't do cross site. -- Best Regards, Jacky 網絡暴民 http://jacky.seezone.net On 10/9/07, Matt [EMAIL PROTECTED] wrote: Maybe you could attach an onload or onerror event to your html element (script) ? Anyway, jQuery has a home made method to let you do this, cross- browser: See http://docs.jquery.com/Ajax/jQuery.getScript#urlcallback Matt 2007/10/9, Jacky [EMAIL PROTECTED]: Hi, I would like to call crossite script. So I use the script tag technique (create script tag, assign src and append to head) to do so. But unlike xmlhttprequest, I cannot get any response status from it. So I just wonder if there is anyway I can detect if the remote script is not available? I tried to use try-catch, which works on Firefox but not IE. Code: $(document).ready(function(){ try{ var s = document.createElement(script); s.type = text/javascript; s.src = http://thisurldoesnotexist/dsfsdlfjk.js ; document.appendChild(s); } catch(e){ alert(any error); } }); -- Best Regards, Jacky 網絡暴民 http://jacky.seezone.net -- Matthias ETIENNE
[jQuery] Re: Which Validation Verison with jQuery 1.2.1?
Rick Faircloth schrieb: Hi, all… I’m trying to figure out which version of Joern’s validation plug-in works with jQuery 1.2.1 for use with IE 7. Validation version 1.1 works with 1.2.1 on FF2, but not IE 7. Clues, anyone? Until validation 1.2 is released, give the latest revision a try: http://dev.jquery.com/view/trunk/plugins/validate/ -- Jörn
[jQuery] Re: Validation madness
Steve Blades schrieb: Whoops! One last thing. An 'onValidationFailure' type of method, allowing someone to run some scripting should the validation fail (like resetting data changes one might have made in the beforeSubmit call). You may even want to split things further, with a 'beforeValidation' (occurring prior to validation) separate from a 'beforeSubmit' (occurring after validation, and prior to the form submit). Just a thought. Currently my plan is to add the following options: - onsubmit: Boolean, default true - validate on form submit (similar to onkeyup/onblur) - beforeValidation: Callback, called before doing any validation - beforeSubmit: Callback, called before submitting the form (default submit or calling submitHandler, if specified) I'm not sure yet if beforeValidation should be called only for the entire form or also when validating a single element. Opinions? -- Jörn
[jQuery] Re: Session management in an Ajax app
I noticed one error in the $.expire function I posted in the previous message. It doesn't pass through the return value from the original function. This line: fn.apply( this, arguments ); should be: return fn.apply( this, arguments ); Worse, this solution doesn't take into account multiple browser windows. If you open a site in two windows, ajax calls in either window would extend the server session timeout, but this code running in one window wouldn't know when another window had done that. A comment by StephenD on Raymond's post describes a way of fixing this using cookies. It's still an interesting bit of code (of course I would say that!) - the $.expire function shows how easy it is to augment an existing JavaScript function with new behavior.
[jQuery] Re: Validation madness
- onsubmit: Boolean, default true - validate on form submit (similar to onkeyup/onblur) - beforeValidation: Callback, called before doing any validation - beforeSubmit: Callback, called before submitting the form (default submit or calling submitHandler, if specified) I'm not sure yet if beforeValidation should be called only for the entire form or also when validating a single element. Opinions? That all sounds good, and just want to add my vote for onValidationFailure to be run if the validation fails on the submit action (in other words form() == false). Or, is this covered in your new callbacks and I'm not quite following? -- Josh
[jQuery] Re: Which Validation Verison with jQuery 1.2.1?
Hi, Jorn... I tried the latest revision below, but it's performing the same way... no validation until the form is submitted, even though validation is set to be triggered on keyup. After the form is submitted, it works perfectly. Rick -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Jörn Zaefferer Sent: Tuesday, October 09, 2007 2:22 PM To: jquery-en@googlegroups.com Subject: [jQuery] Re: Which Validation Verison with jQuery 1.2.1? Rick Faircloth schrieb: Hi, all Im trying to figure out which version of Joerns validation plug-in works with jQuery 1.2.1 for use with IE 7. Validation version 1.1 works with 1.2.1 on FF2, but not IE 7. Clues, anyone? Until validation 1.2 is released, give the latest revision a try: http://dev.jquery.com/view/trunk/plugins/validate/ -- Jörn
[jQuery] Re: Replacing text based on language selection
Update: I figured out it is actually working , but only in FireFox 2+ ANything I can do differently to adjust it to work in IE7 and IE6? We can always fall back and demo in FireFox, but I would rather learn of the solution. THanks guys. On Oct 9, 1:53 pm, Danjojo [EMAIL PROTECTED] wrote: I think what I need to do will work... I just ran into a road block. One of my co-workers has filled out an XML sheet for me, with REAL japanese values i.e. subAboutLocUSロケーション/subAboutLoc subAboutWWグローバルロケーション/subAboutWW subAboutProductOverview製品概要/subAboutProductOverview subAboutTradeShows展示会/subAboutTradeShows subAboutEduTrainingセミナーamp; トレーニング/subAboutEduTraining subAboutCareerOpps就職案内/subAboutCareerOpps subAboutFinancial財政情報/subAboutFinancial subAboutSMCHistory会社沿革 History/subAboutSMCHistory subAboutOrderTrackオーダートラッキング/subAboutOrderTrack My Jquery worked on a test I did for a German Sheet where I just changed it to read German Locations if the language_sheet_de.xml had been loaded because that was the value in the subAboutLoc tag. But it is NOT working and displaying it for the Japanese style sheet. My web page still says US Locations in that menu spot. The JQuery is: // Load XML document based on language var langSheet = language_sheet_ + country + .xml $.ajax({ type: GET, url: langSheet, dataType: xml, // specify the return type as xml success: function(xmlDoc){ $(xmlDoc).find('subAboutLoc').each(function(){ var item_text = $(this).text(); $('#subAboutLoc').text(item_text); }); } }); And at the top of the XML file is: ?xml version=1.0 encoding=utf-8 ?
[jQuery] Re: Which Validation Verison with jQuery 1.2.1?
Rick Faircloth schrieb: Hi, Jorn... I tried the latest revision below, but it's performing the same way... no validation until the form is submitted, even though validation is set to be triggered on keyup. After the form is submitted, it works perfectly. Thats supposed to be a feature. The assumption: Its very annoying if the validation starts whining about invalid fields before the user even had the chance to enter a correct value. As long as a field isn't marked as invalid (eg. before first submit or blur with a non-empty invalid field), no onkeyup validation happens. I'll add an option to specify that keyup must always run. -- Jörn
[jQuery] Re: Session management in an Ajax app
Michael Geary wrote on 10/9/2007 1:27 PM: It's still an interesting bit of code (of course I would say that!) - the $.expire function shows how easy it is to augment an existing JavaScript function with new behavior. It *is* interesting, thanks for sharing the code. We display a countdown timer on the bottom of the page so the user is aware of how much time they have until they're booted out, and if the user needs more time, they click on the timer to reset it (which pings the server to keep their server-side session active). Currently, we manually reset the timer for the user when they do certain actions, but having the timer auto-reset when performing an ajax call would be handy. - Bil
[jQuery] Re: Which Validation Verison with jQuery 1.2.1?
Thats supposed to be a feature. The assumption: Its very annoying if the validation starts whining about invalid fields before the user even had the chance to enter a correct value. As long as a field isn't marked as invalid (eg. before first submit or blur with a non-empty invalid field), no onkeyup validation happens. Given this information, Rick, it sounds like you want onblur rather than onkeyup. This will wait until the user tabs or clicks to the next field before checking if the field is valid or not. -- Josh
[jQuery] Re: Which Validation Verison with jQuery 1.2.1?
I said earlier to Michael, that the way it's working now is not too bad... A user has a chance to complete the form and submit before getting any messages. At that point, on keyup validation kicks in and basically guides the user through changing the errant input data. So, if that's the way it's supposed to work, no problem here. I was just afraid that if it was malfunctioning, that it might pose problems in production. I just wanted to make sure its working correctly. Thanks for the feedback and for a very handy plug-in! Rick -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Jörn Zaefferer Sent: Tuesday, October 09, 2007 2:51 PM To: jquery-en@googlegroups.com Subject: [jQuery] Re: Which Validation Verison with jQuery 1.2.1? Rick Faircloth schrieb: Hi, Jorn... I tried the latest revision below, but it's performing the same way... no validation until the form is submitted, even though validation is set to be triggered on keyup. After the form is submitted, it works perfectly. Thats supposed to be a feature. The assumption: Its very annoying if the validation starts whining about invalid fields before the user even had the chance to enter a correct value. As long as a field isn't marked as invalid (eg. before first submit or blur with a non-empty invalid field), no onkeyup validation happens. I'll add an option to specify that keyup must always run. -- Jörn
[jQuery] Re: Validation madness
Josh Nathanson schrieb: - onsubmit: Boolean, default true - validate on form submit (similar to onkeyup/onblur) - beforeValidation: Callback, called before doing any validation - beforeSubmit: Callback, called before submitting the form (default submit or calling submitHandler, if specified) I'm not sure yet if beforeValidation should be called only for the entire form or also when validating a single element. Opinions? That all sounds good, and just want to add my vote for onValidationFailure to be run if the validation fails on the submit action (in other words form() == false). Or, is this covered in your new callbacks and I'm not quite following? Nope, that wasn't included. I see the point though. Does it make more sense to run that before displaying error messages, or afterwards? How to name it? beforeErrorDisplay? afterValidation? beforeFailure? I'd like to stick with jQuery's naming conventions: $.ajax provides beforeSend (would be beforeValidation), success (beforeSubmit?), error (onValidationFailure?) I may also need to rename the option errorPlacement. It should be errorHandler: Like submitHandler, if specified, it replaces built-in funcitonality. In contrast to the beforeWhatever callbacks, which are just called but have no effect on the validation lifecycle. Does that make sense? What would you prefer? beforeValidation, success and error? Or beforeValidation, beforeSubmit, afterError? Other suggestions? -- Jörn
[jQuery] Re: Validation madness
Nope, that wasn't included. I see the point though. Does it make more sense to run that before displaying error messages, or afterwards? How to name it? beforeErrorDisplay? afterValidation? beforeFailure? Either before or after would be fine I think. The reason is that you might want to do something additional to let the user know that some errors occurred. Sometimes an error label and focusing the field isn't enough to grab the user's attention. In my case, I trigger an alert('One or more errors occurred, please adjust the indicated fields'), which forces the user to acknowledge that an error occurred. As far as naming...maybe onError or something like that? I also like renaming errorPlacement to errorHandler, since you can do much more than just the placement there. -- Josh
[jQuery] Re: JSS - New Plug-in
On Oct 9, 12:56 am, R. Rajesh Jeba Anbiah [EMAIL PROTECTED] wrote: On Oct 8, 3:42 pm, Andy Kent [EMAIL PROTECTED] wrote: snip Yep, absolutely. If you have any ideas on how we could test a browsers support for a selector without maintaining a hard coded list then I would love to hear them. snip $(document).ready(function () { $('body').append( 'div id=r_csstest \ style type=text/css \ div#r_css{ \ width: 0px; \} \ [and more like that] I hope you're aware of a couple of issues with this method: 1) The style element is not a legal descendant of body. Better to append it to the head. 2) The ECMAScript standard doesn't define the \ as a string continuation character. Better to simply concatenate string literals.
[jQuery] Re: Replacing text based on language selection
Do you have an example of the problem you are getting? Do you get any javascript errors? Have you ensured characters are correctly encoded? On Oct 9, 7:44 pm, Danjojo [EMAIL PROTECTED] wrote: Update: I figured out it is actually working , but only in FireFox 2+ ANything I can do differently to adjust it to work in IE7 and IE6? We can always fall back and demo in FireFox, but I would rather learn of the solution. THanks guys. On Oct 9, 1:53 pm, Danjojo [EMAIL PROTECTED] wrote: I think what I need to do will work... I just ran into a road block. One of my co-workers has filled out an XML sheet for me, with REAL japanese values i.e. subAboutLocUSロケーション/subAboutLoc subAboutWWグローバルロケーション/subAboutWW subAboutProductOverview製品概要/subAboutProductOverview subAboutTradeShows展示会/subAboutTradeShows subAboutEduTrainingセミナーamp; トレーニング/subAboutEduTraining subAboutCareerOpps就職案内/subAboutCareerOpps subAboutFinancial財政情報/subAboutFinancial subAboutSMCHistory会社沿革 History/subAboutSMCHistory subAboutOrderTrackオーダートラッキング/subAboutOrderTrack My Jquery worked on a test I did for a German Sheet where I just changed it to read German Locations if the language_sheet_de.xml had been loaded because that was the value in the subAboutLoc tag. But it is NOT working and displaying it for the Japanese style sheet. My web page still says US Locations in that menu spot. The JQuery is: // Load XML document based on language var langSheet = language_sheet_ + country + .xml $.ajax({ type: GET, url: langSheet, dataType: xml, // specify the return type as xml success: function(xmlDoc){ $(xmlDoc).find('subAboutLoc').each(function(){ var item_text = $(this).text(); $('#subAboutLoc').text(item_text); }); } }); And at the top of the XML file is: ?xml version=1.0 encoding=utf-8 ?
[jQuery] Re: Replacing text based on language selection
Well right now my only problem is that the above Jquery code example in my original post, does not work in Internet Explorer 7. It does re-write the entire page in Japanese (good enough for my demo, later I will use a database) in FireFox browser. Any ideas how to update the Jquery code to work in IE? // Load XML document based on language var langSheet = language_sheet_ + country + .xml $.ajax({ type: GET, url: langSheet, dataType: xml, // specify the return type as xml success: function(xmlDoc){ $(xmlDoc).find('subAboutLoc').each(function() { var item_text = $(this).text(); $('#subAboutLoc').text(item_text); }); } });
[jQuery] good but could be better blur() form submit
Hi guys/gals, Here is a snip of code I was testing for a part of my application. It is very neat but doesn't meld well with my other session stuff. Basically if you remove focus from the text box using blur(), it submits the form and sets the Coldfusion variable. Take a look and see if this could be improved or altered to work better... script src=js/jquery.js type=text/javascript/script script $(document).ready(function() { $('.binky').blur(function() { $(form).submit(); } ); } ); /script cfif isdefined(form.asdf) and form.asdf neq cfset session.comments = form.asdf cfoutput#session.comments#/cfoutput /cfif cfform action= method=post name=asdf cftextarea class=binky name=asdf cols= rows=/cftextarea /cfform
[jQuery] Re: Which Validation Verison with jQuery 1.2.1?
Could be, Josh... I've gone back-and-forth between onblur and onkeyup. The only consideration is that with onkeyup the user's attention is still on that field, whereas with onblur, the user's attention has gone on to the next field even before the tab takes place. I think it's so close it probably really doesn't matter. Different users would prefer different interaction anyway. Thanks for the suggestion and perspective! Rick -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Josh Nathanson Sent: Tuesday, October 09, 2007 2:55 PM To: jquery-en@googlegroups.com Subject: [jQuery] Re: Which Validation Verison with jQuery 1.2.1? Thats supposed to be a feature. The assumption: Its very annoying if the validation starts whining about invalid fields before the user even had the chance to enter a correct value. As long as a field isn't marked as invalid (eg. before first submit or blur with a non-empty invalid field), no onkeyup validation happens. Given this information, Rick, it sounds like you want onblur rather than onkeyup. This will wait until the user tabs or clicks to the next field before checking if the field is valid or not. -- Josh
[jQuery] Re: Any server status if use script tag for XSS?
Thanks. After look into the getScript code, I tried to play around with the readyState of the script elements. script.onload = script.onreadystatechange = function(){ try{ document.body.innerHTML += p + this.readyState + /p; if (!this.readyState || this.readyState == loaded || this.readyState == complete){ document.body.innerHTML += pSuccess/p; head.removeChild( script ); } }catch(e){ alert(any error + e); } }; 1. http://urldoesnotexist.com/fdil.js This is a request where the browser should not be able to resolve the server. Firefox prints nothing, but IE do print all 'loading', 'loaded' and 'success'. 2. http://www.google.com/doesnothavethisjs.js Just a simple error page returned by google.com Firefox prints nothing, but IE prints 'loading', 'loaded' and 'success' 3. http://someserver/soemjs.js This request would return an HTML showing cannot find file on server like (2). It is on our own application server. Firefox prints 'undefined', 'success' and then have script error about HTML tag error (I guess because the return page is not a well-formed html). IE prints 'loading', 'loaded' and 'success' with script error saying 'syntax error'. Seems that in IE, I cannot quite distinguish what is going on. On 10/10/07, Karl Swedberg [EMAIL PROTECTED] wrote: Hey Jacky, it can now. :-) from http://docs.jquery.com/Ajax/jQuery.getScript#urlcallback: Before jQuery 1.2, getScript was only able to load scripts from the same domain as the original page. As of 1.2, you can now load JavaScript files from any domain. --Karl _ Karl Swedberg www.englishrules.com www.learningjquery.com On Oct 9, 2007, at 12:54 PM, Jacky wrote: If I remember correctly, getScript can't do cross site. -- Best Regards, Jacky 網絡暴民 http://jacky.seezone.net On 10/9/07, Matt [EMAIL PROTECTED] wrote: Maybe you could attach an onload or onerror event to your html element (script) ? Anyway, jQuery has a home made method to let you do this, cross-browser: See http://docs.jquery.com/Ajax/jQuery.getScript#urlcallback Matt 2007/10/9, Jacky [EMAIL PROTECTED]: Hi, I would like to call crossite script. So I use the script tag technique (create script tag, assign src and append to head) to do so. But unlike xmlhttprequest, I cannot get any response status from it. So I just wonder if there is anyway I can detect if the remote script is not available? I tried to use try-catch, which works on Firefox but not IE. Code: $(document).ready(function(){ try{ var s = document.createElement(script); s.type = text/javascript; s.src = http://thisurldoesnotexist/dsfsdlfjk.js ; document.appendChild(s); } catch(e){ alert(any error); } }); -- Best Regards, Jacky 網絡暴民 http://jacky.seezone.net -- Matthias ETIENNE -- Best Regards, Jacky 網絡暴民 http://jacky.seezone.net
[jQuery] Re: animating multiple items at the same time
Ok. But what code do I use to animate a group of items at the same time? Let's say I have 5 DIVs with the same class called 'box'. How do I animate all of these items instantaneously? Thanks On Oct 9, 10:28 am, Andy Matthews [EMAIL PROTECTED] wrote: Simplest way might be to assign a class to each of them. This way you can reference them individually by ID or as part of a group by classname. Or put them all in a parent container and reference them with child selectors: $('#container div') andy -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of petrozza Sent: Tuesday, October 09, 2007 9:17 AM To: jQuery (English) Subject: [jQuery] animating multiple items at the same time Hi! I am relatively new to jQuery and recently ran into the following problem. Let's say I have a few DIVs of the same dimensions on top of each other. I need to expand/shrink them at the same time. I tried running a loop through these DIVs and doing something like: for(i=0;i5;i++){ $('#divid'+i).animate({width: 400}, 'slow'); } this works but the animations don't occur at exactly the same time for each element (loop delay obviously). Is there a way to make all animations start at the same time? Thanks
[jQuery] Re: animating multiple items at the same time
I tried that but there's still a slight delay between elements On Oct 9, 10:28 am, Andy Matthews [EMAIL PROTECTED] wrote: Simplest way might be to assign a class to each of them. This way you can reference them individually by ID or as part of a group by classname. Or put them all in a parent container and reference them with child selectors: $('#container div') andy -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of petrozza Sent: Tuesday, October 09, 2007 9:17 AM To: jQuery (English) Subject: [jQuery] animating multiple items at the same time Hi! I am relatively new to jQuery and recently ran into the following problem. Let's say I have a few DIVs of the same dimensions on top of each other. I need to expand/shrink them at the same time. I tried running a loop through these DIVs and doing something like: for(i=0;i5;i++){ $('#divid'+i).animate({width: 400}, 'slow'); } this works but the animations don't occur at exactly the same time for each element (loop delay obviously). Is there a way to make all animations start at the same time? Thanks
[jQuery] animating multiple items at the same time
Hi! I am relatively new to jQuery and recently ran into the following problem. Let's say I have a few DIVs of the same dimensions on top of each other. I need to expand/shrink them at the same time. I tried running a loop through these DIVs and doing something like: for(i=0;i5;i++){ $('#divid'+i).animate({width: 400}, 'slow'); } this works but the animations don't occur at exactly the same time for each element (loop delay obviously). Is there a way to make all animations start at the same time? Thanks
[jQuery] Re: animating multiple items at the same time
Ok, but how do I animate multiple all items with the same class instantaneously? Thanks On Oct 9, 10:28 am, Andy Matthews [EMAIL PROTECTED] wrote: Simplest way might be to assign a class to each of them. This way you can reference them individually by ID or as part of a group by classname. Or put them all in a parent container and reference them with child selectors: $('#container div') andy -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of petrozza Sent: Tuesday, October 09, 2007 9:17 AM To: jQuery (English) Subject: [jQuery] animating multiple items at the same time Hi! I am relatively new to jQuery and recently ran into the following problem. Let's say I have a few DIVs of the same dimensions on top of each other. I need to expand/shrink them at the same time. I tried running a loop through these DIVs and doing something like: for(i=0;i5;i++){ $('#divid'+i).animate({width: 400}, 'slow'); } this works but the animations don't occur at exactly the same time for each element (loop delay obviously). Is there a way to make all animations start at the same time? Thanks
[jQuery] scrolling the browser
hi, I appended a html page to a DIV near the end of page: $(msg).appendTo($('#new_comments').empty()); however the user has to scroll down to view, is there a way to scroll the browser to the last in jquery/javascript? Thanks. A.C.
[jQuery] Re: Keeping the calendar plug in open?
jQuery calendar has inline display - click the inline tab on the demo page: http://marcgrabanski.com/code/jquery-calendar All you have to do is simply attach the calendar to a span or div instead of an input. Vualah! On Oct 7, 3:31 pm, iain duncan [EMAIL PROTECTED] wrote: On Sun, 2007-07-10 at 19:32 +0100, Kelvin Luck wrote: Hi Iain, I'm not sure which calendar plugin you are talking about but your email prompted me to add the functionality you describe to my datePicker plugin (something I've been meaning to do for a very long time and luckily had a spare bit of time today for). You can find the examples of this new functionality here: http://kelvinluck.com/assets/jquery/datePicker/v2/demo/inlineDatePick... http://kelvinluck.com/assets/jquery/datePicker/v2/demo/inlineDatePick... And you will find documentation, downloads and many examples of the plugin's homepage: http://kelvinluck.com/assets/jquery/datePicker/v2/demo/ Hope that helps, Kelvin :) Thanks Kelvin. I was refering to Marcs calendar, but it looks like your date picker may be a better alternative for this use case. My perception at a glance is that the date picker is a bit more light weight, would you say that is true? Iain
[jQuery] scrolling the browser
hi, is there a way to scroll to the bottom of the page? a.c.
[jQuery] How to get the value of radio button
For example I have a group of radio buttons and would like to get value of the selected radio button. div id='Details'input type=radio value=Buttername=Food input type=radio value=Breadname=Food /div IHow to get the value using jQuery? Thanks for reply L.
[jQuery] jQuery Calendar v2.7 and custom date ranges
Hi All, Does anyone know how to get the date range to work for the calendar? I tried adding this code, but maybe I put it in the wrong place or something. Please help. script $(document).ready(function(){ $('.calendarRange').calendar({fieldSettings: customRange, autoPopUp: 'focus', dateFormat: 'MDY/'}); function customRange(input) { return {minDate: (input.id == 'dTo' ? getDate($('#dFrom').val()) : null), maxDate: (input.id == 'dFrom' ? getDate($('#dTo').val()) : null)}; } }); /script
[jQuery] Re: Keeping the calendar plug in open?
jQuery calendar also has inline display. Click the inline tab on the demo page to view it: http://marcgrabanski.com/code/jquery-calendar/ All you have to do is simply attach the calendar to a span or div instead of an input. Vualah! And as far as which calendar to choose - be happy you have a choice, both scripts are free! Use the one that suites your needs the best! On Oct 7, 3:31 pm, iain duncan [EMAIL PROTECTED] wrote: On Sun, 2007-07-10 at 19:32 +0100, Kelvin Luck wrote: Hi Iain, I'm not sure which calendar plugin you are talking about but your email prompted me to add the functionality you describe to my datePicker plugin (something I've been meaning to do for a very long time and luckily had a spare bit of time today for). You can find the examples of this new functionality here: http://kelvinluck.com/assets/jquery/datePicker/v2/demo/inlineDatePick... http://kelvinluck.com/assets/jquery/datePicker/v2/demo/inlineDatePick... And you will find documentation, downloads and many examples of the plugin's homepage: http://kelvinluck.com/assets/jquery/datePicker/v2/demo/ Hope that helps, Kelvin :) Thanks Kelvin. I was refering to Marcs calendar, but it looks like your date picker may be a better alternative for this use case. My perception at a glance is that the date picker is a bit more light weight, would you say that is true? Iain
[jQuery] Overriding jQuery Function
I would like to be able to 'override' a standard jQuery function to provide it with customised features and/or functionality whilst still being able to call the base/original function from within the new function to do the majority of the work. Is there a recommended approach to achieving this type of extension? [PS I originally posted this question on the Plugin Group - apologies]
[jQuery] Re: Superfish embed flash object
For your embeded flash object set your wmode to transparent. On Oct 9, 9:50 am, Mark [EMAIL PROTECTED] wrote: Hi Joel, I am using superfish on a page with an embeded flash object, the menu displays behind the flash. Do you know a way to make it show in front of the flash object? See an example of what I mean here.http://www.newportmirage.com.au/files/VirtualTour/low/virtual-tour-lo... I have upgraded to jquery 1.2.1 and superfish 1.3.1, however my style sheet is a modified version of an earlier vertical example (has it been modified for 1.3.1?). Thanks Mark
[jQuery] Re: Superfish embed flash object
I don't believe this has anything to do with Superfish or jQuery. Try adding the following code to your HTML where your Flash movie is embedded: param name=wmode value=transparent / and add the following to the embed src=... wmode=transparent so this will be your full code for embedding your Flash movie... object classid=clsid:d27cdb6e-ae6d-11cf-96b8-44455354 codebase=http://download.macromedia.com/pub/shockwave/cabs/flash/ swflash.cab#version=9,0,0,0 width=500 height=420 id=index align=middle param name=allowScriptAccess value=sameDomain / param name=allowFullScreen value=false / param name=movie value=index_low.swf / param name=quality value=high / param name=bgcolor value=#ff / param name=wmode value=transparent / embed src=index_low.swf width=500 height=420 autostart=false quality=high bgcolor=#ff wmode=transparent name=index align=middle allowScriptAccess=sameDomain allowFullScreen=false type=application/x-shockwave-flash pluginspage=http:// www.macromedia.com/go/getflashplayer /object On Oct 9, 6:50 am, Mark [EMAIL PROTECTED] wrote: Hi Joel, I am using superfish on a page with an embeded flash object, the menu displays behind the flash. Do you know a way to make it show in front of the flash object? See an example of what I mean here.http://www.newportmirage.com.au/files/VirtualTour/low/virtual-tour-lo... I have upgraded to jquery 1.2.1 and superfish 1.3.1, however my style sheet is a modified version of an earlier vertical example (has it been modified for 1.3.1?). Thanks Mark
[jQuery] What is the JQuery's equipvalent of this?
Hi, I have following javascript to jump to an anchor point: window.location.hash=mycomments; what is the JQuery's equivalent? the above code works in all the browser, also Safari except safari will be always in a 'loading' mode, any idea? Thanks. A.C.
[jQuery] Superfish, jQuery and flashing menu...
http://www.tolerase.com/test2.php The navigation for the site above works fine in Firefox. In IE however, the menu rollover blinks everytime a submenu list element is rolled over. What can I do to fix this? Also, in Safari the full width of the submenu does not display until the user rolls over the submenu.
[jQuery] Re: animating multiple items at the same time
I did that but there's still a noticeable delay between animations On Oct 9, 10:28 am, Andy Matthews [EMAIL PROTECTED] wrote: Simplest way might be to assign a class to each of them. This way you can reference them individually by ID or as part of a group by classname. Or put them all in a parent container and reference them with child selectors: $('#container div') andy -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of petrozza Sent: Tuesday, October 09, 2007 9:17 AM To: jQuery (English) Subject: [jQuery] animating multiple items at the same time Hi! I am relatively new to jQuery and recently ran into the following problem. Let's say I have a few DIVs of the same dimensions on top of each other. I need to expand/shrink them at the same time. I tried running a loop through these DIVs and doing something like: for(i=0;i5;i++){ $('#divid'+i).animate({width: 400}, 'slow'); } this works but the animations don't occur at exactly the same time for each element (loop delay obviously). Is there a way to make all animations start at the same time? Thanks