[jQuery] Re: Can a dialog not show an alert message?
The code I have: [code] // Show edit planitem dialog function showEditPlanitemDialog(planid, title, timestamp){ $(#edit_dialog).dialog({ width: 155, buttons: { Ok: function() { // Save $.ajax( { type: POST, url: scripts/save.php, data: test=test, succes: function(msg){ alert(msg); } }); //console.dir(); }, Close: function() { $(this).dialog(destroy);} // Close dialog } }); } [/code] You see I want on the succes an alert, I dont get it in an alert box, but I see it in the console.dir from Firebug.
[jQuery] Re: IE8 BlockUI incompatible
Mike, your page fails for me with not implemented Nicht implementiert jquery.blockUI.js?v2.16, line 227 character 17 on Win XP Pro w/ SP3 and IE8 Regards, Frank On 20 Mrz., 22:10, Mike Alsup mal...@gmail.com wrote: This eliminates the exception, but the placement of the floating content is different, and it doesn't appear to adjust on window resize. Thanks for the update, and let me know if you need assistance in testing/debugging the new version. How about a test page. One that is as simple as possible. Thanks. I can't make it fail in any mode. Does this page work for you? http://jquery.malsup.com/block/test.html
[jQuery] Re: highlight errors
Are you using your own validation code or validation plugin ? Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Mon, Mar 23, 2009 at 10:30 AM, anush anushshe...@gmail.com wrote: Is it possible to highlight all the text boxes in a from even if there is an error in just one of the boxes whbile validating ?
[jQuery] How to prevent loading jquery twice
Hi all, I have different independent modules using jquery and need to avoid its double loading. So, instead of loading jquery, I am loading the code: if (typeof jQuery != 'undefined') { document.write('script type=text/javascript src=/templates/ yoo_evolution/lib/js/jquery-1.3.2.min.js/script'); } Also, I have added a line var $j = jQuery.noConflict(); as a last line of jquery library file. The problem is that though it writes the code on document write, it does not seem that jquery is loaded at all, because I am getting an error jQuery not defined. What am i doing wrong here? is there a more elegant way to load a library dynamically? Thanks
[jQuery] Re: How to prevent loading jquery twice
why would you be loading the library for each script? Andy789 wrote: Hi all, I have different independent modules using jquery and need to avoid its double loading. So, instead of loading jquery, I am loading the code: if (typeof jQuery != 'undefined') { document.write('script type=text/javascript src=/templates/ yoo_evolution/lib/js/jquery-1.3.2.min.js/script'); } Also, I have added a line var $j = jQuery.noConflict(); as a last line of jquery library file. The problem is that though it writes the code on document write, it does not seem that jquery is loaded at all, because I am getting an error jQuery not defined. What am i doing wrong here? is there a more elegant way to load a library dynamically? Thanks
[jQuery] Re: jquery and netbeans 6.5
I don't use it as an IDE, but I remember updating my jQuery version. You need to create a new zip file similar to the one found here: C:\Program Files\NetBeans 6.5\webcommon1\modules\ext\javascript Copy paste jquery-1.2.6.zip to something lik jquery-1.3.2.zip and don't forget to change the properties file in the archive. Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Sun, Mar 22, 2009 at 8:49 AM, gabriel balint gabriel.bal...@gmail.com wrote: Is anybody using netBeans as IDE? It looks promising but i can't get it to work properly. I get some of the functions but not all of them. (http://www.netbeans.org/download/flash/js/javascript_demo.html)
[jQuery] Re: Keeping jquery codes up to date - best practise?
The risk with linking to a latest build is that something will break when the linked-to version of jquery changes. Imagine for instance that you made heavy use of @selectors, and were running live with these when the change was made from 1.2 to 1.3. Your site would break. Such eventualities as this are not impossible in the future. I'd always recommend linking to a specific version of the code and testing your site before upgrading the live version of jQuery, that way you eliminate the possibility of bugs creeping in. Your site has a dependency on a specific version of jQuery to function, and you need to ensure that it still works when upgraded. S On Mar 22, 3:37 pm, mkmanning michaell...@gmail.com wrote: You can link to the latest major number, for examplehttp://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js gets you 1.3.2; it will automatically update to the next 1.#.# version when available. http://ajax.googleapis.com/ajax/libs/jquery/1.2/jquery.min.js Gets you 1.2.6 (the latest version with the minor 2) http://ajax.googleapis.com/ajax/libs/jquery/1.2.3/jquery.min.js gets you 1.2.3 explicitly The one thing to be careful about is if you have code that is version dependent, (e.g. jQuery UI), it may fall out of sync with Google's update. On Mar 22, 3:54 am, Microbe geeky@gmail.com wrote: Thanks for that, but if you use it, aren't you linking to a specific version number? Their example is path:http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js; So what happens if right though my code I call that file and then 1.3.3 comes out?
[jQuery] IE6 + SSL mixed content error
When attempting to use jquery form plugin to handle an image upload over SSL, IE 6 presents the dreaded mixed content error. This is because jquery form adds an iFrame with no src. An easy, cross- browser fix can be attained by changing the line that adds the iFrame to include this src: src='javascript:false;' I found this fix while researching the same problem in Thickbox: http://disjointthoughts.com/2007/04/25/thickbox-https-ie6-and-os-x-firefox-compatibility-issues/comment-page-1/#comment-8006 I thought perhaps it'd be an easy update to the jquery Form source. Thanks for all your hard work. :patrick
[jQuery] Beginner Question
Hello, Am using the jQuery treeview plugin Would like the folders in the tree to open/close only when the user clicks on the folder or the [+] sign. Right now it opens/closes also when one clicks on the text. (This messes up my application since I have a checkbox on each folder. After a person opens the folder, when he clicks the checkbox, it closes the folder!) thnx a million
[jQuery] how to use drag and resize
$(ui.draggable).clone().appendTo($(this)).draggable().resizable() resizable is work draggable didn't work
[jQuery] Cannot call a function within the callback part of $.get in IE7
Hi, I make Ajax ($.get) calls and in the calback part I call a function defined elsewhere. In FireFox this is no problem. When I checked in IE however I kept getting an error 'object expected'. It took a while to figure out that if I remove the _call_ to the function with the actual function body (the code defined in the function handler) the problem disappeared and IE does not complain.. So instead of this: $(document).ready(function(){ $('#login').click(function(){ $.get( /?event=cms.showlogin, function(res){ removeLoginWindow(); addStyleSheet('/cms/css/cms.css') $(document.body).append(res); $('#closeButton').click(function(){removeLoginWindow()}) $('#closeButton').css('cursor','pointer') $('.loginWindow').draggable() $(#loginWindow input:text[name='username'])[0].focus() }, html ) showLoginWindow() }); }) I need top switch the calls to removeLoginWindow() and addStyleSheet('/ cms/css/cms.css') with the actual code of these functions. Is there no workaround for this or am I doing somehting wrong? jquery-1.3.2.min.js IE 7.0 FF 3.07 Win XP sp2 Thanks, Marc
[jQuery] Re: ui tabs how to link to a new page
I need the same. I have tabs which switch on mouseover and when clicked I need this work as a common link. Unfortunately, tabs plugin does not generate click event. Therefore I wrote small code which get an URL from rel attr of the ancors and points the browser to the new location. div id=tabs ul lia href=#tabs-1 rel=http://www.jquery.com;Item 1/a/li lia href=#tabs-2 rel=http://plugins.jquery.com;Item 2/a/ li lia href=#tabs-3 rel=http://ui.jquery.com;Item 3/a/li /ul div id=tabs-1 img src=img1.jpg /div div id=tabs-2 img src=img2.jpg /div div id=tabs-3 img src=img3.jpg /div /div script type=text/javascript $(document).ready(function () { $('#tabs').tabs({ event: 'mouseover' }); $('#tabs ul li a').click(function () { location.href = this.rel; }); }); /script Hope this help. On 22 мар, 20:16, David omertacod...@gmail.com wrote: Hi all, Is it possible to if you click a tab i get to a new page ? i've tried the option to load a page into the tab content but that's not what i'm looking for. basically if i click on tab 1 it goes to page1.php, tab 2 to page2.php If someone could help me out ... thanks
[jQuery] minification
How the jquery code was minified? I mean it's about 56 kB, while yui compressor gives a 72 kB result. As I saw it's not obfuscated, only minified, so I'm really intrested in the way you did this.
[jQuery] JS Toolbox - Sortable Table
I was looking for a simple way to have a sortable table and found this at jstoolbox - http://www.javascripttoolbox.com/lib/table/documentation.php But in all honesty I seem to not be able to get it to work. Does anyone have any clue what I am doing wrong? http://43photo.com/store/files.php
[jQuery] jquery_ajax + servlet problem
It takes me almost half a day , but I haven't solve it ,I don't know why . I would be much appreciate for your help... $(document).ready(function(){ alert(can show); $(#button).click(function(){ alert(when click button , can show ); $.post(AddComment,null,function(data){// AddComment is a servlet name alert(here can't show); },json); }); }); servlet ,root ,servlets/AddComment, public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { System.out.println(here can't show,that is ,the method $.post does not work); } servlet config in web.xml: servlet servlet-nameAddComment/servlet-name servlet-classservlets.AddComment/servlet-class load-on-startup1/load-on-startup /servlet servlet-mapping servlet-nameAddComment/servlet-name url-pattern/servlets/AddComment/url-pattern /servlet-mapping
[jQuery] drag drop resize doesn't work in jquery 1.3.2
this is my code it worked in jquery 1.2.6 but doesn't work in jquery 1.3.2 !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http:// www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd html xmlns=http://www.w3.org/1999/xhtml; head meta http-equiv=Content-Type content=text/html; charset=utf-8 / script src=js/jquery-1.3.2.js/script script src=js/ui.core.js/script script src=js/ui.draggable.js/script script src=js/ui.droppable.js/script script src=js/ui.resizable.js/script script $(document).ready(function(){ var $container = $('#container'); $(#ob1).resizable().parent().draggable({containment: '#container'}); $(.ob2).draggable({helper:'clone'}); $container.droppable({ accept: '.ob2', drop: function(ev, ui) { ui.draggable.clone().fadeOut(fast, function() { $(this).removeClass(); $(this).resizable().parent().draggable({containment: '#container' }); $(this).fadeIn(fast); }).appendTo($(this)); } }); }); /script style type=text/css !-- #container { width: 95%; height:400px; border:2px solid #ccc; padding: 10px; } #list { width: 95%; height:auto; border:2px solid #ccc; padding: 10px; position: fixed; } -- /style /head body div id=container img id=ob1 src=images/a.jpeg width=200 height=200 /div div id=list img src=images/1.png width=100 height=100 class=ob2 / img src=images/2.png width=100 height=100 class=ob2 / img src=images/3.png width=100 height=100 class=ob2 / img src=images/4.png width=100 height=100 class=ob2 / /div /body /html another question when i using jquery 1.2.6 chrome and safari didn't work
[jQuery] fadeOut Callback woes
Good morning all, Apologies again if this is a really basic question, but I've searched though the jQuery Docs and am struggling to find a solution. function lovelyFunction() { $(#lovelyDiv).fadeOut(5000,function(){ alert(Why now?); }); }; Everything I'm reading in the jQuery Docs, to my understanding, tells me that the alert Why now should appear after my lovelyDiv has compleatly faded out. But, for a reason I'm struggling with, the alert Why now? appears before my lovelyDiv has even started fading.
[jQuery] Re: IE8 BlockUI incompatible
Mike, your page fails for me with not implemented Nicht implementiert jquery.blockUI.js?v2.16, line 227 character 17 on Win XP Pro w/ SP3 and IE8 Regards, Frank Thanks, Frank. What browser mode and compatibility mode did it fail in?
[jQuery] Re: Beginner Question
Which treeView plugin are you using? http://jquery.bassistance.de/treeview/demo http://be.twixt.us/jquery/treeView.php The second one collapses and expands when you click on [-]/[+] links only... probably what you want... Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Mon, Mar 23, 2009 at 2:47 AM, rsebag rse...@yahoo.com wrote: Hello, Am using the jQuery treeview plugin Would like the folders in the tree to open/close only when the user clicks on the folder or the [+] sign. Right now it opens/closes also when one clicks on the text. (This messes up my application since I have a checkbox on each folder. After a person opens the folder, when he clicks the checkbox, it closes the folder!) thnx a million
[jQuery] Re: How to prevent loading jquery twice
Because some components are loaded inside of iframe and need its own jQuery. some compionents are loaded one-by-one and need only one common library On Mar 23, 9:39 pm, Liam Potter radioactiv...@gmail.com wrote: why would you beloadingthe library for each script? Andy789 wrote: Hi all, I have different independent modules using jquery and need to avoid its doubleloading. So, instead ofloadingjquery, I amloadingthe code: if (typeof jQuery != 'undefined') { document.write('script type=text/javascript src=/templates/ yoo_evolution/lib/js/jquery-1.3.2.min.js/script'); } Also, I have added a line var $j = jQuery.noConflict(); as a last line of jquery library file. The problem is that though it writes the code on document write, it does not seem that jquery is loaded at all, because I am getting an error jQuery not defined. What am i doing wrong here? is there a more elegant way to load a library dynamically? Thanks
[jQuery] Re: jquery_ajax + servlet problem
You are mapping your AddComment request to be /servlets/AddComment but making AJAX request to AddComment. Probably changing $.post to this will help: $.post(/servlets/AddComment, function(data){ Unless the current page is also in /servlets. PS. You might find $.getJSON() method useful (http://docs.jquery.com/Ajax/jQuery.getJSON). Read jQuery HowTo Resource - http://jquery-howto.blogspot.com 2009/3/23 Michael lifeng_c...@126.com: It takes me almost half a day , but I haven't solve it ,I don't know why . I would be much appreciate for your help... $(document).ready(function(){ alert(can show); $(#button).click(function(){ alert(when click button , can show ); $.post(AddComment,null,function(data){// AddComment is a servlet name alert(here can't show); },json); }); }); servlet ,root ,servlets/AddComment, public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { System.out.println(here can't show,that is ,the method $.post does not work); } servlet config in web.xml: servlet servlet-nameAddComment/servlet-name servlet-classservlets.AddComment/servlet-class load-on-startup1/load-on-startup /servlet servlet-mapping servlet-nameAddComment/servlet-name url-pattern/servlets/AddComment/url-pattern /servlet-mapping
[jQuery] Re: How to prevent loading jquery twice
Why not include jQuery in your head and don't worry about it being already loaded or not in your components. Then remove jquery loading in all of your components... This will make sure your components concentrate on their main business logic ... Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Mon, Mar 23, 2009 at 3:55 PM, Andy789 e...@abcstudio.com.au wrote: Because some components are loaded inside of iframe and need its own jQuery. some compionents are loaded one-by-one and need only one common library On Mar 23, 9:39 pm, Liam Potter radioactiv...@gmail.com wrote: why would you beloadingthe library for each script? Andy789 wrote: Hi all, I have different independent modules using jquery and need to avoid its doubleloading. So, instead ofloadingjquery, I amloadingthe code: if (typeof jQuery != 'undefined') { document.write('script type=text/javascript src=/templates/ yoo_evolution/lib/js/jquery-1.3.2.min.js/script'); } Also, I have added a line var $j = jQuery.noConflict(); as a last line of jquery library file. The problem is that though it writes the code on document write, it does not seem that jquery is loaded at all, because I am getting an error jQuery not defined. What am i doing wrong here? is there a more elegant way to load a library dynamically? Thanks
[jQuery] Re: Keeping jquery codes up to date - best practise?
I totally agree with Sam don't blindly change working pages with new versions! You're doing nothing but asking for trouble On Mar 23, 5:59 am, Sam sam.carring...@gmail.com wrote: The risk with linking to a latest build is that something will break when the linked-to version of jquery changes. Imagine for instance that you made heavy use of @selectors, and were running live with these when the change was made from 1.2 to 1.3. Your site would break. Such eventualities as this are not impossible in the future. I'd always recommend linking to a specific version of the code and testing your site before upgrading the live version of jQuery, that way you eliminate the possibility of bugs creeping in. Your site has a dependency on a specific version of jQuery to function, and you need to ensure that it still works when upgraded. S On Mar 22, 3:37 pm, mkmanning michaell...@gmail.com wrote: You can link to the latest major number, for examplehttp://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js gets you 1.3.2; it will automatically update to the next 1.#.# version when available. http://ajax.googleapis.com/ajax/libs/jquery/1.2/jquery.min.js Gets you 1.2.6 (the latest version with the minor 2) http://ajax.googleapis.com/ajax/libs/jquery/1.2.3/jquery.min.js gets you 1.2.3 explicitly The one thing to be careful about is if you have code that is version dependent, (e.g. jQuery UI), it may fall out of sync with Google's update. On Mar 22, 3:54 am, Microbe geeky@gmail.com wrote: Thanks for that, but if you use it, aren't you linking to a specific version number? Their example is path:http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js; So what happens if right though my code I call that file and then 1.3.3 comes out?
[jQuery] Re: minification
Using latest YUI and default configuration I got 53.7KB Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Sun, Mar 22, 2009 at 11:40 PM, dereck009 galambal...@gmail.com wrote: How the jquery code was minified? I mean it's about 56 kB, while yui compressor gives a 72 kB result. As I saw it's not obfuscated, only minified, so I'm really intrested in the way you did this.
[jQuery] Re: jQuery Form plugin, the checkbox and the formData array
The problem is that this CB function finds only checked checkboxes. That's how forms are supposed to be submitted. If you don't want this behavior then you'll have to serialize the form yourself using fieldSerialize. For example: $('#myForm').submit(function() { var data = $(':input',this).fieldSerialize(false); $.post(this.action, data); return false; });
[jQuery] Re: How to prevent loading jquery twice
well, the ones loading through the iframe will need jquery loaded in the iframe, and the components loaded one-by-one only need jquery loaded once.. I don't understand what you are trying to do hre, just load jquery in the head. Andy789 wrote: Because some components are loaded inside of iframe and need its own jQuery. some compionents are loaded one-by-one and need only one common library On Mar 23, 9:39 pm, Liam Potter radioactiv...@gmail.com wrote: why would you beloadingthe library for each script? Andy789 wrote: Hi all, I have different independent modules using jquery and need to avoid its doubleloading. So, instead ofloadingjquery, I amloadingthe code: if (typeof jQuery != 'undefined') { document.write('script type=text/javascript src=/templates/ yoo_evolution/lib/js/jquery-1.3.2.min.js/script'); } Also, I have added a line var $j = jQuery.noConflict(); as a last line of jquery library file. The problem is that though it writes the code on document write, it does not seem that jquery is loaded at all, because I am getting an error jQuery not defined. What am i doing wrong here? is there a more elegant way to load a library dynamically? Thanks
[jQuery] Re: How to prevent loading jquery twice
we are talking about joomla's index.php (used as a main page) and index2.php (used as an iframe). Index2.php is always a part of index.php. Therefore, 1) if I include jquery to the main page header, the iframe (generated as index2,php) will not work as there is no jquery in there 2) if I include it to both headers, i will get a double library 3) if I include it only to the iframe part, which is always a part of the main page, it will work OK, but i will be changing the core joomla's files and will have to hack it every time when a new version is out So, I am trying to load it only, if it has not been loaded before. Does it make sense now? On Mar 23, 10:15 pm, Liam Potter radioactiv...@gmail.com wrote: well, the onesloadingthrough the iframe will need jquery loaded in the iframe, and the components loaded one-by-one only need jquery loaded once.. I don't understand what you are trying to do hre, just load jquery in the head. Andy789 wrote: Because some components are loaded inside of iframe and need its own jQuery. some compionents are loaded one-by-one and need only one common library On Mar 23, 9:39 pm, Liam Potter radioactiv...@gmail.com wrote: why would you beloadingthe library for each script? Andy789 wrote: Hi all, I have different independent modules using jquery and need to avoid its doubleloading. So, instead ofloadingjquery, I amloadingthe code: if (typeof jQuery != 'undefined') { document.write('script type=text/javascript src=/templates/ yoo_evolution/lib/js/jquery-1.3.2.min.js/script'); } Also, I have added a line var $j = jQuery.noConflict(); as a last line of jquery library file. The problem is that though it writes the code on document write, it does not seem that jquery is loaded at all, because I am getting an error jQuery not defined. What am i doing wrong here? is there a more elegant way to load a library dynamically? Thanks
[jQuery] Re: fadeOut Callback woes
is #lovelyDiv definitely unique?
[jQuery] Re: How to prevent loading jquery twice
also, it is working (only in FF, though) and not very stable. I think what is happening, when I write the script.../script reference to the header, it does not mean that it is loaded. in fact, it is loaded SOMETIMES On Mar 23, 10:28 pm, Andy789 e...@abcstudio.com.au wrote: we are talking about joomla's index.php (used as a main page) and index2.php (used as an iframe). Index2.php is always a part of index.php. Therefore, 1) if I include jquery to the main page header, the iframe (generated as index2,php) will not work as there is no jquery in there 2) if I include it to both headers, i will get a double library 3) if I include it only to the iframe part, which is always a part of the main page, it will work OK, but i will be changing the core joomla's files and will have to hack it every time when a new version is out So, I am trying to load it only, if it has not been loaded before. Does it make sense now? On Mar 23, 10:15 pm, Liam Potter radioactiv...@gmail.com wrote: well, the onesloadingthrough the iframe will need jquery loaded in the iframe, and the components loaded one-by-one only need jquery loaded once.. I don't understand what you are trying to do hre, just load jquery in the head. Andy789 wrote: Because some components are loaded inside of iframe and need its own jQuery. some compionents are loaded one-by-one and need only one common library On Mar 23, 9:39 pm, Liam Potter radioactiv...@gmail.com wrote: why would you beloadingthe library for each script? Andy789 wrote: Hi all, I have different independent modules using jquery and need to avoid its doubleloading. So, instead ofloadingjquery, I amloadingthe code: if (typeof jQuery != 'undefined') { document.write('script type=text/javascript src=/templates/ yoo_evolution/lib/js/jquery-1.3.2.min.js/script'); } Also, I have added a line var $j = jQuery.noConflict(); as a last line of jquery library file. The problem is that though it writes the code on document write, it does not seem that jquery is loaded at all, because I am getting an error jQuery not defined. What am i doing wrong here? is there a more elegant way to load a library dynamically? Thanks
[jQuery] Re: minification
Using the online YUI Compressor here http://www.refresh-sf.com/yui/ simply pasting in the results from here http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.js Resulted in before 124995 after 59670 compression ratio: 52% On Mar 22, 2:40 pm, dereck009 galambal...@gmail.com wrote: How the jquery code was minified? I mean it's about 56 kB, while yui compressor gives a 72 kB result. As I saw it's not obfuscated, only minified, so I'm really intrested in the way you did this.
[jQuery] Re: Rotating CSS classes each 5 sec
On Mar 23, 2:33 pm, mkmanning michaell...@gmail.com wrote: Presumably, which points out a recurring problem: because we don't know the OP's intended use, vis-à-vis actual markup and CSS, etc. everything we suggest is somewhat academic. Other suggestions proposed iterating over collections of elements, I was pointing out an alternative. There's a tradeoff with modifying style rules vs. using class names. If you find yourself having to alter too many styles, it can become cumbersome and more Naturally, the intention is not to iterate over anything and simply modify a single rule. prone to errors It is no more error prone than any other method. (and your presentation layer is now beginning to pollute your behavior layer). Not necessarily. The values to be altered can themselves be encapsulated in css rules accessed by class - instead of iterating over some collection of elements with the same class, you swap the rules of one class for those of another. Class names allow you to roll up several styles into one 'package' as well as take advantage of CSS hierarchy (which you could use e.g. to affect the results of the js modification to the style). Which is not precluded by altering style rules, it is just a different approach. For the OP's situation, i.e. changing a background image, it might be even more efficient to use a sprite-- a single image (so you'd only have a single http request), and re-position the image on each rotation. That could be done in the JavaScript as you suggest, but I'd still prefer to abstract it to classes rather than have to keep position information in the js: Moving an image within an element with overflow hidden can be achieved either way. The style data does not have to be hard coded in the script, it only needs to be passed parameters that tell it which rules to replace with which other rules, that can be all the rules of class A with all the rules of class B (or similar). .img1,.img2, .img3,.img4,.img5 { background-image:#fff url(some_image_url) 0 0 no-repeat;} .img2{ background-position:0 100px;} .img3{ background-image:50px 0;} etc... .theDisplayedRule {} now just write the rules in .imgN to .theDisplayedRule and any element with class theDisplayedRule will get the changes. Since it's presentational, That is not precluded by swapping rules, it depends on how it is implemented. [...] I think the fact that everybody has a different approach makes it very interesting though; I hope the OP can see at least that there are many ways to come at the same problem. Yes. -- Rob
[jQuery] Style Horizontal Scrollbar
Hi all, I'm trying to scroll a horizontal scrollbar and having some troubles. I've been searching far and wide and only come up with scrollpane so far - which works for vertical scrollbars, but not Horizontal. Has anybody managed to style a horizontal scrollbar for a div, (with overflow set to :auto), using JQuery? Would really appreciate any links. Cheers Paul
[jQuery] submit form into shadowbox (or lightbox)
Hi, I need to call a shadowbox page doing a post form. My form would be something like this: form id=form1 name=form1 method=post action= input type=text name=textfield id=textfield / input type=hidden name=hiddenField id=hiddenField / /form What I need is that the destination page of the form is opened inside page of the caller page (using shadowbox for this) and it receive the correct parameters passed by post. Someone can help me, please? Thank you! Federico Ushuaia, Argentina
[jQuery] Playstation 3
jQuery fails on the Playstation 3 browser. Yeah I know the PS3's NetFront browser really sucks at JS but it would be good if the plugin ran so even basic effects would work.
[jQuery] Re: Playstation 3
tbh i think you'd be better off telling Sony about it mate ;) On Mar 23, 11:21 am, Johan johandesi...@gmail.com wrote: jQuery fails on the Playstation 3 browser. Yeah I know the PS3's NetFront browser really sucks at JS but it would be good if the plugin ran so even basic effects would work.
[jQuery] Re: Playstation 3
If I remember correctly - the NetFront browser was missing some fairly fundamental features. I don't remember which, off-hand, but it was enough to cause jQuery not even to load. --John On Mon, Mar 23, 2009 at 7:21 AM, Johan johandesi...@gmail.com wrote: jQuery fails on the Playstation 3 browser. Yeah I know the PS3's NetFront browser really sucks at JS but it would be good if the plugin ran so even basic effects would work.
[jQuery] Re: How to prevent loading jquery twice
Are you using joomla to load jQuery? or are you wringin script tags in some sort of template? I came across this: http://www.packtpub.com/article/using-javascript-effects-with-joomla which seems to imply joomla can handle you script inclusion. hope this helps on 23/03/2009 11:41 Andy789 said:: also, it is working (only in FF, though) and not very stable. I think what is happening, when I write the script.../script reference to the header, it does not mean that it is loaded. in fact, it is loaded SOMETIMES On Mar 23, 10:28 pm, Andy789 e...@abcstudio.com.au wrote: we are talking about joomla's index.php (used as a main page) and index2.php (used as an iframe). Index2.php is always a part of index.php. Therefore, 1) if I include jquery to the main page header, the iframe (generated as index2,php) will not work as there is no jquery in there 2) if I include it to both headers, i will get a double library 3) if I include it only to the iframe part, which is always a part of the main page, it will work OK, but i will be changing the core joomla's files and will have to hack it every time when a new version is out So, I am trying to load it only, if it has not been loaded before. Does it make sense now? On Mar 23, 10:15 pm, Liam Potter radioactiv...@gmail.com wrote: well, the onesloadingthrough the iframe will need jquery loaded in the iframe, and the components loaded one-by-one only need jquery loaded once.. I don't understand what you are trying to do hre, just load jquery in the head. Andy789 wrote: Because some components are loaded inside of iframe and need its own jQuery. some compionents are loaded one-by-one and need only one common library On Mar 23, 9:39 pm, Liam Potter radioactiv...@gmail.com wrote: why would you beloadingthe library for each script? Andy789 wrote: Hi all, I have different independent modules using jquery and need to avoid its doubleloading. So, instead ofloadingjquery, I amloadingthe code: if (typeof jQuery != 'undefined') { document.write('script type=text/javascript src=/templates/ yoo_evolution/lib/js/jquery-1.3.2.min.js/script'); } Also, I have added a line var $j = jQuery.noConflict(); as a last line of jquery library file. The problem is that though it writes the code on document write, it does not seem that jquery is loaded at all, because I am getting an error jQuery not defined. What am i doing wrong here? is there a more elegant way to load a library dynamically? Thanks
[jQuery] With IE8 out, how do you test for IE6?
I say that friday that IE8 was released so I downloaded it to check it out. I am happy that they did seemed to do at least a few right right and it seem very easy to test for IE8 and IE7 in the IE8 browser (which is very nice). However, after i installed IE8, Multiple IE stopped render correctly (I use Multiple IE to test for IE6 and this is only at work since I have yet to find a way to run IE6 on Vista at home). Do you guys have any tips/tricks for properly test IE8/7/6 On Vista and XP? I am almost at the point where I want to drop support for IE6 on my own javascript plug-ins because it is utterly retarded to have to main code that works on 3 separate version of the same browser (come on IE6 is over 8 years old, FireFox 1 wass released after IE6 and no one officially supports that). -- View this message in context: http://www.nabble.com/With-IE8-out%2C-how-do-you-test-for-IE6--tp22659647s27240p22659647.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: JS Toolbox - Sortable Table
On Mar 22, 5:59 pm, tsp...@gmail.com tsp...@gmail.com wrote: I was looking for a simple way to have a sortable table and found this at jstoolbox -http://www.javascripttoolbox.com/lib/table/documentation.php That's my lib, and I am currently working on improving it for another release. Right now there is no jQuery interface for it, so it's probably not on-topic in this group. But in all honesty I seem to not be able to get it to work. Does anyone have any clue what I am doing wrong? http://43photo.com/store/files.php Looks to me like you don't have a proper thead for your header row and tbody for your content. You can email me privately if it still doesn't work after fixing that. Matt Kruse
[jQuery] Forced bubbling
I have 2 containers i disabled event bubbling for first container. This is must have $ ('#first').click(function() { return false; }); Now i need to detect if user clicked outside #second container $ (document).click(function () { alert('clicked somewhere'); }); Clicking on #first doesn't show me alert. Is there any way to force bubbling??. I cant add this alert to #first click, because there can be 1000 that kind of elements.
[jQuery] Re: Forced bubbling
Why not do: $('#first').click(function(e) { e.preventDefault(); }); --John On Mon, Mar 23, 2009 at 9:20 AM, John Smith master9...@gmail.com wrote: I have 2 containers i disabled event bubbling for first container. This is must have $ ('#first').click(function() { return false; }); Now i need to detect if user clicked outside #second container $ (document).click(function () { alert('clicked somewhere'); }); Clicking on #first doesn't show me alert. Is there any way to force bubbling??. I cant add this alert to #first click, because there can be 1000 that kind of elements.
[jQuery] Re: With IE8 out, how do you test for IE6?
Eridius ha scritto: I say that friday that IE8 was released so I downloaded it to check it out. I am happy that they did seemed to do at least a few right right and it seem very easy to test for IE8 and IE7 in the IE8 browser (which is very nice). However, after i installed IE8, Multiple IE stopped render correctly (I use Multiple IE to test for IE6 and this is only at work since I have yet to find a way to run IE6 on Vista at home). Do you guys have any tips/tricks for properly test IE8/7/6 On Vista and XP? I am almost at the point where I want to drop support for IE6 on my own javascript plug-ins because it is utterly retarded to have to main code that works on 3 separate version of the same browser (come on IE6 is over 8 years old, FireFox 1 wass released after IE6 and no one officially supports that). You can download a windows xp image (to install as a virtual machine) for testing purpose from microsoft (I don't have the link, but you can find it on the Multiple IE site). I know, it's the worse way to solve. :-/ Bye :-) -- gianiaz.net - web solutions via angelo custode, 10 - 23100 sondrio (so) - italy +39 347 7196482
[jQuery] Re: With IE8 out, how do you test for IE6?
Eridius wrote: Do you guys have any tips/tricks for properly test IE8/7/6 On Vista and XP? Sure, the best Solution i found so far is Xenocode. http://www.xenocode.com/browsers/ Known Issues • The IE8 executable triggers a false positive warning when using Avira AV. UPDATE: Avira is patching their product, see http://forum.avira.com/wbb/index.php?page=ThreadthreadID=82913. • Mac clients are not currently supported. (Yes, we're sorry and we hear you!) Cheers, Martin
[jQuery] Re: drag drop resize doesn't work in jquery 1.3.2
Have you upgraded jQuery UI as well as jQuery? jQuery UI 1.5.3 is only compatible with 1.2.6. If you upgrade to jQuery 1.3+, you'll need jQuery UI 1.7+. Also, note: there's a separate mailing list for jQuery UI help: http://groups.google.com/group/jquery-ui See you there, if you have any more questions. - Richard On Sun, Mar 22, 2009 at 11:53 AM, leaderxman elf...@gmail.com wrote: this is my code it worked in jquery 1.2.6 but doesn't work in jquery 1.3.2 !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http:// www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd html xmlns=http://www.w3.org/1999/xhtml; head meta http-equiv=Content-Type content=text/html; charset=utf-8 / script src=js/jquery-1.3.2.js/script script src=js/ui.core.js/script script src=js/ui.draggable.js/script script src=js/ui.droppable.js/script script src=js/ui.resizable.js/script script $(document).ready(function(){ var $container = $('#container'); $(#ob1).resizable().parent().draggable({containment: '#container'}); $(.ob2).draggable({helper:'clone'}); $container.droppable({ accept: '.ob2', drop: function(ev, ui) { ui.draggable.clone().fadeOut(fast, function() { $(this).removeClass(); $(this).resizable().parent().draggable({containment: '#container' }); $(this).fadeIn(fast); }).appendTo($(this)); } }); }); /script style type=text/css !-- #container { width: 95%; height:400px; border:2px solid #ccc; padding: 10px; } #list { width: 95%; height:auto; border:2px solid #ccc; padding: 10px; position: fixed; } -- /style /head body div id=container img id=ob1 src=images/a.jpeg width=200 height=200 /div div id=list img src=images/1.png width=100 height=100 class=ob2 / img src=images/2.png width=100 height=100 class=ob2 / img src=images/3.png width=100 height=100 class=ob2 / img src=images/4.png width=100 height=100 class=ob2 / /div /body /html another question when i using jquery 1.2.6 chrome and safari didn't work
[jQuery] Re: simulate radio with checkboxes in a table
This should work for you... $('#mytable input').click(function(){ // get current time (class name) var time = $(this).attr('class'); // iterate through each input except the one clicked $('#mytable input').not($(this)).each(function(){ // if it has the same class name, uncheck (radio-esque functionality) if ( $(this).hasClass(time) ) $(this).attr('checked',''); }); }); Demo: http://jsbin.com/umoqe I would add visual indications of groupings (a thin horizontal rule, e.g.) for clarity as well. -- SEAN O http://www.sean-o.com http://twitter.com/seanodotcom newbuntu wrote: I'm learning jquery. I have table like this table id=mytable trtd input type=checkbox class='08_00_AM'/tdtdMichael/tdtd21/td/tr trtd input type=checkbox class='08_00_AM'/tdtdSam/tdtd22/td/tr trtd input type=checkbox class='08_00_AM'/tdtdJohn/tdtd28/td/tr trtd input type=checkbox class='08_00_AM'/tdtdJason/tdtd55/td/tr trtd input type=checkbox class='10_00_AM'/tdtdMichael/tdtd21/td/tr trtd input type=checkbox class='10_00_AM'/tdtdSam/tdtd22/td/tr trtd input type=checkbox class='10_00_AM'/tdtdJohn/tdtd28/td/tr trtd input type=checkbox class='10_00_AM'/tdtdJason/tdtd55/td/tr /table I marked input boxes with a time class (either 08_00_AM or 10_00_AM). Can I simulate a radio behavior for the checkboxes with the same time? 1) if a box is checked, then all other boxes with the same time should be unchecked. 2) clicking on a checked box, should uncheck it. any help is greatly appreciated. thx! -- View this message in context: http://www.nabble.com/simulate-radio-with-checkboxes-in-a-table-tp22655210s27240p22659996.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: With IE8 out, how do you test for IE6?
have you tried http://tredosoft.com/Multiple_IE they do a standalone IE7 too, which i have limited success with so i just removed ie8. (make sure you have 'show updates' checked in add/ remove programs if you want to remove IE8, windows treats it as an upgrade). On Mar 23, 12:59 pm, Eridius bas...@gmail.com wrote: I say that friday that IE8 was released so I downloaded it to check it out. I am happy that they did seemed to do at least a few right right and it seem very easy to test for IE8 and IE7 in the IE8 browser (which is very nice). However, after i installed IE8, Multiple IE stopped render correctly (I use Multiple IE to test for IE6 and this is only at work since I have yet to find a way to run IE6 on Vista at home). Do you guys have any tips/tricks for properly test IE8/7/6 On Vista and XP? I am almost at the point where I want to drop support for IE6 on my own javascript plug-ins because it is utterly retarded to have to main code that works on 3 separate version of the same browser (come on IE6 is over 8 years old, FireFox 1 wass released after IE6 and no one officially supports that). -- View this message in context:http://www.nabble.com/With-IE8-out%2C-how-do-you-test-for-IE6--tp2265... Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: With IE8 out, how do you test for IE6?
On Mar 23, 2009, at 1:59 PM, Eridius wrote: I say that friday that IE8 was released so I downloaded it to check it out. I am happy that they did seemed to do at least a few right right and it seem very easy to test for IE8 and IE7 in the IE8 browser (which is very nice). However, after i installed IE8, Multiple IE stopped render correctly (I use Multiple IE to test for IE6 and this is only at work since I have yet to find a way to run IE6 on Vista at home). Do you guys have any tips/ tricks for properly test IE8/7/6 On Vista and XP? I am almost at the point where I want to drop support for IE6 on my own javascript plug-ins because it is utterly retarded to have to main code that works on 3 separate version of the same browser (come on IE6 is over 8 years old, FireFox 1 wass released after IE6 and no one officially supports that). There's SuperPreview from Microsoft: http://www.istartedsomething.com/20090318/expression-web-superpreview- cross-browser-testing/ I think it only does IE6 and the IE you have installed on your machine. IE8 also has backwards-compatibility mode, which supposedly goes into IE7 rendering mode, although in my experience it renders it more like IE6. P.S.: My company no longer supports IE6, unless the customer is OK with paying 30% extra development time. It's the easiest solution for us ;-) Regards, -- Martijn.
[jQuery] Re: submit form into shadowbox (or lightbox)
Hi, You can POST the form using jQuery.ajax[1] (being sure to set the 'type' parameter to 'POST'), and then handle creating and populating the shadowbox/lightbox in the 'success' handler using the response from the server. (Instead of jQuery.ajax, you could use jQuery.post [2] which is a simplified wrapper for it, but .post is missing out some important things IMHO, like a callback on failure.) [1] http://docs.jquery.com/Ajax/jQuery.ajax#options [2] http://docs.jquery.com/Ajax/jQuery.post#urldatacallbacktype HTH, -- T.J. Crowder tj / crowder software / com Independent Software Engineer, consulting services available On Mar 23, 11:36 am, Federico González Brizzio fedegon...@gmail.com wrote: Hi, I need to call a shadowbox page doing a post form. My form would be something like this: form id=form1 name=form1 method=post action= input type=text name=textfield id=textfield / input type=hidden name=hiddenField id=hiddenField / /form What I need is that the destination page of the form is opened inside page of the caller page (using shadowbox for this) and it receive the correct parameters passed by post. Someone can help me, please? Thank you! Federico Ushuaia, Argentina
[jQuery] Re: fadeOut Callback woes
Yes. Well. Not definitely. Let me check... Yes. Definitely. However, might be something simalar. I have card-a and card-b which are contained in slide-bar. card-a and card-b are containers to load and display content into alternatly. When the user closes the slide-bar, I want both of them to hide, then, hide the slide-bar. My awful jQuery skills are about to show themselves properly... I have (Abridged version), function closeSlideBar() { $(#card-a).fadeOut(500,function(){ $(#side-nav).fadeIn(5000); $(#sidebar).animate({left:slideBarClosed+px},1,swing); }); $(#card-b).fadeOut(500,function(){ $(#side-nav).fadeIn(5000); $(#sidebar).animate({left:slideBarClosed+px},1,swing); }); }; I did think for a while that (apart from my method probably not being great) having the two running at the same time was causing the problem, and tried commenting one out. But still didn't work. Sigh. On Mar 23, 11:29 am, ryan.j ryan.joyce...@googlemail.com wrote: is #lovelyDiv definitely unique?
[jQuery] Re: submit form into shadowbox (or lightbox)
(Sorry, premature click-itis.) I should have said that you would initiate the jQuery.ajax post from a submit handler on the form, passing the form data in as the 'data' parameter, and cancel the standard form submit (since that would refresh the entire page). -- T.J. :-) On Mar 23, 1:57 pm, T.J. Crowder t...@crowdersoftware.com wrote: Hi, You can POST the form using jQuery.ajax[1] (being sure to set the 'type' parameter to 'POST'), and then handle creating and populating the shadowbox/lightbox in the 'success' handler using the response from the server. (Instead of jQuery.ajax, you could use jQuery.post [2] which is a simplified wrapper for it, but .post is missing out some important things IMHO, like a callback on failure.) [1]http://docs.jquery.com/Ajax/jQuery.ajax#options [2]http://docs.jquery.com/Ajax/jQuery.post#urldatacallbacktype HTH, -- T.J. Crowder tj / crowder software / com Independent Software Engineer, consulting services available On Mar 23, 11:36 am, Federico González Brizzio fedegon...@gmail.com wrote: Hi, I need to call a shadowbox page doing a post form. My form would be something like this: form id=form1 name=form1 method=post action= input type=text name=textfield id=textfield / input type=hidden name=hiddenField id=hiddenField / /form What I need is that the destination page of the form is opened inside page of the caller page (using shadowbox for this) and it receive the correct parameters passed by post. Someone can help me, please? Thank you! Federico Ushuaia, Argentina
[jQuery] Re: With IE8 out, how do you test for IE6?
I thought SuperPreview was aimed more at identifying layout issues, rather than testing in a native enviroment? On Mar 23, 1:50 pm, Martijn Houtman martijn.hout...@gmail.com wrote: On Mar 23, 2009, at 1:59 PM, Eridius wrote: I say that friday that IE8 was released so I downloaded it to check it out. I am happy that they did seemed to do at least a few right right and it seem very easy to test for IE8 and IE7 in the IE8 browser (which is very nice). However, after i installed IE8, Multiple IE stopped render correctly (I use Multiple IE to test for IE6 and this is only at work since I have yet to find a way to run IE6 on Vista at home). Do you guys have any tips/ tricks for properly test IE8/7/6 On Vista and XP? I am almost at the point where I want to drop support for IE6 on my own javascript plug-ins because it is utterly retarded to have to main code that works on 3 separate version of the same browser (come on IE6 is over 8 years old, FireFox 1 wass released after IE6 and no one officially supports that). There's SuperPreview from Microsoft: http://www.istartedsomething.com/20090318/expression-web-superpreview- cross-browser-testing/ I think it only does IE6 and the IE you have installed on your machine. IE8 also has backwards-compatibility mode, which supposedly goes into IE7 rendering mode, although in my experience it renders it more like IE6. P.S.: My company no longer supports IE6, unless the customer is OK with paying 30% extra development time. It's the easiest solution for us ;-) Regards, -- Martijn.
[jQuery] Re: Rotating CSS classes each 5 sec
This code should work if you changes the css class in the var mobile = $() selector: div class=actualC div class=actualCa div class=actualCRotImg thru=img1, img2, img3, img4, img5 /div /div /div my js is the last one $(function(){ function rotateClass(){ var el = $(this), classes = el.data('classes'), cur = el.data ('current-class'), next = cur++; if (next+1 classes.length) next = 0; el.removeClass(classes[ cur ]).addClass(classes[ next ] ).data ('current-class', next); } var mobile = $('.actualCRotImg').each(function(){ var el = $(this), classes = el.attr('thru').split(','); el.data('classes', classes).data('current-class', 0).bind ('rotate-class', rotateClass).addClass(classes[0]); }); setInterval(function(){ mobile.trigger('rotate-class') }, 5000); }); On Mar 22, 5:21 am, Alexandru Dinulescu alex.d.a...@gmail.com wrote: My html looks like div class=actualC div class=actualCa div class=actualCRotImg thru=img1, img2, img3, img4, img5 /div /div /div my js is the last one $(function(){ function rotateClass(){ var el = $(this), classes = el.data('classes'), cur = el.data ('current-class'), next = cur++; if (next+1 classes.length) next = 0; el.removeClass(classes[ cur ]).addClass(classes[ next ] ).data ('current-class', next); } var mobile = $('.mobileclass').each(function(){ var el = $(this), classes = el.attr('thru').split(','); el.data('classes', classes).data('current-class', 0).bind ('rotate-class', rotateClass).addClass(classes[0]); }); setInterval(function(){ mobile.trigger('rotate-class') }, 5000); }); and it doesnt work ... ? nothing is happening when i refresh the page. I just need a very easy stuff done, have 5 css classes i want rotated in a div each 5 seconds, just an array, the classes can be definied inside the js file. --- Alexandru Dinulescu Web Developer (X)HTML/CSS Specialist Expert Guarantee Certified Developer XHTML:http://www.expertrating.com/transcript.asp?transcriptid=1879053 CSS :http://www.expertrating.com/transcript.asp?transcriptid=1870619 RentACoder Profile:http://www.rentacoder.com/RentACoder/DotNet/SoftwareCoders/ShowBioInf... MainWebsite:http://alexd.adore.ro On Sun, Mar 22, 2009 at 4:56 AM, Eric Garside gars...@gmail.com wrote: Try something like the following: div class=mobileclass thru=class-state-one,class-state-two,class- state-three/div And the js: $(function(){ function rotateClass(){ var el = $(this), classes = el.data('classes'), cur = el.data ('current-class'), next = cur++; if (next+1 classes.length) next = 0; el.removeClass(classes[ cur ]).addClass(classes[ next ] ).data ('current-class', next); } var mobile = $('.mobileclass').each(function(){ var el = $(this), classes = el.attr('thru').split(','); el.data('classes', classes).data('current-class', 0).bind ('rotate-class', rotateClass).addClass(classes[0]); }); setInterval(function(){ mobile.trigger('rotate-class') }, 5000); }); On Mar 21, 2:03 pm, mkmanning michaell...@gmail.com wrote: NaN is happening because of an error in this line: parseInt(div.className.substring(3)); It most likely means your className is different. I just tested the code in Firefox on this markup and it works as it should: div class=img1/div What does your html and js look like? On Mar 21, 7:21 am, Alexandru Dinulescu alex.d.a...@gmail.com wrote: Hello. I am getting a imgNaN when using this, can you tell me how i can make the array script work since that doesnt work either. --- Alexandru Dinulescu Web Developer (X)HTML/CSS Specialist Expert Guarantee Certified Developer XHTML:http://www.expertrating.com/transcript.asp?transcriptid=1879053 CSS :http://www.expertrating.com/transcript.asp?transcriptid=1870619 RentACoder Profile: http://www.rentacoder.com/RentACoder/DotNet/SoftwareCoders/ShowBioInf... MainWebsite:http://alexd.adore.ro On Sat, Mar 21, 2009 at 4:13 AM, mkmanning michaell...@gmail.com wrote: Another alternative (no array needed, goes from img1 to img5 and starts over): $(document).ready(function(){ div = $('div.img1')[0], //get with whatever selector once swapDiv = setInterval(function(){ n = parseInt(div.className.substring(3)); div.className = 'img'+( n4?1:n+1 ); },5000); }); If you want to stop it later, just call clearInterval('swapDiv'); It's probably a little more efficient :) On Mar 20, 12:23 pm, Alexandru Dinulescu
[jQuery] Re: With IE8 out, how do you test for IE6?
http://www.xenocode.com/browsers/ standalone browsers that run in their own sandbox, just download the exe files and run them. ryan.j wrote: I thought SuperPreview was aimed more at identifying layout issues, rather than testing in a native enviroment? On Mar 23, 1:50 pm, Martijn Houtman martijn.hout...@gmail.com wrote: On Mar 23, 2009, at 1:59 PM, Eridius wrote: I say that friday that IE8 was released so I downloaded it to check it out. I am happy that they did seemed to do at least a few right right and it seem very easy to test for IE8 and IE7 in the IE8 browser (which is very nice). However, after i installed IE8, Multiple IE stopped render correctly (I use Multiple IE to test for IE6 and this is only at work since I have yet to find a way to run IE6 on Vista at home). Do you guys have any tips/ tricks for properly test IE8/7/6 On Vista and XP? I am almost at the point where I want to drop support for IE6 on my own javascript plug-ins because it is utterly retarded to have to main code that works on 3 separate version of the same browser (come on IE6 is over 8 years old, FireFox 1 wass released after IE6 and no one officially supports that). There's SuperPreview from Microsoft: http://www.istartedsomething.com/20090318/expression-web-superpreview- cross-browser-testing/ I think it only does IE6 and the IE you have installed on your machine. IE8 also has backwards-compatibility mode, which supposedly goes into IE7 rendering mode, although in my experience it renders it more like IE6. P.S.: My company no longer supports IE6, unless the customer is OK with paying 30% extra development time. It's the easiest solution for us ;-) Regards, -- Martijn.
[jQuery] Re: With IE8 out, how do you test for IE6?
Download IETester http://www.my-debugbar.com/wiki/IETester/HomePage and you can test 5.5 through 8. I use this daily, works great.
[jQuery] Re: With IE8 out, how do you test for IE6?
On Mar 23, 2009, at 3:16 PM, ryan.j wrote: I thought SuperPreview was aimed more at identifying layout issues, rather than testing in a native enviroment? Oh, you could be right. I was unable to test it, because it does not even work for me (it crashes at startup), but it's still beta- software, so what can you expect. Multiple IE works fine for me right now. Regards, -- Martijn.
[jQuery] Re: [validate] Suggested new feature for validation.
The issue is that I can see how you did the multipart for required field validation but we have a lot of custom validation rules setup as well. Also, we don't like setting the validation up on the class attribute of an input (grows too large and becomes tedious to manage) and prefer to setup everything on the .validate() method. It would be ideal if the .validate() method wasn't tied only to a form and could be tied to a div as well or setup directly on an element level and then call selective element validation from an onclick method on a button. On Mar 21, 7:24 am, Jörn Zaefferer joern.zaeffe...@googlemail.com wrote: One approach for subformvalidationis demoed here:http://jquery.bassistance.de/validate/demo/marketo/step2.htm Another here, though the demo is currently broken, I need to update the accordion plugin:http://jquery.bassistance.de/validate/demo/multipart/ Jörn On Fri, Mar 20, 2009 at 9:19 PM, Millman millma...@gmail.com wrote: I have a case where I'm setting up an ASP.NET MVC View that partially renders several Partial View Controls. Each of these controls will be wrapped by a div/div element within the Form. This View will be used as a Wizard and we will be utilizing JavaScript to show and hide each various div element as they navigate the wizard. My issue is that there can be only 1 form tag which contains all of the Partial View Controls to be displayed. We cannot commit a partial registration to the database only a complete registration so we want to save our submit button for the end of the process and this is why we can have only one form element. Each control within each Partial View has many differentvalidationrules specified like required, email, etc. Now, we only want the current div being displayed to validate not the entire form as we are going to base our decision on whether or not they get to navigate to the next section of the registration process on if all the values entered into the currently displayed inputs are acceptable. I've decided the only real way to get thevalidationworking the way I'd like it to is to set the $().validate method on the div level instead of the form level. Is it possible to make thevalidation framework more flexible in the future in this manner or is there a way currently where we can make our application function in this way? Thanks in advance!
[jQuery] Re: [validate] Suggested new feature for validation.
Could you provide a simple mockup of the interaction you'd like to build? Just some markup and basic CSS and some JavaScript to indicate how the validation should interact with the wizard sections. That would help a lot to understand what you want to achieve and how to make the validation plugin do that. Jörn On Mon, Mar 23, 2009 at 3:28 PM, Millman millma...@gmail.com wrote: The issue is that I can see how you did the multipart for required field validation but we have a lot of custom validation rules setup as well. Also, we don't like setting the validation up on the class attribute of an input (grows too large and becomes tedious to manage) and prefer to setup everything on the .validate() method. It would be ideal if the .validate() method wasn't tied only to a form and could be tied to a div as well or setup directly on an element level and then call selective element validation from an onclick method on a button. On Mar 21, 7:24 am, Jörn Zaefferer joern.zaeffe...@googlemail.com wrote: One approach for subformvalidationis demoed here:http://jquery.bassistance.de/validate/demo/marketo/step2.htm Another here, though the demo is currently broken, I need to update the accordion plugin:http://jquery.bassistance.de/validate/demo/multipart/ Jörn On Fri, Mar 20, 2009 at 9:19 PM, Millman millma...@gmail.com wrote: I have a case where I'm setting up an ASP.NET MVC View that partially renders several Partial View Controls. Each of these controls will be wrapped by a div/div element within the Form. This View will be used as a Wizard and we will be utilizing JavaScript to show and hide each various div element as they navigate the wizard. My issue is that there can be only 1 form tag which contains all of the Partial View Controls to be displayed. We cannot commit a partial registration to the database only a complete registration so we want to save our submit button for the end of the process and this is why we can have only one form element. Each control within each Partial View has many differentvalidationrules specified like required, email, etc. Now, we only want the current div being displayed to validate not the entire form as we are going to base our decision on whether or not they get to navigate to the next section of the registration process on if all the values entered into the currently displayed inputs are acceptable. I've decided the only real way to get thevalidationworking the way I'd like it to is to set the $().validate method on the div level instead of the form level. Is it possible to make thevalidation framework more flexible in the future in this manner or is there a way currently where we can make our application function in this way? Thanks in advance!
[jQuery] unbind('focus')
Scenario: My form have 3 controls filled with placeholders named *, * and Comente. If user give focus to controls the placeholders vanishes and background color changes. Suppose user make a mistake in filling a control and submit the form. AJAX return an error message and preserve the data filled by the user, for relevants corrections. When the user enter the control containing the data for correction the data vanishes. I want to preserve the erroneus data in place allowing the user make changes only where the error is. I tried unbind('focus') but it didn't works. A test case is better than one million non native english words. So, please have a look at: http://www.livroajaxjquery.com.br/temp/form.php Any help will be appreciate. -- View this message in context: http://www.nabble.com/unbind%28%27focus%27%29-tp22661789s27240p22661789.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] IE error with Jquery
Im getting the following error with IE 6 and IE 8 beta and Jquery. Unexpected call to method or property access Line: 12, Char 2305 Code: 0 The problem seems to be this declaration: this.appendChild(E)}})}, Im using the latest Jquery taken from the site today. Any help would be greatly appreciated, Mika
[jQuery] Re: Keeping jquery codes up to date - best practise?
@Microbe, you could combine your single domain solution with @Steve's Google Ajax library suggestion. Rather than linking directly to a hosted Ajax library, you could link to a JavaScript file hosted by you on a single domain. In that JavaScript file, call google.load (jquery, 1.3.2). When your site is ready to move up to the next version, you can just update the version number in your centrally hosted JavaScript file. On Mar 23, 4:10 am, MorningZ morni...@gmail.com wrote: I totally agree with Sam don't blindly change working pages with new versions! You're doing nothing but asking for trouble On Mar 23, 5:59 am, Sam sam.carring...@gmail.com wrote: The risk with linking to a latest build is that something will break when the linked-to version of jquery changes. Imagine for instance that you made heavy use of @selectors, and were running live with these when the change was made from 1.2 to 1.3. Your site would break. Such eventualities as this are not impossible in the future. I'd always recommend linking to a specific version of the code and testing your site before upgrading the live version of jQuery, that way you eliminate the possibility of bugs creeping in. Your site has a dependency on a specific version of jQuery to function, and you need to ensure that it still works when upgraded. S On Mar 22, 3:37 pm, mkmanning michaell...@gmail.com wrote: You can link to the latest major number, for examplehttp://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js gets you 1.3.2; it will automatically update to the next 1.#.# version when available. http://ajax.googleapis.com/ajax/libs/jquery/1.2/jquery.min.js Gets you 1.2.6 (the latest version with the minor 2) http://ajax.googleapis.com/ajax/libs/jquery/1.2.3/jquery.min.js gets you 1.2.3 explicitly The one thing to be careful about is if you have code that is version dependent, (e.g. jQuery UI), it may fall out of sync with Google's update. On Mar 22, 3:54 am, Microbe geeky@gmail.com wrote: Thanks for that, but if you use it, aren't you linking to a specific version number? Their example is path:http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js; So what happens if right though my code I call that file and then 1.3.3 comes out?
[jQuery] Re: With IE8 out, how do you test for IE6?
Do you know the IE Tester? I'm using it, and it's nice... 2009/3/23 ryan.j ryan.joyce...@googlemail.com I thought SuperPreview was aimed more at identifying layout issues, rather than testing in a native enviroment? On Mar 23, 1:50 pm, Martijn Houtman martijn.hout...@gmail.com wrote: On Mar 23, 2009, at 1:59 PM, Eridius wrote: I say that friday that IE8 was released so I downloaded it to check it out. I am happy that they did seemed to do at least a few right right and it seem very easy to test for IE8 and IE7 in the IE8 browser (which is very nice). However, after i installed IE8, Multiple IE stopped render correctly (I use Multiple IE to test for IE6 and this is only at work since I have yet to find a way to run IE6 on Vista at home). Do you guys have any tips/ tricks for properly test IE8/7/6 On Vista and XP? I am almost at the point where I want to drop support for IE6 on my own javascript plug-ins because it is utterly retarded to have to main code that works on 3 separate version of the same browser (come on IE6 is over 8 years old, FireFox 1 wass released after IE6 and no one officially supports that). There's SuperPreview from Microsoft: http://www.istartedsomething.com/20090318/expression-web-superpreview- cross-browser-testing/ I think it only does IE6 and the IE you have installed on your machine. IE8 also has backwards-compatibility mode, which supposedly goes into IE7 rendering mode, although in my experience it renders it more like IE6. P.S.: My company no longer supports IE6, unless the customer is OK with paying 30% extra development time. It's the easiest solution for us ;-) Regards, -- Martijn.
[jQuery] Jquery Media plugin - fails in ie
I'm not sure if this is a problem with the media plugin (malsup.com) or with swfobject, but in IE only, and only with flash content, there is a runtime error when the a tags are inside p tags. So this below will work for the .wmv file but fall down on the flv. pa class=video href=video/secondary-assessment-effective- questioning.wmvEffective Questioning (from Teachers' TV)/a/p pa href=video/test-flv.flv class=videoTest flv video/a/p The jquery is simply: $(document).ready(function() { $('.video').media( { width: 320, height: 260, autoplay: false, flashvars: { skin: 'video/snel-skin.swf' } } ); $('.audio').media( { width: 320, height: 100, autoplay: false, flashvars: { skin: 'video/snel-skin.swf' } } ); }); Any ideas? Matthew
[jQuery] jquery toggle class, I needed to switch class....
/// /// Switch Between Classes/// /// jQuery.fn.switchClass = function(class1,class2) { if(this.hasClass(class1)){ remove = class1; add = class2; } else { remove = class2; add = class1; } this.removeClass(remove); this.addClass(add); }; Hope this helps someone out.
[jQuery] Superfish menu activate on click
This is a really cool patch: http://plugins.jquery.com/node/3967 It makes your menu like those cool dropdowns on digg.com. Request: can we have [ click - open menu - second click - close menu ] like a normal drop down box? Thanks!! I found a BUG: When you click the top menu item, then mouse out (and do not select an item) the hover CSS is still applied. The menu should go back to 'not hovered' CSS style Here is the resulting file (for windows users who have no 'patch' command): /* * Superfish v1.4.8 - jQuery menu widget * Copyright (c) 2008 Joel Birch * * Dual licensed under the MIT and GPL licenses: * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.html * * CHANGELOG: http://users.tpg.com.au/j_birch/plugins/superfish/changelog.txt */ ;(function($){ $.fn.superfish = function(op){ var sf = $.fn.superfish, c = sf.c, menuActive = false, $arrow = $(['span class=',c.arrowClass,' #187;/span'].join ('')), click = function(){ var $$ = $(this), menu = getMenu($$), o = sf.op; if (o.firstOnClick !menuActive $$.parent()[0] == menu) { menuActive = true; clearTimeout(menu.sfTimer); $$.showSuperfishUl().siblings().hideSuperfishUl(); return false; // prevent redirect to anchor target href } }, over = function(){ var $$ = $(this), menu = getMenu($$), o = sf.op; if (!o.firstOnClick || menuActive || $$.parent()[0] != menu) { clearTimeout(menu.sfTimer); $$.showSuperfishUl().siblings().hideSuperfishUl(); } }, out = function(){ var $$ = $(this), menu = getMenu($$), o = sf.op; clearTimeout(menu.sfTimer); menu.sfTimer=setTimeout(function(){ o.retainPath=($.inArray($$[0],o.$path)-1); $$.hideSuperfishUl(); if (o.$path.length $$.parents(['li.',o.hoverClass].join ('')).length1){over.call(o.$path);} else {menuActive = false;} },o.delay); }, getMenu = function($menu){ var menu = $menu.parents(['ul.',c.menuClass,':first'].join('')) [0]; sf.op = sf.o[menu.serial]; return menu; }, addArrow = function($a){ $a.addClass(c.anchorClass).append ($arrow.clone()); }; return this.each(function() { var s = this.serial = sf.o.length; var o = $.extend({},sf.defaults,op); o.$path = $('li.'+o.pathClass,this).slice(0,o.pathLevels).each (function(){ $(this).addClass([o.hoverClass,c.bcClass].join(' ')) .filter('li:has(ul)').removeClass(o.pathClass); }); sf.o[s] = sf.op = o; $('li:has(ul)',this)[($.fn.hoverIntent !o.disableHI) ? 'hoverIntent' : 'hover'](over,out) .click(click) .each(function() { if (o.autoArrows) addArrow( $('a:first-child',this) ); }) .not('.'+c.bcClass) .hideSuperfishUl(); var $a = $('a',this); $a.each(function(i){ var $li = $a.eq(i).parents('li'); $a.eq(i).focus(function(){over.call($li);}).blur(function() {out.call($li);}); }); o.onInit.call(this); }).each(function() { var menuClasses = [c.menuClass]; if (sf.op.dropShadows !($.browser.msie $.browser.version 7)) menuClasses.push(c.shadowClass); $(this).addClass(menuClasses.join(' ')); }); }; var sf = $.fn.superfish; sf.o = []; sf.op = {}; sf.IE7fix = function(){ var o = sf.op; if ($.browser.msie $.browser.version 6 o.dropShadows o.animation.opacity!=undefined)
[jQuery] Re: Jquery Media plugin - fails in ie
Hi Matthew, I had a similar problem and M. Alsup suggested I download an older version of the JW FLV (v3.8; current version is v4.3) player and the error (object expected from IE's script debugger) went away. Hope this helps On Mar 23, 8:09 am, matthew.ni...@googlemail.com matthew.ni...@googlemail.com wrote: I'm not sure if this is a problem with the media plugin (malsup.com) or with swfobject, but in IE only, and only with flash content, there is a runtime error when the a tags are inside p tags. So this below will work for the .wmv file but fall down on the flv. pa class=video href=video/secondary-assessment-effective- questioning.wmvEffective Questioning (from Teachers' TV)/a/p pa href=video/test-flv.flv class=videoTest flv video/a/p The jquery is simply: $(document).ready(function() { $('.video').media( { width: 320, height: 260, autoplay: false, flashvars: { skin: 'video/snel-skin.swf' } } ); $('.audio').media( { width: 320, height: 100, autoplay: false, flashvars: { skin: 'video/snel-skin.swf' } } ); }); Any ideas? Matthew
[jQuery] Re: jquery toggle class, I needed to switch class....
Hi, You're creating (or worse, overwriting) global variables 'remove' and 'add' there (because you haven't given the 'var' keyword, and thus are creating implicit globals[1]). The temporaries don't really buy you anything anyway, perhaps simply: jQuery.fn.switchClass = function(class1,class2) { if (this.hasClass(class1)) { this.removeClass(class1).addClass(class2); } else { this.removeClass(class2).addClass(class1); } }; [1] http://blog.niftysnippets.org/2008/03/horror-of-implicit-globals.html FWIW, -- T.J. Crowder tj / crowder software / com Independent Software Engineer, consulting services available On Mar 23, 1:33 pm, Artistan artis...@gmail.com wrote: /// /// Switch Between Classes /// /// jQuery.fn.switchClass = function(class1,class2) { if(this.hasClass(class1)){ remove = class1; add = class2; } else { remove = class2; add = class1; } this.removeClass(remove); this.addClass(add); }; Hope this helps someone out.
[jQuery] Click event is not captured by jQuery after the link to click is rendered by AJAX through jQuery
Hi, I wrote a jQuery code to display a link in the side bar (like the ones such as About this group shown in the right pane of this page) through AJAX. Then I want the click event on the link to be taken care of by jQuery. But that event is not captured by jQuery. How can I capture the event? The code looks something like this (class name etc. has been changed for the purpose of posting here): jQuery(document).ready( function($) { jQuery( .class-name-for-element-for-ajax ).click( function() { ... jQuery.get( jQuery(this).attr(href), { some_variable: some_value }, null, script ); return false; } jQuery( .class-name-for-link-in-right-pane ).click( function() { jQuery.get( jQuery(this).attr(href), null, null, script ); return false; } }); The element for the first click event above exists but the the one for the second doesn't exist when a page is first displayed. When the first element is clicked, as a result of AJAX call, the second element is displayed. Then when the second element is clicked, the second click event above is not captured by jQuery above. Thank you in advance. Tadatoshi
[jQuery] Malsup/Cycle errors
I am using the cycle jquery plug-in on a site. I discovered that the code that I was using (jquery.cycle.lite.js) won't support what I need to do but either the jquery.cycle.js or jquery.cycle.min.js plug-ins will. When I try to use them, I get javascript errors inside the cycle plug- ins. After a few trips to the cycle web page, I now get the Safari warning that the site may be infected with Malware... I wonder if my sudden bugs have anything to do with this!?!?!? In any case, I got around the problem by just commenting out the function in jquery.cycle.js that was causing the error... http://malsup.com/jquery/cycle/
[jQuery] How Easy To Implement RPC Between jQuery And PHP
Hi, I'm really new to JS, but really like how AJAX simplifies the user interface experience. Some friends have recommended a variety of JS Lib/Frameworks, and I eventually decided to pick jQuery after glancing through its documentation. Now I want to try it out together with PHP to implement remote procedures calls in order to interact with a database (namely, MySQL) for an application. So how easy is it to achieve this, are there any good built-in methods that simplifies this work? Thank you :) !oEL
[jQuery] $(#id).attr(ondblclick, New Value); is not work in all browser.
Hello, After load this page, double click is not work in IE 7.0, Firefox 3.0.7. But in Opera 9.64 is work. What wrong? Please advice. html head script src=jquery-1.3.2.js/script /head body div id=a1 ondblclick=alert('1'); style=width: 100px; height: 100px; background-color: #000; /div script $(document).ready( function() { $(#a1).attr(ondblclick, alert('2')); }); /script body /html
[jQuery] Re: jQuery 1.3.2 breaks tablesorter zebra, here's a fix
Thanks for this although this looked slightly different on mine and never had the .each loop $(tr:visible,table.tBodies[0]) .filter(':even') .removeClass(table.config.widgetZebra.css[1]).addClass (table.config.widgetZebra.css[0]) .end().filter(':odd') .removeClass(table.config.widgetZebra.css[0]).addClass (table.config.widgetZebra.css[1]); if(table.config.debug) { $.tablesorter.benchmark(Applying Zebra widget, time); } I changed it too: var tbodyfix = $(tr, table.tBodies[0]); if ($(tbodyfix).css(display) !== none $(tbodyfix).css (visibility) !== hidden) { $(tbodyfix) .filter(':even') .removeClass(table.config.widgetZebra.css[1]).addClass (table.config.widgetZebra.css[0]) .end().filter(':odd') .removeClass(table.config.widgetZebra.css[0]).addClass (table.config.widgetZebra.css[1]); if(table.config.debug) { $.tablesorter.benchmark(Applying Zebra widget, time); } } Seems to fix it and works fine. On Mar 9, 3:14 pm, MorningZ morni...@gmail.com wrote: So the new jQuery code for the filter :visible breaks the tablesorter's built in Zebra functionality... kind of a hacky fix, but at least it works with a minor change at the end if the tablesorter.js file is the addWidget code for zebra, change $(tr:visible, table.tBodies[0]).each(function(i) { // existing code inside this loop }); to $(tr, table.tBodies[0]).each(function(i) { if ($.css(this, display) !== none $.css(this, visibility) !== hidden) { // existing code inside this loop } }); so pretty much took the selector code from 1.3 and used that inside of :visible, not sure if that's the best fix ever, but it does make the widget act as it's supposed to
[jQuery] Tooltip: jQuery Tooltip affects doc height in IE7
I'm using the jQery Tooltip plugin with the bodyHandler function enabled, so that I write a bunch of DIVs to the page and then based on ID pull the content from those DIVs into the tooltip. Everything works fine in Firefox, but for some strange reason in IE7, whenever I mouseover a table cell to show the tooltip, the vertical scrollbar decreases in size, as if the height of the document changed. Since the tooltip is an absolutely positioned, z-indexed floating layer, I can't imagine how this would affect the document height, but damn IE is seeing it that way. Has anyone else experienced this problem? Thanks.
[jQuery] [autocomplete] How to activate autocomplete only after a certain character/string?
I have a domain textbox. I want to have an autocomplete only in the tld (top level domain/extension) part. Like: jquery [no autocomplete yet] jquery. [optional autocomplete] jquery.c .com .co.uk .cc .ac I want autocomplete only after the first dot. I know, it's easy just to separate the domain name and the tld into two, but this is not I want.
[jQuery] Re: $(#id).attr(ondblclick, New Value); is not work in all browser.
This is a horrible way to do what you're attempting. First, you should probably not be useing the inline events when you have jQuery readily accessible to you. Second, you should never, ever, ever, ever, ever write a callback using inline styling onclick handling. Third, you should really put all your scripting in the head of the document. Makes it easier for maintainability. html head title Test Page /title style type=text/css #a1 { width: 100px; height: 100px; background: #000 } /style script src=jquery-1.3.2.js type=text/javascript/script script type=text/javascript $(function(){ $('#a1').dblclick(function(){alert('2')}); }); /script /head body div id=a1/div /body /html dblclick( fn ) On Mar 23, 12:16 pm, Vitaliy Katochka vkatoc...@gmail.com wrote: Hello, After load this page, double click is not work in IE 7.0, Firefox 3.0.7. But in Opera 9.64 is work. What wrong? Please advice. html head script src=jquery-1.3.2.js/script /head body div id=a1 ondblclick=alert('1'); style=width: 100px; height: 100px; background-color: #000; /div script $(document).ready( function() { $(#a1).attr(ondblclick, alert('2')); }); /script body /html
[jQuery] Re: Click event is not captured by jQuery after the link to click is rendered by AJAX through jQuery
It's because jQuery operates on the elements which already exist. Lets say for instance: a href=load.html class=ajax-clickery/a div id=ajax-content/div Loads this page into div#ajax-content: a href=load-another.html class=ajax-clickery-two/a When you first render the page, you're grabbing anything that exists. So: jQ1 = jQuery('.ajax-clickery'); // .length = 1 jQ2 = jQuery('.ajax-clickery-two'); // .length = 0 -- No elements exist with this class! Once your ajax runs, the values of jQ1 and jQ2 are still the same. If, after your ajax runs, you perform the same function again: jQ1b = jQuery('.ajax-clickery'); // .length = 1 jQ2b = jQuery('.ajax-clickery-two'); // .length = 1 -- The element created by Ajax Now, an easy way to handle what you're doing here? === jQuery('.class-name-for-all-ajax-elements').live('click', function(){ var el = jQuery(this); jQuery.getScript( el.attr('href') ); }); Using the live click event, you'll be able to apply functionality to elements as they're added to the dom, through whatever means. This requires jquery1.3+ On Mar 23, 12:47 pm, tadatoshi tadatoshi.mailingl...@gmail.com wrote: Hi, I wrote a jQuery code to display a link in the side bar (like the ones such as About this group shown in the right pane of this page) through AJAX. Then I want the click event on the link to be taken care of by jQuery. But that event is not captured by jQuery. How can I capture the event? The code looks something like this (class name etc. has been changed for the purpose of posting here): jQuery(document).ready( function($) { jQuery( .class-name-for-element-for-ajax ).click( function() { ... jQuery.get( jQuery(this).attr(href), { some_variable: some_value }, null, script ); return false; } jQuery( .class-name-for-link-in-right-pane ).click( function() { jQuery.get( jQuery(this).attr(href), null, null, script ); return false; } }); The element for the first click event above exists but the the one for the second doesn't exist when a page is first displayed. When the first element is clicked, as a result of AJAX call, the second element is displayed. Then when the second element is clicked, the second click event above is not captured by jQuery above. Thank you in advance. Tadatoshi
[jQuery] Re: How Easy To Implement RPC Between jQuery And PHP
There are a few. The $.ajax methods will end up doing 90% of your work. I'll show you a pretty quick process demonstrating checking if an email address is registered. First, the PHP servlet page, check-email.php: ?php echo json_encode( array('success' = mysql_num_rows( mysql_query( 'SELECT * FROM `user_emails` WHERE `email` = '. $_REQUEST['email'] .' LIMIT 1' ) ) == 0 ? true : false) ); ? Now the HTML: labelEnter your desired eMail account name to check availability/ label input id=user-email type=text size=15/ span id=status style=display:none/span button id=submit value=Check NowCheck Now/button And finally the jQuery $(function(){ $('#submit').click(function(){ $.get('check-email.php', {email: $('#user-email').val()}, function(data){ var status = $('#status'); if (data.success) status.text('eMail is Available!').css ('color', 'green'); else status.text('eMail is NOT Available!').css('color', 'red'); }, 'json'); }); }); I hope that gave you kinda an idea of how you can use jQuery for RPCs. On Mar 23, 11:55 am, !oEL runzhou...@gmail.com wrote: Hi, I'm really new to JS, but really like how AJAX simplifies the user interface experience. Some friends have recommended a variety of JS Lib/Frameworks, and I eventually decided to pick jQuery after glancing through its documentation. Now I want to try it out together with PHP to implement remote procedures calls in order to interact with a database (namely, MySQL) for an application. So how easy is it to achieve this, are there any good built-in methods that simplifies this work? Thank you :) !oEL
[jQuery] Re: jquery toggle class, I needed to switch class....
Or: jQuery.fn.switchClass( a, b ){ var t = this.hasClass(a); this.addClass( t ? b : a ).removeClass( t ? a : b ); } On Mar 23, 12:35 pm, T.J. Crowder t...@crowdersoftware.com wrote: Hi, You're creating (or worse, overwriting) global variables 'remove' and 'add' there (because you haven't given the 'var' keyword, and thus are creating implicit globals[1]). The temporaries don't really buy you anything anyway, perhaps simply: jQuery.fn.switchClass = function(class1,class2) { if (this.hasClass(class1)) { this.removeClass(class1).addClass(class2); } else { this.removeClass(class2).addClass(class1); } }; [1]http://blog.niftysnippets.org/2008/03/horror-of-implicit-globals.html FWIW, -- T.J. Crowder tj / crowder software / com Independent Software Engineer, consulting services available On Mar 23, 1:33 pm, Artistan artis...@gmail.com wrote: /// /// Switch Between Classes /// /// jQuery.fn.switchClass = function(class1,class2) { if(this.hasClass(class1)){ remove = class1; add = class2; } else { remove = class2; add = class1; } this.removeClass(remove); this.addClass(add); }; Hope this helps someone out.
[jQuery] Re: Cycle breaks in IE7 when using list box
Bump? Sorry if I'm coming across as dense and/or lazy here. A short example of what you're talking about would be great. On Mar 20, 1:36 pm, christopherious christopheri...@gmail.com wrote: Thanks! I'm not sure I'm quite getting it. Would you mind providing an example? On Mar 20, 12:16 pm, Mike Alsup mal...@gmail.com wrote: document.write('strongPick a section:\/strongnbsp;selectoption id=goto1 value=Section 1Section 1\/optionoption id=goto2 value=Section 2Section 2\/optionoption id=goto3 value=Section 3Section 3\/option\/select'); document.close(); /script You should be binding the 'change' event on the select, not the 'click' event on the option.
[jQuery] Cannot call a function within the callback in IE7 [2]
Hi, I make Ajax ($.get) calls and in the calback part I call a function defined elsewhere. In FireFox this is no problem. When I checked in IE however I kept getting an error 'object expected'. It took a while to figure out that if I remove the _call_ to the function with the actual function body (the code defined in the function handler) the problem disappeared and IE does not complain.. So instead of this: $(document).ready(function(){ $('#login').click(function(){ $.get( /?event=cms.showlogin, function(res){ removeLoginWindow(); addStyleSheet('/cms/css/cms.css') $(document.body).append(res); $('#closeButton').click(function() {removeLoginWindow()}) $('#closeButton').css('cursor','pointer') $('.loginWindow').draggable() $(#loginWindow input:text[name='username']) [0].focus() }, html ) showLoginWindow() }); }) I need top switch the calls to removeLoginWindow() and addStyleSheet ('/ cms/css/cms.css') with the actual code of these functions. Is there no workaround for this or am I doing somehting wrong? jquery-1.3.2.min.js IE 7.0 FF 3.07 Win XP sp2 Thanks, Marc
[jQuery] Wouldn't inArray() be more intuitive if called arrayPosition()?
I was about to use inArray (http://docs.jquery.com/Utilities/ jQuery.inArray) to determine if an element was in an array or not, but I realized I can't use it as a true/false response since it returns the position (and could return 0 if the element was found in position 0 - returns -1 if not found). I was expecting something with the same functionality as the PHP function in_array (http://us3.php.net/ in_array) I know it's a minor point but wouldn't it be more intuitive if called arrayPosition? with a name like that I'd expect the functionality it has now.
[jQuery] Re: IE6 how can I parse custom XML?
Read this post for some info: http://groups.google.com/group/jquery-en/browse_thread/thread/5e21b53b2f0b5a6c/b851d74ced744a19 It refers to XML that comes through AJAX so I don't know if it applies to your situation, but the references might be of help. On Mar 21, 8:59 am, Alexander Lyabah alexan...@lyabah.com wrote: It's works on FF, but not in IE6. Final task - it's just full parse of XML. But this example already don;t work in IE6. $('#tt').val('') p = $('nnc1 h /h //c1c1 /c1 //nn') trace(p.children().length) in archive of this group i can't find answers. How I can fix this? Or maybe JQuery have some plugin for this?
[jQuery] Re: Wouldn't inArray() be more intuitive if called arrayPosition()?
just can't say if ($.inArray(value, array) -1) { // found in array? } On Mar 23, 2:59 pm, Mike521 mi...@favorfavor.com wrote: I was about to use inArray (http://docs.jquery.com/Utilities/ jQuery.inArray) to determine if an element was in an array or not, but I realized I can't use it as a true/false response since it returns the position (and could return 0 if the element was found in position 0 - returns -1 if not found). I was expecting something with the same functionality as the PHP function in_array (http://us3.php.net/ in_array) I know it's a minor point but wouldn't it be more intuitive if called arrayPosition? with a name like that I'd expect the functionality it has now.
[jQuery] Problem concerning form with jquery
Hi, I have a problem i can't find a solution to, and as you can guess it's annoying me :) Here is my code : index.html !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http:// www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd html xmlns=http://www.w3.org/1999/xhtml; head meta http-equiv=Content-Type content=text/html; charset=UTF-8 / titleFormulaire de commande dynamique/title link rel=stylesheet type=text/css href=style.css / script src=http://www.google.com/jsapi; type=text/javascript/ script script type=text/javascriptgoogle.load(jquery, 1.2.6);/ script script type=text/javascript src=js/order.js/script /head body h1Formulaire d'exemple/h1 table id=order-table tr thNom du produit/th thQuantité/th th/th thPrix unitaire/th th/th th style=text-align: right;Total/th /tr /table div style=text-align: right; spanstrongTOTAL : /strong/span input type=text class=total-box id=order-total disabled=disabled/input br / form action=# method=post input type=submit value=Submit Order class=submit / /form /div script type=text/javascript src=js/lineadd.js/script img src='test.jpg' onclick=ajouterligne(); /body /html lineadd.js var nbligne = 0; function nouvelleligne(nbligne) { if(nbligne % 2 == 0) { return 'tr class=odd\n' + 'td class=product-titleExemple de produit dont le nom est emProduit ' + nbligne + '/em/td\n' + 'td class=num-palletsinput type=text class=num-pallets- input id=/input/td\n' + 'td class=timesX/td\n' + 'td class=price-per-pallet$span540/span/td\n' + 'td class=equals=/td\n' + 'td class=row-totalinput type=text class=row-total- input id= disabled=disabled/input/td\n' + '/tr\n'; } else { return 'tr class=even\n' + 'td class=product-titleExemple de produit dont le nom est emProduit ' + nbligne + '/td\n' + 'td class=num-palletsinput type=text class=num-pallets- input id=/input/td\n' + 'td class=timesX/td\n' + 'td class=price-per-pallet$span540/span/td\n' + 'td class=equals=/td\n' + 'td class=row-totalinput type=text class=row-total- input id= disabled=disabled/input/td\n' + '/tr\n'; } } ajouterligne(); function ajouterligne() { nbligne ++; var nouvelle_ligne = nouvelleligne(nbligne); $(nouvelle_ligne).appendTo(#order-table); } ### order.js function IsNumeric(sText) { var ValidChars = 0123456789.; var IsNumber=true; var Char; for (i = 0; i sText.length IsNumber == true; i++) { Char = sText.charAt(i); if (ValidChars.indexOf(Char) == -1) { IsNumber = false; } } return IsNumber; }; function calcOrderTotal() { var prodSubTotal = 0; $(.row-total-input).each(function() { var valString = $(this).val() || 0; prodSubTotal += parseInt(valString); }); var orderTotal = 0; var orderTotalNice = prodSubTotal + €; $(#order-total).val(orderTotalNice); }; $(function() { $('.num-pallets-input').blur(function() { var $this = $(this); var numPallets = $this.val(); var multiplier = $this .parent().parent() .find(td.price-per-pallet span) .text(); if ( (IsNumeric(numPallets)) (numPallets != '') ) { var rowTotal = numPallets * multiplier; $this .css(background-color, white) .parent().parent() .find(td.row-total input) .val(rowTotal); } else { $this .css(background-color, #ffdcdc) .parent().parent() .find(td.row-total input) .val(0); }; calcOrderTotal(); }); }); My problem is that the line firstly added when page loads works great, inputs are updated when they have to, but all the lines i add using the image with the onclick statement don't at all. Both way use the same function... Did i miss something ? Thanks
[jQuery] remote validation
Hello: I'm using the validation plugin on my site to make remote validations, and it is working graet! But, I note that the ajax call is made allways. I think that that call only has to be done when the input value has changed. Has no sense to validate a value which has not changed. It is posible to specify into the rule's options that only validate if the value has changed? My code: $('#number').rules('add',{ remote: { url: /api/validate/number/, data: { val: $('#number').val()} }})
[jQuery] Re: tablesorter - Force Null / Empty Cells to the Bottom?
On Mar 13, 5:52 am, MorningZ morni...@gmail.com wrote: A custom parser would *definitely* handle this I don't think a custom parser can always force null data to the bottom. The custom parsers just normalize cell contents into numeric or text format and that result is then sent on to the sorting routine. This means that if you use a custom parser to set a null data (or * or n/a) to be treated as z (text) or (numeric) then those cells will be pushed to the bottom for ASCENDING sorts. But when a user clicks the th header again for DESCENDING sorts, then those cells with null data will be on top. I think the point of the original question was that when there is no data in a cell, that cell is irrelevant/useless to any sorting, and therefore should ALWAYS be pushed to the bottom of the column. The only way to do that at this stage is to patch jquery.tablesorter.js in 3 places (assuming that cells with only '-' are the null ones): ts.addParser({ id: /* choose an existing numeric parser to edit, or create a new one **/ format: function(s) { + if(s == '-') return 0.000; // flags this float for sortNumeric() as string type, while type juggling will treat as zero function sortNumeric(a,b) { + if(a === '0.000') return 1; // tests for string type set by numeric Parser, means this cell has the '-' + else if(b === '0.000') return -1; // force cells with just - always to bottom return a-b; function sortText(a,b) { + if(a == '-') return 1; + else if(b == '-') return -1; // force cells with just - always to bottom return ((a b) ? -1 : ((a b) ? 1 : 0)); It is a bad hack, but is the best I can do to always force empty cells or cells with no data to the bottom of the sorted column.
[jQuery] Form Plugin + FCKEditor + UI Dialog Button
I downloaded the fckeditor jquery plugin because i was told it would resolve issues with submitting forms via Form Plugin ajaxSubmit. But everytime I do it, my form won't submit anymore... My dialog button appears to be unbound but it's not because i can do a console.log(''); and it shows me but the ajaxSubmit won't go anymore... very weird. I'm using latest jquery 1.3.2 and latest jquery UI
[jQuery] Can't resolve Superfish issue.
Hello, I want to add a dropdown navigation bar in my site: http://strategicventurefund.com I added the module superfish and select the menu style as nav-bar. But I can't find any menu item nor there is any drop down occurs. Can anyone help me by giving me step-by-step instruction to use Superfish menu? Thanks in advance. Prasun
[jQuery] Cycle plugin Issue in Safari and Chrome browser
i'm working on this site http://mojoe.net/ContractService/cleaning.html and cycle works fine in everything except safari. safari doesn't recognize my cycle div's height (on this page the div is .photo) the same thing happens on the home page, too. chrome has the same problems when you first visit the page, but fixes itself when you leave the page and come back. anyone know what's going on?!?!
[jQuery] Validate plugin not working
I have been trying all day to get the latest validate plugin to work with the latest jquery. It works when I specify the keywords in the class name, but when I try writing the code only in javascript {rules: {}} nothing happens, no error no nothing just nothing. This is doing my nut. The example below I made, should work according to the docs,but it doesn't. html head titlejQuery Validation test/title script type=text/javascript src=js/jquery-1.3.2.min.js/script script type=text/javascript src=js/jquery-validate/ jquery.validate.js/script script type=text/javascript $(document).ready(function(){ $(#myForm).validate({ rules : { required : true } }); }); /script /head body form id=myForm input type=text id=name class=required / input type=submit / /form /body /html
[jQuery] data is posted only once
Hi There I got some elements here. a href=# id=p_12 class=pager/a a href=# id=p_13 class=pager/a jquery: $(function() { $('a.pager').click(function() { var currentpage = $(this).attr('id'); $.ajax({ url: 'php/pager.php', type: 'POST', data: 'currentpage=' + currentpage, success: function(result) { $('div.response').remove(); $('div#pContent').append('div class=response' + result + '/ p'); $('div#loading').fadeOut(500, function() { $(this).remove(); var currentpage = null; }); } }); return false; }); }); At the first click it's posting the date fine but if I click once more then its doing nothing. I dont know why isnt it sending the data again. Can somebody help me what did I screw up? thanks in advance appreciated
[jQuery] having some trouble, Safari, Ajax, iframe
So after a lot of debugging Im still having trouble with something that seems rather easy. And it works in all browsers but Safari. http://pastie.org/423822 is the code. This code is actually being pulled in from an iframe. Once you hit the upload button, it makes calls to get the upload progress and then returns that to the progressbar. If i put my own number on line 25 like 30, it works and the progress bar jumps to 30, I dont believe it is a progress bar issue. Since i never actually submit the form(the return false on line 9) the upload was never submitted, so returning isnt what I want to do. However if I comment line 9 out. It works flawlessly in all browsers except Safari. Trhough my process of debugging, it appears my Ajax GET call never actually happens, and if i goto my progress indicator, I can see the numbers going up. So, im not entirely sure what the problem is, I am stumped.
[jQuery] Validate plugin not working
Sorry I couldn't wait for my other post to showup, so I made a typo: html head titlejQuery Validation test/title script type=text/javascript src=js/jquery-1.3.2.min.js/script script type=text/javascript src=js/jquery-validate/ jquery.validate.js/script script type=text/javascript $(document).ready(function(){ $(#poesForm).validate({ rules : { name: { required : true } } }); }); /script /head body form id=poesForm input type=text id=name class=required / input type=submit / /form /body /html
[jQuery] Re: tablesorter - Force Null / Empty Cells to the Bottom?
On Mar 13, 5:52 am, MorningZ morni...@gmail.com wrote: A custom parser would *definitely* handle this On Mar 13, 5:52 am, MorningZ morni...@gmail.com wrote: A custom parser would *definitely* handle this I don't think a custom parser can always force null data to the bottom. The custom parsers just normalize cell contents into numeric or text format and that result is then sent on to the sorting routine. This means that if you use a custom parser to set a null data (or * or n/a) to be treated as z (text) or (numeric) then those cells will be pushed to the bottom for ASCENDING sorts. But when a user clicks the th header again for DESCENDING sorts, then those cells with null data will be on top. I think the point of the original question was that when there is no data in a cell, that cell is irrelevant/useless to any sorting, and therefore should ALWAYS be pushed to the bottom of the column. The only way to do that at this stage is to patch jquery.tablesorter.js in 3 places (assuming that cells with only '-' are the null ones): ts.addParser({ id: /* choose an existing numeric parser to edit, or create a new one **/ format: function(s) { + if(s == '-') return 0.000; // flags this float for sortNumeric() as string type, while type juggling will treat as zero function sortNumeric(a,b) { + if(a === '0.000') return 1; // tests for string type set by numeric Parser, means this cell has the '-' + else if(b === '0.000') return -1; // force cells with just - always to bottom return a-b; function sortText(a,b) { + if(a == '-') return 1; + else if(b == '-') return -1; // force cells with just - always to bottom return ((a b) ? -1 : ((a b) ? 1 : 0)); It is a bad hack, but is the best I can do to always force empty cells or cells with no data to the bottom of the sorted column.
[jQuery] Re: Wouldn't inArray() be more intuitive if called arrayPosition()?
I'm not discussing whether I can or can't use it the way it is, I'm discussing which way is more intuitive. On Mar 23, 3:18 pm, MorningZ morni...@gmail.com wrote: just can't say if ($.inArray(value, array) -1) { // found in array? } On Mar 23, 2:59 pm, Mike521 mi...@favorfavor.com wrote: I was about to use inArray (http://docs.jquery.com/Utilities/ jQuery.inArray) to determine if an element was in an array or not, but I realized I can't use it as a true/false response since it returns the position (and could return 0 if the element was found in position 0 - returns -1 if not found). I was expecting something with the same functionality as the PHP function in_array (http://us3.php.net/ in_array) I know it's a minor point but wouldn't it be more intuitive if called arrayPosition? with a name like that I'd expect the functionality it has now.
[jQuery] Re: remote validation
On 23 mar, 16:10, MartinBorthiry martin.borth...@gmail.com wrote: Hello: I'm using the validation plugin on my site to make remote validations, and it is working graet! But, I note that the ajax call is made allways. I think that that call only has to be done when the input value has changed. Has no sense to validate a value which has not changed. It is posible to specify into the rule's options that only validate if the value has changed? My code: $('#number').rules('add',{ remote: { url: /api/validate/number/, data: { val: $('#number').val()} }}) Well, the problem was not that validation plugin always made a remote call. The first time of input focus-out event is called, the previous value is null. So, I could solve it patching this line : previousValue: function(element) { return $.data(element, previousValue) || $.data(element, previousValue, previous = { // BEFORE old:null, //CHANGED: por martin old: $(element).val(), // valid: true, message: this.defaultMessage( element, remote ) }); } Now it work ok. Martin.
[jQuery] Re: tablesorter - Force Null / Empty Cells to the Bottom?
I don't think a custom parser can always force null data to the bottom. Maybe it's outside your skill level, but it is *definitely* do-able without touching one single character of code inside tablesorter.js you were on the right track with the .addParser method but there's no need to edit it inside the core code On Mar 23, 3:28 pm, Ptang al...@modwest.com wrote: On Mar 13, 5:52 am, MorningZ morni...@gmail.com wrote: A custom parser would *definitely* handle this I don't think a custom parser can always force null data to the bottom. The custom parsers just normalize cell contents into numeric or text format and that result is then sent on to the sorting routine. This means that if you use a custom parser to set a null data (or * or n/a) to be treated as z (text) or (numeric) then those cells will be pushed to the bottom for ASCENDING sorts. But when a user clicks the th header again for DESCENDING sorts, then those cells with null data will be on top. I think the point of the original question was that when there is no data in a cell, that cell is irrelevant/useless to any sorting, and therefore should ALWAYS be pushed to the bottom of the column. The only way to do that at this stage is to patch jquery.tablesorter.js in 3 places (assuming that cells with only '-' are the null ones): ts.addParser({ id: /* choose an existing numeric parser to edit, or create a new one **/ format: function(s) { + if(s == '-') return 0.000; // flags this float for sortNumeric() as string type, while type juggling will treat as zero function sortNumeric(a,b) { + if(a === '0.000') return 1; // tests for string type set by numeric Parser, means this cell has the '-' + else if(b === '0.000') return -1; // force cells with just - always to bottom return a-b; function sortText(a,b) { + if(a == '-') return 1; + else if(b == '-') return -1; // force cells with just - always to bottom return ((a b) ? -1 : ((a b) ? 1 : 0)); It is a bad hack, but is the best I can do to always force empty cells or cells with no data to the bottom of the sorted column.
[jQuery] Re: Wouldn't inArray() be more intuitive if called arrayPosition()?
Honestly, inArray and arrayPosition are equally intuitive to me. If the value has a position in the array, then it is, by definition, in the array. inArray returning the array position is a similar check, but with a more robust ouput. Again, as MorningZ said, you can simply check it's value using a simple gt operator. I honestly don't care too much about inArray returning a non-boolean value which may be unintuitive to some users. After all, the docs are there for a reason. On Mar 23, 3:51 pm, Mike521 mi...@favorfavor.com wrote: I'm not discussing whether I can or can't use it the way it is, I'm discussing which way is more intuitive. On Mar 23, 3:18 pm, MorningZ morni...@gmail.com wrote: just can't say if ($.inArray(value, array) -1) { // found in array? } On Mar 23, 2:59 pm, Mike521 mi...@favorfavor.com wrote: I was about to use inArray (http://docs.jquery.com/Utilities/ jQuery.inArray) to determine if an element was in an array or not, but I realized I can't use it as a true/false response since it returns the position (and could return 0 if the element was found in position 0 - returns -1 if not found). I was expecting something with the same functionality as the PHP function in_array (http://us3.php.net/ in_array) I know it's a minor point but wouldn't it be more intuitive if called arrayPosition? with a name like that I'd expect the functionality it has now.
[jQuery] Re: Regex Help for CSS Selector type deal
Thanks a bunch, Karl. :) On Mar 20, 8:39 pm, Karl Swedberg k...@englishrules.com wrote: Hi Eric, These should work: var classes = 'your .string'.match(/\.[a-zA-Z_-]+/g); var ids = 'your #string'.match(/#[a-zA-Z_-]+/g); var idsAndClasses = '#your .string'.match(/(\.|#)[a-zA-Z_-]+/g); --Karl Karl Swedbergwww.englishrules.comwww.learningjquery.com On Mar 20, 2009, at 11:32 AM, Eric Garside wrote: I need to come up with a regex, or find some way to leverage Sizzle (which I'm not familiar with) to do a pretty simple task. Given strings like: div#some-complex-id.myClass.ui-state-disabled or p.myClass#someId.otherClass or p .myClass .otherClass .ui-state-disabled #myId I'd like, through one or two regex arguments (ideally, one which return me classes, one which will return an ID), arrays containing the classes/id in the string. I hope I'm that was clear. It seems like it'd be simple for someone who knew what they were doing with regex. Sadly, I do not. :\
[jQuery] Re: Wouldn't inArray() be more intuitive if called arrayPosition()?
Yeah, like what he is suggesting is to return a boolean value so now if someone wants the position of the item, it would be a whole separate function to do so to me, one single function and checking the value is more intuitive, maybe if it was named something more inline with what it returns (like for instance, indexOf) makes more sense, but none the less the function kills two birds with one stone On Mar 23, 4:19 pm, Eric Garside gars...@gmail.com wrote: Honestly, inArray and arrayPosition are equally intuitive to me. If the value has a position in the array, then it is, by definition, in the array. inArray returning the array position is a similar check, but with a more robust ouput. Again, as MorningZ said, you can simply check it's value using a simple gt operator. I honestly don't care too much about inArray returning a non-boolean value which may be unintuitive to some users. After all, the docs are there for a reason. On Mar 23, 3:51 pm, Mike521 mi...@favorfavor.com wrote: I'm not discussing whether I can or can't use it the way it is, I'm discussing which way is more intuitive. On Mar 23, 3:18 pm, MorningZ morni...@gmail.com wrote: just can't say if ($.inArray(value, array) -1) { // found in array? } On Mar 23, 2:59 pm, Mike521 mi...@favorfavor.com wrote: I was about to use inArray (http://docs.jquery.com/Utilities/ jQuery.inArray) to determine if an element was in an array or not, but I realized I can't use it as a true/false response since it returns the position (and could return 0 if the element was found in position 0 - returns -1 if not found). I was expecting something with the same functionality as the PHP function in_array (http://us3.php.net/ in_array) I know it's a minor point but wouldn't it be more intuitive if called arrayPosition? with a name like that I'd expect the functionality it has now.
[jQuery] Error on prepend in IE7
Hey all. I'm using jQuery with flexigrid and when the table displayes in IE7, I get a JS error. Here is the JS error and block of code it references. unexpected call to method or property access prepend: function() { return this.domManip(arguments, true, function(elem){ if (this.nodeType == 1) this.insertBefore( elem, this.firstChild ); }); }, At first I thought it might be having additional tags inside the table cell data but I removed all the tags and I still get this error. Any ideas?