[jQuery] Re: absolute position inside inline element (opera)
nobody knows anything about this weird behavior in opera? On 4 mrt, 20:31, Rick [EMAIL PROTECTED] wrote: try this: -start opera -go tohttp://www.meerbox.nl/corner/example2.html -go to the bottom of the page -hit F5 -now just press enter after clicking on the url bar weird :s
[jQuery] Re: missing ( before formal parameters
change(function{$(#town). change(function(){$(#town). missing ( before formal parameters $(#postcode).change(function{$(#town).val(zipToCityHash.$(#postcode).val()...
[jQuery] Re: missing ( before formal parameters
missing ( before formal parameters $(#postcode).change(function{$(#town).val(zipToCityHash.$(#postcode).val()... Also, I see what you're trying to do there, but you can't access object properties like that. You probably want something like: $(#postcode).change(function() { $(#town).val(zipToCityHash[$(#postcode).val()]); }); Plus, you don't need to select #postcode again. You can access it with 'this' in the event handler: $(#postcode).change(function() { $(#town).val(zipToCityHash[this.value]); }); And, if the user enters a zip that isn't in your hash, val() will get passed undefined, which does the same thing as calling val() with no arguments: it returns the current value without changing it. So if you want to change or clear town if the user enters a zip that isn't in your hash, you could do something like: $(#postcode).change(function() { if(zipToCityHash[this.value]) { $(#town).val(zipToCityHash[this.value]); } else { $(#town).val(); // clear town, or whatever you want to do in this case } }); Hope it helps. --Erik
[jQuery] Re: jQuery.Plugin, first release.
Hi Ariel, a quick question: did you consider instead to use the selector method in order to line in the plugins to be lazy loaded? for instance: script class=lazy src=_js/jquery_plugins/jquery.metadata.1.0/jquery.metadata.js type=text/javascript/script script class=lazy src=_js/jquery_plugins/livequery/1.0.2/jquery.livequery.min.js type=text/javascript/script script class=lazy src=_js/jquery_plugins/jScrollPane/mousewheel.js type=text/javascript/script script class=lazy src=_js/jquery_plugins/hoverIntent/jquery.hoverIntent.minified.js type=text/javascript/script script class=lazy src=_js/jquery_plugins/color/jquery.color.js type=text/javascript/script script class=lazy src=_js/jquery_plugins/jScrollPane/jScrollPane.js type=text/javascript/script script class=lazy src=_js/jquery_plugins/jcarousel/jquery.jcarousel.pack.js type=text/javascript/script and then $('head script.lazy').lazyLoad(options) ? i have no idea whether this is feasible or not, i'm just a UI designer :) , but if it could work like that, then i'd certainly use it. On Wed, Mar 5, 2008 at 5:08 AM, Ariel Flesler [EMAIL PROTECTED] wrote: I added a paste with an example, to show the syntax, I promise a real demo soon :) Link: http://flesler.pastebin.com/f3e105964 Ariel Flesler On 5 mar, 00:44, Ariel Flesler [EMAIL PROTECTED] wrote: Hi, First release of jQuery.Plugin, that's the name, it is used to lazy load plugins. The file is only fetched with the first call to the plugin. It's still a bit untested (I'd love some help). I have a small them that I used for my own testing, but it's not good enough to expose, so no demo for now. So.. it's not a demo what I'm asking to be tried, but the code in a real case. If you don't want or don't know how to help/test. You can just give me your opinion on the idea, and maybe something you'd like it to do. Project Page:http://plugins.jquery.com/project/Plugin Cheers Ariel Flesler -- Alexandre Plennevaux LAb[au] http://www.lab-au.com
[jQuery] Re: passing form data to $.ajax
On 4 Mar, 12:58, Mike Alsup [EMAIL PROTECTED] wrote: You cannot upload files with ajax. Use the form plugin for that functionality. thank you :)
[jQuery] Re: jQuery.Plugin, first release.
Hi, i have no idea whether this is feasible or not, i'm just a UI designer No, it isn't. The browser doesn't know what you mean by class=lazy. As soon as the browser reads a script tag it will begin to load the script, no matter what classname you gave it. There is no way to stop him. Christof
[jQuery] Re: Can't get started on Getting Started :)
This might help: http://jquery.open2space.com/node/8 Also the rest of the howto's there may be of use for those just starting out. Remember to change all file references to match the path and filenames on your system... :) Shawn kenny wrote: Disclaimer: Complete jQuery/JavaScript noob here, but heavily experienced developer overall. (And I have been googling around finding similar questions, but nothing from those exchanges can get this basic hello-world example working.) Platform: FireFox 2.0.0.12 on Windows XP Here is what I had after the first suggested enhancement, namely adding an alert on a click: pre html head script type=text/javascript src=jquery.js/script script type=text/ javascript $(document).ready(function() { $(a).click(function() { alert(Hello world!); }); }); /script / head body --- we will add our HTML content here -- / body /html /pre My first question is about the comment in the instructions that says: This should show the alert as soon as you click on the link.. I do not see any link. No big deal, I added one. My next question is simply that once I do add a link: pre html head script type=text/javascript src=jquery.js/script script type=text/ javascript $(document).ready(function() { $(a).click(function() { alert(Hello world!); }); }); /script / head body --- we will add our HTML content here -- a href=nowhere/a / body /html /pre ... I still do not get an alert. I do get an alert if I add the suggested alternative: pre a href= onclick=alert('Hello world')Link/a /pre ...and then click on the link, so that much is working. I ended up on this tutorial after experiencing the same thing on the How jQuery Works tutorial, by the way. Any help appreciated.
[jQuery] Re: jQuery.Plugin, first release.
Hi, First release of jQuery.Plugin, that's the name, it is used to lazy load plugins. The file is only fetched with the first call to the plugin. 1. Why not use existing and tested code like e.g. jsPax (jspax.org) or jsan? 2. Can your code resolve dependencies? 3. Does it work with Browsers that have strange Problems - e.g. there are some Safari Versions that don't evaluate script tags added via DOM after the page has been loaded? 4. Do the plugins need to support your plugin somehow - if not, you probably are not able to resolve dependencies? 5. What happens if a plugin with the same URL is registered twice with different names? Will it be requested twice - the browser cache should resolve that of course, but some browsers are realy bad at that? Reading through your example I came to the oppinion that the user of your plugin needs to write quite some code to get things done. Maybe I have misinterpreted your example, but as much as I can see a similar effect can be achived with a lot less code using e.g. jsPax. Christof
[jQuery] cluetip question
I'd like to set a default style for cluetips in my project. Since I'm abstracting cluetip for my fellow programmers by wrapping it in PHP, I don't like to add cluetipClass: 'jtip' to every call. Can I do something like: $.cluetip.setup({ cluetipClass: 'jtip' }); $(a.cluetip).cluetip(); $(a.cluetip2).cluetip({ some:other_option }); I tried, but it doesn't work like this now. A global style would be a major improvement I think, you shouldn't have to set the style for every cluetip.
[jQuery] Re: jQuery.Plugin, first release.
what if you comment out your script tags ? i'm probably pulling hairs here. On Wed, Mar 5, 2008 at 10:48 AM, Christof Donat [EMAIL PROTECTED] wrote: Hi, i have no idea whether this is feasible or not, i'm just a UI designer No, it isn't. The browser doesn't know what you mean by class=lazy. As soon as the browser reads a script tag it will begin to load the script, no matter what classname you gave it. There is no way to stop him. Christof -- Alexandre Plennevaux LAb[au] http://www.lab-au.com
[jQuery] Re: cluetip question
On Wed, Mar 5, 2008 at 11:09 AM, Dylan Verheul [EMAIL PROTECTED] wrote: I'd like to set a default style for cluetips in my project. Quick update: I solved it by changing the CSS -- nothing wrong with that since I don't need the other styles. For people that do, my original question may still be valid. Venturing into cluetipe (great stuff), I came across the following. When you want to use both local and Ajax data, you are required to do separate calls. The plugin could be smart enought to handle this. - if there's a rel attribute, use ajax, else go for title attribute - if the title attribute contains splitters, split it - if the first char of the title attribute is a splitter char, hide the title This would make me think of (and make me code) much less calls. Dylan
[jQuery] Re: jQuery.Plugin, first release.
Hi, what if you comment out your script tags ? i'm probably pulling hairs here. Then you don't have the script tags in the DOM. You would need to write your own parser then to parse the content of the coments - not a too simple task. Of course you also can not use the existing jQuery functions then, because your objects are not part of the DOM. You could think of leaving out the src tag and transport the url somhow else. e.g.: script class=lazy url:asdf/jkl/test.js/script But that is much less cool of course. Christof
[jQuery] Re: jQuery.Plugin, first release.
Christof, thanks for bearing with my silly questions and the clear explanations ! On Wed, Mar 5, 2008 at 12:14 PM, Christof Donat [EMAIL PROTECTED] wrote: Hi, what if you comment out your script tags ? i'm probably pulling hairs here. Then you don't have the script tags in the DOM. You would need to write your own parser then to parse the content of the coments - not a too simple task. Of course you also can not use the existing jQuery functions then, because your objects are not part of the DOM. You could think of leaving out the src tag and transport the url somhow else. e.g.: script class=lazy url:asdf/jkl/test.js/script But that is much less cool of course. Christof -- Alexandre Plennevaux LAb[au] http://www.lab-au.com
[jQuery] extend
Hello. I would like to know if it's possible to extend jQuery like that : // Init os $.os = $.os || {}; $.extend($.os, { version : 'foo', event : function(event){ return event.xxx; } core: false }); // Play with os console.log( 'os: ' + $.os.version ); I'm unabble to add some functions to the $.os object and get 'this' element : // Extend os $.extend($.os, { fix : function(){ this.html( 'os on: ' + this.tagName ); } }); I would like to call it like that : $('body').os.fix() $.os.event() Does anybody know what to do ? I really need something like that to make my code simple to understand. Thanks
[jQuery] Multiple Selector Iterator short-cut
Is there a way to reduce this $(#id1, #id2, #id3, #id4, #id5, #id6, #id7, #id8, #id9, #id10).click(function() { ... }); to something like this $(#id[1-10]).click(function() { ... }); ?
[jQuery] Re: Plugin Authoring Help pt 2
By the way, you'll have trouble if you use defaults like this: $.fn.myPlugin1 = function(options) { var myOptions = $.extend(defaults, options); since that will actually extend the defaults object and your defaults will be changed whatever was in options for the next time you use the plugin. Try $.fn.myPlugin1 = function(options) { var myOptions = $.extend( {}, defaults, options); which creates a new object to accumulate the options. Danny On Mar 4, 2:13 pm, Mike Alsup [EMAIL PROTECTED] wrote: If you want to use two different functions in the chain then you need to define two plugin functions: // wrap it all in a closure so you can share private data easily (function() { $.fn.myPlugin1 = function(options) { var myOptions = $.extend(defaults, options); // do stuff }; $.fn.myPlugin2 = function(options) { var myOptions = $.extend(defaults, options); // do stuff }; var defaults = { def1: 'default1', def2: 'default2', ... defx: 'defaultx' }; })(); On Tue, Mar 4, 2008 at 2:09 PM, Leanan [EMAIL PROTECTED] wrote: Ok, I'm really trying to wrap my head around this, and it's irritating me. I've checked out the following pages: http://docs.jquery.com/Plugins/Authoring http://www.learningjquery.com/2007/10/a-plugin-development-pattern And they help some but there's one problem I'm running into. I have: $.fn.myPlugin = function(options) { $.myPlugin.defaults = $.extend($.myPlugin.defaults, options); return(this); }; $.myPlugin = { defaults: { def1: 'default1', def2: 'default2', ... defx: 'defaultx' }, myFunc: function() { var options = $.myPlugin.defaults; //do something here, anything really }, myFunc2: function() { var options = $.myPlugin.defaults; //do something here, again, anything } }; Now, I want to do something like this: jQuery().myPlugin({def1: 'other_def1', def2: 'other_def2'}).myFunc(); Can I? Because it's not working. It tells me that jQuery().myPlugin({def1: 'other_def1', def2: 'other_def2'}) is not a function. However, if I change it so that myFunc is $.fn.myFunc = function() { }, then I can, but I have to do it as: jQuery().myPlugin({def1: 'other_def1', def2: 'other_def2'}).myPlugin.myFunc(); Which I don't like. None of the tutorials or documentation I can find is clear on this point, though they do refer to the functions in $.myPlugin as being user-accessable... and they are, but only if I do $.myPlugin.myFunc. I can't chain. And I want to be able to do that.
[jQuery] Re: jQuery.Plugin, first release.
Hi all Thanks for your comments, a little tough but that's cool and positive. I checked jspax. It's a regular package manager like any of those out there (no offense meant). Well, this is different: 1- First of all, do you frequently use jspax for your jQuery plugins ? no one said this plugin is the first of its kind. 2- jspax requires you to organize it all in packages, and require them when the moment comes. It also requires to structure your code with callbacks. When you summon a package, you need to pass in a callback. I tried that some time ago, it's not that easy and makes the code kinda weird. This plugin requires you to register for the plugins, the namespaces they take. You need to specify what functions it adds to $ and $.fn. With this plugin, you can(in most) cases, just register them, and the rest remains the same. You code the way you would do, assuming the plugin is loaded. The first call to a function of the plugin, will actually load it, all the calls made while loading (plus the initial one) will be taken into account. In short: there is no require here. @Alexandre The script idea is smart, but won't work, you need to tell the plugin which names are needed. Maybe using metadata... @Christof (cool name) 2-The code can resolve dependencies, that's the option require which is an array of ids of plugins required, that is all explained in the project page. 3-It should work with all the browsers jQuery claims to fully support. No new technique is used here to load the packages, just jQuery. 4-The only thing you need for each plugin, is the list of functions/ namespaces it registers. That's not much generally, in the paste I added, those are mostly the real namespaces for those 3 plugins. I could add a link to a list of pre made registrations, that I add as I get them reported by plugin owners or users. 5-That's a very specific question, this is the first release, a draft you could say. I don't think this point has much importance. I could for instance check that. But the dev is the one registering, so it's not likely to happen. Well, thanks again for checking. Cheers Ariel Flesler On Mar 5, 8:33 am, Alexandre Plennevaux [EMAIL PROTECTED] wrote: Christof, thanks for bearing with my silly questions and the clear explanations ! On Wed, Mar 5, 2008 at 12:14 PM, Christof Donat [EMAIL PROTECTED] wrote: Hi, what if you comment out your script tags ? i'm probably pulling hairs here. Then you don't have the script tags in the DOM. You would need to write your own parser then to parse the content of the coments - not a too simple task. Of course you also can not use the existing jQuery functions then, because your objects are not part of the DOM. You could think of leaving out the src tag and transport the url somhow else. e.g.: script class=lazy url:asdf/jkl/test.js/script But that is much less cool of course. Christof -- Alexandre Plennevaux LAb[au] http://www.lab-au.com- Hide quoted text - - Show quoted text -
[jQuery] Can I use jQuery to make stickies/post-it notes ?
I know there's a way, but does anyone would know of any tutorials describing how to make 'stickies' on a web page? I would appreciate a nudge in the right direction. Ultimately, what I want to make is a way for people to post notes on a virtual calendar that they can drag around to any position on the calendar, just like a real post-it note. The position and contents of each post-it will be stored in a database. It might be a pain in the a** to implement but that's what the client wants! Thanks.
[jQuery] Re: with balloons, how too?
Please! No body??
[jQuery] bizarre width inconsistency between FF and IE using dimensions plugin
hello... I'm using the dimensions plugin. I'm using UL, LI to generate a scrolling grid. #datatableHead ul has my column headers #datatable is a div that's scrollable first I set widths for the head and scroller: $('#datatableHead ul, #datatable').css({width: $(window).width()-20}); then I set my grid rows' width based on the scroller's width - since its all based on viewport size. $('#datatable ul').css({width: $('#datatable').width()}); looks perfect in IE - but in FF the width of the #datatable ul is about 20 px bigger than in IE. now, please don't say: why use dimensions you should use CSS widths - trust me I tried all of that, it's not working. If only i could figure out why FF renders widths differently? I thought the whole point of dimensions plugin is to make that no longer matter. Thanks! (now I shall look over the list and see if I can help someone else :P )
[jQuery] Re: Execute JavaScript that is added to the page by AJAX?
sounds like you want $.getscript(blah.js); On Mar 4, 2:01 pm, Jonny [EMAIL PROTECTED] wrote: Basically, I have a JavaScript function (let's call the function displayDiv) that ends up writing a div to the page. If displayDiv is called within a table cell, the div will be added and displayed in that table cell. Now, what I'm trying to accomplish is replicating this behaviour with an AJAX function (let's call the function callAJAX) that returns HTML containing displayDiv and adding the code to a specific location in the page. I have tried this, problem is that the JavaScript returned from callAJAX was not executed. I then did some research and tried a few things: 1. I tried parsing out the JavaScript (displayDiv) from the returned HTML (callAJAX) and adding it to the head tag, which in theory, should be executed. This approach did not work for me because displayDiv writes a div to the page and from the head it would not know where to write the div. 2. I have tried parsing out the JavaScript (displayDiv) from the returned HTML (callAJAX) and executing it with EVAL() but this would not work because the AJAX function would not know where to write the div created within the displayDiv function. I guess what I'm hoping for is some magical piece of code that would tell the browser to parse the page again and execute the JavaScript that was added to the page by the AJAX function. I am posting this on behalf of a friend who is to busy today :) If anyone can tell me if this is even possible, and if so, where to go next, that would be most excellent! Many thanks, - Jonny
[jQuery] Firefox-like multi-purpose search bar
Hi all I´m looking for a jQuery plugin that emulates the Firefox multi-purpose search bar (the bar that stands on the right of the address bar), something like: [type][input][submit] where: [type]: when clicked, shows a drop-down menu with options that define the type of the search (a person, an address, [input]: a text field to type the search subject [submit]: the submit button (usually an image) to submit the search If I could I would write a plugin to do this, but I don´t know how or where to start. I´m just a PHP programmer that incorporates some jQuery plugins:-) Does anyone know anything like this? Or can point me out where to start? Thanks in advance :) Luiz Damim Brazil
[jQuery] Re: Evaluation ajax response data
check out what is in actually in theData. if it's anything like the page requests i'm making, there's probably a doctype declaration or other such jazz in there that you're going to need to get rid of with some string manipulation... if you design your processEmail.php to return something like: MyResult:yes you can use theData.split(MyResult:)[1]; to get in the neighbourhood of the info you're looking for... --adam On Mar 4, 12:43 pm, rpupkin77 [EMAIL PROTECTED] wrote: Hi, I have a simple ajax app that returns a dataType of text with a string of either yes or no. The script works fine, but for some reason, when I try to use an if/ else statement to evealutae the response, it always return false. in the following example, my code will alert yes but the if statement acts as if the data variable is not equal to it, even when it is For example: var d = page.php?params; $.ajax({ type: GET, url: /ajax/processEmail.php, data: d, dataType: text, success: function(theData, msg){ alert(theData); if(theData==yes) { do this;} else { do this; } }); any ideas?
[jQuery] Re: Plugin Authoring Help pt 2
ugh, I' min the same boat. I hope some of the superstars will eventually get around to writing more detailed tutorials. been struggling with extension writing myself. On Mar 4, 11:09 am, Leanan [EMAIL PROTECTED] wrote: Ok, I'm really trying to wrap my head around this, and it's irritating me. I've checked out the following pages: http://docs.jquery.com/Plugins/Authoringhttp://www.learningjquery.com/2007/10/a-plugin-development-pattern And they help some but there's one problem I'm running into. I have: $.fn.myPlugin = function(options) { $.myPlugin.defaults = $.extend($.myPlugin.defaults, options); return(this); }; $.myPlugin = { defaults: { def1: 'default1', def2: 'default2', ... defx: 'defaultx' }, myFunc: function() { var options = $.myPlugin.defaults; //do something here, anything really }, myFunc2: function() { var options = $.myPlugin.defaults; //do something here, again, anything } }; Now, I want to do something like this: jQuery().myPlugin({def1: 'other_def1', def2: 'other_def2'}).myFunc(); Can I? Because it's not working. It tells me that jQuery().myPlugin({def1: 'other_def1', def2: 'other_def2'}) is not a function. However, if I change it so that myFunc is $.fn.myFunc = function() { }, then I can, but I have to do it as: jQuery().myPlugin({def1: 'other_def1', def2: 'other_def2'}).myPlugin.myFunc(); Which I don't like. None of the tutorials or documentation I can find is clear on this point, though they do refer to the functions in $.myPlugin as being user-accessable... and they are, but only if I do $.myPlugin.myFunc. I can't chain. And I want to be able to do that.
[jQuery] Re: EqualTo but only if checkbox is checked
Thanks Scott. What's a planned solution? It says a ticket. So does that mean dependency checks were something just implemented in the fix in the API to allow us to do this? On Mar 4, 2:14 pm, Scott González [EMAIL PROTECTED] wrote: There is now a planned solution for adding dependency checks to all validation methods. Seehttp://dev.jquery.com/ticket/2456for more details. On Mar 3, 11:13 am, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: How can I compare 2 text fields only if a certain checkbox is checked? Can you do something like this? billingAddress: { required: true minlength: 5 equalTo: #shippingAddress function(element) { return jQuery(#comparefields).is(:checked); }, I'm not sure if this is possible or how to form this correctly. I assume you'd be able to do this in an equalto along with specifying which field to compare to.
[jQuery] Re: changing the selected option in a select
Try this: this didn't work (as well as several other variations): $('a.cancel').click( function(){ $('select option:nth(0)').attr(selected,selected); }); On 7. Feb, 23:40 h., rolfsf [EMAIL PROTECTED] wrote: I can't seem to get this to work... I'm using jquery 1.1.4 I have a link 'a.clear' When clicking on a.clear, I want to reset all selects to a 'null' option: javascript:void(0); clear select option value=0--/option option value=1 selected=selectedthis/option option value=2 that/option /select this didn't work (as well as several other variations): $('a.cancel').click( function(){ $('select option[value=0]').attr(selected,selected); }); can someone clue me in? Thanks! -- View this message in context:http://www.nabble.com/changing-the-selected-option-in-a-select-tp1534... Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: .load errors in IE6 7
The answer to this question: http://groups.google.com/group/jquery-en/browse_thread/thread/144d19f0c5ac213e/7fe99fdc3ea56231?lnk=gstq=sharanbrar#7fe99fdc3ea56231
[jQuery] Re: EqualTo but only if checkbox is checked
And so is params and depends new functions that were not originally in the JQuery library? So do I have to update the core .js file on our app in order to use the params and depends on any validator method? On Mar 4, 2:14 pm, Scott González [EMAIL PROTECTED] wrote: There is now a planned solution for adding dependency checks to all validation methods. Seehttp://dev.jquery.com/ticket/2456for more details. On Mar 3, 11:13 am, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: How can I compare 2 text fields only if a certain checkbox is checked? Can you do something like this? billingAddress: { required: true minlength: 5 equalTo: #shippingAddress function(element) { return jQuery(#comparefields).is(:checked); }, I'm not sure if this is possible or how to form this correctly. I assume you'd be able to do this in an equalto along with specifying which field to compare to.
[jQuery] Re: Moving select box options up and down
a small amount of effort Easier said than done! If I made a donation to your site would you do it for me? Let me now how much. On Mar 5, 4:07 am, Matt Kruse [EMAIL PROTECTED] wrote: On Mar 4, 5:44 pm, Diddly Doo [EMAIL PROTECTED] wrote: I wonder if anyone has some sample code or plugin for moving select box options up and down using jQuery. Similar to this: http://www.breakingpar.com/bkp/home.nsf/0/87256B280015193F87256C5F006... I haven't jQuery-ized it yet, but my lib has some advantages over the link above and could be easily made into a jQuery plugin with a small amount of effort:http://www.javascripttoolbox.com/lib/selectbox/ Matt Kruse
[jQuery] callbacks calling callbacks calling callbacks ....
Hello, as everything Ajax-related is (mostly) asynchronous every response is handled using callbacks. I often have the problem that to do action A I have to initialize multiple components on the page (if not initialized yet), then fire 1- n ajax calls, waiting for the callback and so on. this leads to a set of functions chained together by callback-calls. function action() { if (!$('#comp1').is('.loaded')) { $('#comp1').trigger('load.comp1', [ cb1 ]) } if (!$('#comp2').is('.loaded')) { $('#comp2').trigger('load.comp2', [ cb2 ]) } if (!$('#comp3').is('.loaded')) { $('#comp3').trigger('load.comp3', [ cb3 ]) } if (cb1 cb2 cb3 have been called and returned success) { action2(action2-callback) if (action2-callback has been called and returned success) { // do real business logic } } } do you know of any patterns to implement these callback-chains more elegantly? how do you solve nested, nasty callback-chains?
[jQuery] JQuery Hello world not working
Hi All, I am new to JQuery. I did the following to get started with JQuery. 1) Downloaded JQuery Uncompressed version. Renamed JQuery.1.2.3.js to JQuery.js (I do not know whether this is correct! ) 2) I followed the tutorial for Hello world and typed the following code into an HTML file html head script type=text/javascript src=jquery.js /script script type=text/ javascript alert('here'); $(document).ready(function() { $(a).click(function() { alert(Hello world!); }); }); / script / head body / body /html After opening this HTML file in IE 7.9, I find nothing on the page, not even any javascript error. The code is supposed to display a link, but I do not find any link on the page. Can anyone help me here. - pradeep
[jQuery] Re: How to serialize only part of a form?
$('#row1 :input').serialize()
[jQuery] Re: how to get the size of the image file before user upload it.
File size or dimensions? On Mar 4, 4:25 pm, Xinhao Zheng [EMAIL PROTECTED] wrote: hi all, is there a way to do this that can work both under ie and FF.thanks in advance. George
[jQuery] Re: Half star rating plugin won't work with jQuery 1.2.3
Much appreciated! :) On Mar 4, 2:54 pm, Diego A. [EMAIL PROTECTED] wrote: I have an idea to make this work (for display purposes only), and I will do my best to implement it in the next couple of days (weeks tops). I'm sorry I can't do it right now - hope that's OK. I'll post back here... (and in the official project page in the jQuery plugins website) On Mar 4, 5:32 pm, AsymF [EMAIL PROTECTED] wrote: I am really just looking for way to display the data, not to worry about graceful degradation without JavaScript enabled. I had a serious issue with people using proxies to submit thousands of votes for irrelevant ratings so now all ratings have to fetch a key in advance using an AJAX callback to the server (based in part on another tutorial I found on the jQuery site). If JavaScript is gone I just show a list of stars so that visitors can see the rating even if they can't vote. However, I would like to be able to display incremental stars such that if I have a rating of 3.75, then 3 stars and 75% of a 4th star will be shown with the rest grayed out. On Mar 4, 9:27 am, Diego A. [EMAIL PROTECTED] wrote: I have been thinking about this for a few days now, but I haven't had the time to do it. The problem with what you're trying to achieve is that you're looking for something to *display* the data, whereas my implementation of the plugin focuses on semantic form integration. Perhaps the way forward is to add the ability to display decimal points and accept the input of whole numbers (and at a push, .5s). How are you going to use this? On Mar 1, 5:46 pm, AsymF [EMAIL PROTECTED] wrote: I am now working on the jQuery Star Rating Plugin v1.1 by Diego A.,http://www.fyneworks.com, [EMAIL PROTECTED] I have gotten it working and added the ability to remove the cancel button by adding the following before the line for(n in groups){: if (settings.nocancel) { $(div.cancel:has(a[title=' + settings.cancel + '])).remove(); } I also added nocancel: false to the settings at the beginning of the script. Now if I could figure out how to get it to show incremental stars for ratings such as 3.2 or 4.6 it would be perfect for my purposes. Any ideas on implementing this? Like I said, I can see it done in the plugin ratings on the jQuery site but don't know which segment of code does that feature. On Feb 29, 5:52 pm, AsymF [EMAIL PROTECTED] wrote: I would just use the one on the jQuery site if it weren't for the fact that it relies on a form. The position on the page I want to show the star rating already has another form so to use that one would mean putting a form inside a form which causes problems. On Feb 29, 3:19 pm, chrismarx [EMAIL PROTECTED] wrote: is that the same on as here: http://examples.learningjquery.com/rating/ ? i remember making several changes, let me know if thats the same one- On Feb 29, 1:16 pm, AsymF [EMAIL PROTECTED] wrote: I got this one to work: Star Rating Plugin v1.1 -http://www.fyneworks.com/jquery/star-rating/ But the half star plugin won't work with 1.2.3:http://www.learningjquery.com/2007/05/half-star-rating-plugin Does anyone know a fix? The stars all appear grayed out and hover also doesn't work.
[jQuery] Close facebox programatically
Hey folks, I'm trying out jQuery for the first time on my little project and I am very excited about all the cool stuff. I'm trying to use the Facebox plugin as a dialog. It works great so far, but I need a way to close the dialog programatically instead of having the user click on the 'Close' button provided by the dialog window. The docs for Facebox indicate that I should be able to do this with the following statement: jQuery(document).trigger('close.facebox') But nothing happens when I execute this statement at all, and I don't get any javascript errors. Thoughts anyone? Thanks, Peter
[jQuery] Re: Evaluation ajax response data
try converting it to a string value theData.toString(); probably wont work though - maybe better to have the PHP script return a boolean true or false or 1 and 0 and then making sure your response type is value. On Mar 4, 9:43 am, rpupkin77 [EMAIL PROTECTED] wrote: Hi, I have a simple ajax app that returns a dataType of text with a string of either yes or no. The script works fine, but for some reason, when I try to use an if/ else statement to evealutae the response, it always return false. in the following example, my code will alert yes but the if statement acts as if the data variable is not equal to it, even when it is For example: var d = page.php?params; $.ajax({ type: GET, url: /ajax/processEmail.php, data: d, dataType: text, success: function(theData, msg){ alert(theData); if(theData==yes) { do this;} else { do this; } }); any ideas?
[jQuery] Re: Execute JavaScript that is added to the page by AJAX?
I posted this almost an hour ago and it is still not showing up in the Google Group... why? - Jonny On Tue, Mar 4, 2008 at 2:01 PM, Jonny [EMAIL PROTECTED] wrote: Basically, I have a JavaScript function (let's call the function displayDiv) that ends up writing a div to the page. If displayDiv is called within a table cell, the div will be added and displayed in that table cell. Now, what I'm trying to accomplish is replicating this behaviour with an AJAX function (let's call the function callAJAX) that returns HTML containing displayDiv and adding the code to a specific location in the page. I have tried this, problem is that the JavaScript returned from callAJAX was not executed. I then did some research and tried a few things: 1. I tried parsing out the JavaScript (displayDiv) from the returned HTML (callAJAX) and adding it to the head tag, which in theory, should be executed. This approach did not work for me because displayDiv writes a div to the page and from the head it would not know where to write the div. 2. I have tried parsing out the JavaScript (displayDiv) from the returned HTML (callAJAX) and executing it with EVAL() but this would not work because the AJAX function would not know where to write the div created within the displayDiv function. I guess what I'm hoping for is some magical piece of code that would tell the browser to parse the page again and execute the JavaScript that was added to the page by the AJAX function. I am posting this on behalf of a friend who is to busy today :) If anyone can tell me if this is even possible, and if so, where to go next, that would be most excellent! Many thanks, - Jonny
[jQuery] $.ajax success/error callback arguments, textStatus?
reference: http://docs.jquery.com/Ajax/jQuery.ajax#options What exactly is textStatus of the success and error callback argument? Being a coldfuision user, I tried: cfheader statuscode=403 statusText=testing123 However, the textStatus is always the default value. Any idea how to set textStatus on the server side? Thank you!
[jQuery] Re: Moving select box options up and down
you should check out the interface plugin on the jquery site. There is code sample to show you how that is used. On Mar 4, 3:44 pm, Diddly Doo [EMAIL PROTECTED] wrote: I wonder if anyone has some sample code or plugin for moving select box options up and down using jQuery. Similar to this: http://www.breakingpar.com/bkp/home.nsf/0/87256B280015193F87256C5F006... Thanks!
[jQuery] Re: EqualTo but only if checkbox is checked
Scott, I don't see how his example helps. He's hiding or showing a panel based on if the checkbox is checked. George, your suggested code didn't work after I tried it. On Mar 4, 11:57 am, Scott González [EMAIL PROTECTED] wrote: Right now, the easiest way to accomplish this is to use parameter or class based validation and dynamically change the parameter/class when the checkbox is checked (seehttp://tinyurl.com/2f6dsnfor a previous explanation I've given on this). Also, you may want to check out the second step of the Marketo demo (http://jquery.bassistance.de/validate/demo/marketo/) for an example of address validation. On Mar 3, 11:13 am, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: How can I compare 2 text fields only if a certain checkbox is checked? Can you do something like this? billingAddress: { required: true minlength: 5 equalTo: #shippingAddress function(element) { return jQuery(#comparefields).is(:checked); }, I'm not sure if this is possible or how to form this correctly. I assume you'd be able to do this in an equalto along with specifying which field to compare to.
[jQuery] Re: help with a strategy?
the PHP doesn't have to be that obtrusive, with endless echo and print statements. Turn your data into a two dimensional array $rows: table ? foreach($rows as $row) : ? tr ? foreach ($row as $cell) : ? td?= $cell ?/td ? endforeach; ? /tr ? endforeach ? /table On Tue, Mar 4, 2008 at 10:20 AM, charlie [EMAIL PROTECTED] wrote: Hi all, the application I'm attempting to write couldn't be simpler: I want to display rows of data, retrieved from a database and allow people to edit or delete those rows and add new rows. Backend is PHP, but I'd prefer to keep that out of the picture. So far I'm passing my rows successfully to jquery and have the loop ready to go, but I'm not sure how to proceed. Here's my dilemma: what's the best strategy for keeping the HTML out of my Javascript as much as possible? The whole point of this excercise has been to try to extricate as much PHP as possible from the display logic, but just subbing in javascript is obviously pretty pointless. One strategy I'm toying with is having an HTML empty row in the normal layout that's hidden and get's cloned for both existing and new records. Is this a common technique? Are there better ones? I'm trying not to re-invent the wheel here! TIA, Charles
[jQuery] append problem in ie7
hi guys, Im new to jquery. I have this problem and I think you guys can answer it. Here's the source code of the file that I am working on. The purpose of this script is to change the label into different language. - !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN http:// www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd html head meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 / titletitle/title !-- jQuery -- script type=text/javascript src=js/jquery/jquery-1.2.3.js/ script style html, body { margin:0px; padding:0px; height:100%; } #userlist { border: 1px dashed red; position: fixed; top: 20px; z-index:500; } .group-box { border:1px solid gray; position:relative; width: 100px; height: 40px; text-align: center; margin: 5px; } .clickables * { border: 1px solid silver; background: yellow; margin: 4px; width: 100px; } #chart-box-container { border: 2px solid silver; width: 80%; height:95%; margin-left: 100px; background: white; z-index:1000; } /style script // the language resource object resources = { jp: { NO_REC: Wara lecolds, EXPLODE: Warat, NAME: Borat }, en: { NO_REC: There ain't nuthin here dawg., EXPLODE: See ya!, NAME: Whatcha called } } /script script type=text/javascript function changeLang(lang) { //alert(Change language to + lang); $(multilang).each(function() { id = $(this).attr(label); $(this).empty().append(eval(resources. + lang + . + id)); }); } $(document).ready(function(){ changeLang(jp); $(.clickables *).click(function(){ lang = $(this).attr(lang); changeLang(lang); }); }); /script /head body This defaults to Japanese. Click of the language below to change. div class=clickables div lang=jp[Japanese]/div div lang=en[English]/div /div hr/ This is the string multilang label='EXPLODE'/multilang. divIt can be anywhere in the DOM of course, like this: multilang label='NO_REC'/multilang. See?/div divIt can be anywhere in the DOM of course, like this: multilang label='EXPLODE'/multilang. See?/div label for=xmultilang label='EXPLODE'/multilang/labelinput id=x type=text/br/ label for=ymultilang label='NAME'/multilang/labelinput id=y type=text/ /body /html This work fine in FF. In ie7 I'm getting this error Unexpected call to method or property access. Line: 258 Character: 5 I guess this came from the append function in jquery. Thanks.
[jQuery] Problem Targetting DIVs (Dynamic List Example)
Hi, can anyone tell me why this isn't displaying the default list automatically when the page loads? If you look in the code where the comments are, I think one of those places is where the problem is. I can't work it out however as I am fairly new to jQuery. html head titleQuick Links Tester/title style type=text/css.hide {display : none }/style script type=text/javascript src=jquery-1.2.3.min.js/ script script type=text/javascript $(function() { $(#QuickLinksSelect).show(); // The DIVs are dynamically named, so I can't just put // #0 here... ShowOrHideQuickLinks($(#QuickLinks gt; div:first)); $(select#QuickLinksSelect).change ( function() { var selectedQuickLink = # + $(select#QuickLinksSelect).val(); ShowOrHideQuickLinks(selectedQuickLink); } ); }); function ShowOrHideQuickLinks(quickLinkToShow) { // alert gives [object Object] on load, which is not expected. // alert gives #0 or #1 on select change, which is. alert(quickLinkToShow); $(#QuickLinks div).addClass(hide); $(quickLinkToShow).removeClass(hide); } /script /head body div id=QuickLinksContainer select id=QuickLinksSelect style=display:none option value=0Default.../option option value=11/option /select div id=QuickLinks div id=0 ul lia href=#Default (1)/a/li lia href=#Default (2)/a/li lia href=#Default (3)/a/li lia href=#Default (4)/a/li /ul /div div id=1 ul lia href=#1 (1)/a/li lia href=#1 (2)/a/li lia href=#1 (3)/a/li lia href=#1 (4)/a/li /ul /div /div /div /body /html Many thanks in advance. If anyone is interested, my full example includes using a cookie to remember your choice. I can post full code if I can just get the above code working :) Richard
[jQuery] Re: help with a strategy?
Much like how jquery keeps the javascript out of the HTML, it's so much cleaner to keep PHP out of the HTML as well. Have a look at the Smarty templating system for PHP. It's awesome. -j On Mar 4, 11:20 am, charlie [EMAIL PROTECTED] wrote: Hi all, the application I'm attempting to write couldn't be simpler: I want to display rows of data, retrieved from a database and allow people to edit or delete those rows and add new rows. Backend is PHP, but I'd prefer to keep that out of the picture. So far I'm passing my rows successfully to jquery and have the loop ready to go, but I'm not sure how to proceed. Here's my dilemma: what's the best strategy for keeping the HTML out of my Javascript as much as possible? The whole point of this excercise has been to try to extricate as much PHP as possible from the display logic, but just subbing in javascript is obviously pretty pointless. One strategy I'm toying with is having an HTML empty row in the normal layout that's hidden and get's cloned for both existing and new records. Is this a common technique? Are there better ones? I'm trying not to re-invent the wheel here! TIA, Charles
[jQuery] Re: validate form with rails
hey, I think you need do something like this: rules: { ID_INPUT: { required: true, email: true } } Know? sould be a ID from input text. May you can help me... I need do something with ballons, look http://blog.alexsandro.com.br/aa.htm But, It don't work very well. Can you help me? Thank you On 5 mar, 01:00, Rodi [EMAIL PROTECTED] wrote: Hi All, I'm using jQuery plugin Validation by Jörn. The problem is that in rails the element name for an input is formated as user[email] so when I pass a rule, it doesn't recognize. here is the sample: rules: { user[email]: { required: true, email: true } } it gives me a error on firebug: missing : after property id user[email]: {\n If there is a way to pass rules with the element id instead of name, would solve the problem. I think... Thanks, Rodrigo Soares
[jQuery] Re: validate form with rails
On Mar 5, 5:00 am, Rodi [EMAIL PROTECTED] wrote: Hi All, I'm using jQuery plugin Validation by Jörn. The problem is that in rails the element name for an input is formated as user[email] so when I pass a rule, it doesn't recognize. here is the sample: rules: { user[email]: { required: true, email: true } } it gives me a error on firebug: missing : after property id user[email]: {\n If there is a way to pass rules with the element id instead of name, would solve the problem. I think... Have you tried: rules: { 'user[email]': { required: true, email: true } } Not sure if that works... --Klaus
[jQuery] Re: cluetip question
Hi Dylan, I'm honored that you're using clueTip! :-) It looks like you came up with a workaround for your issue, but for future reference, as of version 0.9.5 you can override defaults globally like so: $.fn.cluetip.defaults.cluetipClass = 'jtip'; Hope that helps. --Karl _ Karl Swedberg www.englishrules.com www.learningjquery.com On Mar 5, 2008, at 5:09 AM, Dylan Verheul wrote: I'd like to set a default style for cluetips in my project. Since I'm abstracting cluetip for my fellow programmers by wrapping it in PHP, I don't like to add cluetipClass: 'jtip' to every call. Can I do something like: $.cluetip.setup({ cluetipClass: 'jtip' }); $(a.cluetip).cluetip(); $(a.cluetip2).cluetip({ some:other_option }); I tried, but it doesn't work like this now. A global style would be a major improvement I think, you shouldn't have to set the style for every cluetip.
[jQuery] Re: [ANNOUNCE] Jonathan Snook Live on UStream.tv
Jonathan said that he will try to record it. Rey Andy Matthews wrote: Rey... Will this presentation be recorded for future viewing? -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Rey Bango Sent: Tuesday, March 04, 2008 12:45 PM To: jquery-en@googlegroups.com Subject: [jQuery] [ANNOUNCE] Jonathan Snook Live on UStream.tv Jonathan Snook will be conducting a live chat tomorrow (3/5/08) at 10:00am EST (15:00 GMT) via UStream. Here are the details: * Location: http://www.ustream.tv/channel/snookca * Date/Time: 3/5/08 at 10:00am EST (15:00 GMT) * Topic: QA relating to Jonathan's development work with Adobe AIR, and questions regarding JavaScript, frameworks (PHP or JavaScript), or about freelancing. If you're not familiar with Jonathan, he is one of the top client-side veterans around having published books, articles and contributed to many projects. He's also the lead for the Snitter project, a Twitter client developed in JavaScript using jQuery and Adobe AIR. This is definitely a good opportunity to pick the brain of one of the top professionals around.
[jQuery] Re: JQuery Hello world not working
That code does not create a link, it binds that function to existing links. You either have to add a link in the html. Or create a link with something like $('a href=#a link/a').appendTo(body); as the first line after $(document).ready(function() { On Mar 5, 2:16 am, pradeep_tp [EMAIL PROTECTED] wrote: Hi All, I am new to JQuery. I did the following to get started with JQuery. 1) Downloaded JQuery Uncompressed version. Renamed JQuery.1.2.3.js to JQuery.js (I do not know whether this is correct! ) 2) I followed the tutorial for Hello world and typed the following code into an HTML file html head script type=text/javascript src=jquery.js /script script type=text/ javascript alert('here'); $(document).ready(function() { $(a).click(function() { alert(Hello world!); }); }); / script / head body / body /html After opening this HTML file in IE 7.9, I find nothing on the page, not even any javascript error. The code is supposed to display a link, but I do not find any link on the page. Can anyone help me here. - pradeep
[jQuery] Re: Plugin Authoring Help pt 2
You might find it easier to simply create objects that use jquery, instead of writing a jquery plugin. The biggest advantage is that you actually have a normal instance of an object. You can pass this instance to other objects, call other methods on it... all the usual good stuff. (jquery plugins seem to be a one-shot deal. you call the method, pass in a bunch of parameters, and it works. If you need to access that instance again, you can't. i had this problem with the pagination plugin. i added more elements to my list, but there was no way to tell the pagination object that the list was longer. i would have to delete it and recreate it.) here's the pattern i use. let's say i wanted a 'fancy' textarea box. function TextBox(opts) { this.jC = opts.container; // all jquery objects start with a 'j' this.visible = 0; }; TextBox.prototype.draw = function() { this.jC.html('textarea/textara'); // could add lots of functionality to the textbox. key press handlers, etc. this.visible = 1; }; // how you use the object... $(document).ready(function() { var txt = new TextBox({container:$('#text')}); // obviously need an element to be the container. txt.draw(); }); Works well for me. Maybe one of the plug-in experts can comment on when it makes sense to write a jquery plugin versus write a normal object that uses jquery? -j On Mar 4, 2:09 pm, Leanan [EMAIL PROTECTED] wrote: Ok, I'm really trying to wrap my head around this, and it's irritating me. I've checked out the following pages: http://docs.jquery.com/Plugins/Authoringhttp://www.learningjquery.com/2007/10/a-plugin-development-pattern And they help some but there's one problem I'm running into. I have: $.fn.myPlugin = function(options) { $.myPlugin.defaults = $.extend($.myPlugin.defaults, options); return(this); }; $.myPlugin = { defaults: { def1: 'default1', def2: 'default2', ... defx: 'defaultx' }, myFunc: function() { var options = $.myPlugin.defaults; //do something here, anything really }, myFunc2: function() { var options = $.myPlugin.defaults; //do something here, again, anything } }; Now, I want to do something like this: jQuery().myPlugin({def1: 'other_def1', def2: 'other_def2'}).myFunc(); Can I? Because it's not working. It tells me that jQuery().myPlugin({def1: 'other_def1', def2: 'other_def2'}) is not a function. However, if I change it so that myFunc is $.fn.myFunc = function() { }, then I can, but I have to do it as: jQuery().myPlugin({def1: 'other_def1', def2: 'other_def2'}).myPlugin.myFunc(); Which I don't like. None of the tutorials or documentation I can find is clear on this point, though they do refer to the functions in $.myPlugin as being user-accessable... and they are, but only if I do $.myPlugin.myFunc. I can't chain. And I want to be able to do that.
[jQuery] Re: JQuery Hello world not working
actually, your code doesn't display a link. it sets up an action when the link is clicked. You're missing: a href=#do something/a There might be other problems too if you aren't even seeing the alert message. Download firefox and firebug. IE isn't much help for developing javascript. -j On Mar 5, 5:16 am, pradeep_tp [EMAIL PROTECTED] wrote: Hi All, I am new to JQuery. I did the following to get started with JQuery. 1) Downloaded JQuery Uncompressed version. Renamed JQuery.1.2.3.js to JQuery.js (I do not know whether this is correct! ) 2) I followed the tutorial for Hello world and typed the following code into an HTML file html head script type=text/javascript src=jquery.js /script script type=text/ javascript alert('here'); $(document).ready(function() { $(a).click(function() { alert(Hello world!); }); }); / script / head body / body /html After opening this HTML file in IE 7.9, I find nothing on the page, not even any javascript error. The code is supposed to display a link, but I do not find any link on the page. Can anyone help me here. - pradeep
[jQuery] Re: Close facebox programatically
i use this: $.facebox.close(); On Mar 5, 5:04 am, [EMAIL PROTECTED] wrote: Hey folks, I'm trying out jQuery for the first time on my little project and I am very excited about all the cool stuff. I'm trying to use the Facebox plugin as a dialog. It works great so far, but I need a way to close the dialog programatically instead of having the user click on the 'Close' button provided by the dialog window. The docs for Facebox indicate that I should be able to do this with the following statement: jQuery(document).trigger('close.facebox') But nothing happens when I execute this statement at all, and I don't get any javascript errors. Thoughts anyone? Thanks, Peter
[jQuery] Re: callbacks calling callbacks calling callbacks ....
wouldn't nesting the methods work? e.g. script type=text/javascript $('#comp1').trigger('load.comp1', function() { $('#comp2').trigger('load.comp2', function() { $('#comp3').trigger('load.comp3', function() { if (action2()) { // do business logic... } }); }); /script On Mar 5, 5:44 am, h0tzen [EMAIL PROTECTED] wrote: Hello, as everything Ajax-related is (mostly) asynchronous every response is handled using callbacks. I often have the problem that to do action A I have to initialize multiple components on the page (if not initialized yet), then fire 1- n ajax calls, waiting for the callback and so on. this leads to a set of functions chained together by callback-calls. function action() { if (!$('#comp1').is('.loaded')) { $('#comp1').trigger('load.comp1', [ cb1 ]) } if (!$('#comp2').is('.loaded')) { $('#comp2').trigger('load.comp2', [ cb2 ]) } if (!$('#comp3').is('.loaded')) { $('#comp3').trigger('load.comp3', [ cb3 ]) } if (cb1 cb2 cb3 have been called and returned success) { action2(action2-callback) if (action2-callback has been called and returned success) { // do real business logic } } } do you know of any patterns to implement these callback-chains more elegantly? how do you solve nested, nasty callback-chains?
[jQuery] roundcorners+gradient+progression= ...
roundcorners-canvas+gradient plugin+jQuery Progression = http://www.meerbox.nl/jrc_demo/example3.html i just released a new version of my plugin jquery-roundcorners-canvas and i created a new demo. You can do a lot of fun stuff with different plugins :)
[jQuery] quicktime player and thickbox issue
I have a thickbox modal window, in which I have embedded a wav file. The wav file is being played through the quicktime player plugin. The audio plays fine, but when I open a newly created modal window, more often then not, the player doesn't actually show. Instead I see the gray overlay that is behind the modal window. I ran across a script that redraws an element in the window, which supposedly causes the qt player to be redrawn. However, this method doesn't seem to work for me. Has anyone come across this issue before? If so, how did you overcome it? Here's the code that I tried using without any luck. I put it down just above the /body tag. |script type=text/javascript $(document).ready(function() { closeButton = document.getElementById(TB_closeWindowButton); color = closeButton.style.color; closeButton.style.color = white; closeButton.style.color = color; }); /script| I replaced the element ID with one that I was using in my window. Thanks! -- ~Steve http://goodcf.instantspot.com/blog
[jQuery] Re: .html() callback?
I think the OP is adding elements to the dom, and then wondering why the events for the new elements aren't working. after adding elements with .html(), you need to add the events. For example, adding an anchor: $(#header).html('a href=#yo/a').find('a').click(function() { alert('click'); return false; }); -j On Mar 4, 10:53 am, Scott González [EMAIL PROTECTED] wrote: .html() doesn't have a callback because it is synchronous, so any code executed after the .html() call will definitely occur after the html is set. I'm not sure why you're having any problems, but the problem is probably in your code. You'll get better responses by posting a test page. On Mar 4, 8:10 am, alexanmtz [EMAIL PROTECTED] wrote: Hi everyone, Like a lot of methods of jQuery, why the .html() doesnt have a callback? I need that some javascript load when the dom change with .html() (append and others too), and some events are attached with the new elements created by this method. What happens is that sometimes they are attached and other times not. I thing its due the fact that I execute this code: $('#div').html(stuffVar); $.getScript('newEvents.js'); This work sometimes. I would need one way to accomplish this task like this: $(#div').html(stuffVar,function(){ $.getScript('newEvents.js'); }); This way, we would have sure that the html is updated and so we can load the script to attach events. Anyone has idea??? thanks, Alexandre Magno Web Developerhttp://blog.alexandremagno.net
[jQuery] Re: Execute JavaScript that is added to the page by AJAX?
Ok, sorry, never mind, I guess there was just a delay in this post going live, sorry for my impatience :/ Just to clarify, this is not really a Jquery question, but this group seems to be the most active one that has AJAX experts in it, so that's why I posted it here. I know that the people who are asking this question (through me) are not wanting to load a heavy js library (Jquery), so the advice below won't really work :( - J On Mar 4, 2:54 pm, Jonny M [EMAIL PROTECTED] wrote: I posted this almost an hour ago and it is still not showing up in the Google Group... why? - Jonny On Tue, Mar 4, 2008 at 2:01 PM, Jonny [EMAIL PROTECTED] wrote: Basically, I have a JavaScript function (let's call the function displayDiv) that ends up writing a div to the page. If displayDiv is called within a table cell, the div will be added and displayed in that table cell. Now, what I'm trying to accomplish is replicating this behaviour with an AJAX function (let's call the function callAJAX) that returns HTML containing displayDiv and adding the code to a specific location in the page. I have tried this, problem is that the JavaScript returned from callAJAX was not executed. I then did some research and tried a few things: 1. I tried parsing out the JavaScript (displayDiv) from the returned HTML (callAJAX) and adding it to the head tag, which in theory, should be executed. This approach did not work for me because displayDiv writes a div to the page and from the head it would not know where to write the div. 2. I have tried parsing out the JavaScript (displayDiv) from the returned HTML (callAJAX) and executing it with EVAL() but this would not work because the AJAX function would not know where to write the div created within the displayDiv function. I guess what I'm hoping for is some magical piece of code that would tell the browser to parse the page again and execute the JavaScript that was added to the page by the AJAX function. I am posting this on behalf of a friend who is to busy today :) If anyone can tell me if this is even possible, and if so, where to go next, that would be most excellent! Many thanks, - Jonny
[jQuery] Re: JQuery Hello world not working
wow, the lag on this list is brutal. is there any way of reducing it, so people don't spend time responding to already-answered questions? On Mar 5, 9:34 am, J Moore [EMAIL PROTECTED] wrote: actually, your code doesn't display a link. it sets up an action when the link is clicked. You're missing: a href=#do something/a There might be other problems too if you aren't even seeing the alert message. Download firefox and firebug. IE isn't much help for developing javascript. -j On Mar 5, 5:16 am, pradeep_tp [EMAIL PROTECTED] wrote: Hi All, I am new to JQuery. I did the following to get started with JQuery. 1) Downloaded JQuery Uncompressed version. Renamed JQuery.1.2.3.js to JQuery.js (I do not know whether this is correct! ) 2) I followed the tutorial for Hello world and typed the following code into an HTML file html head script type=text/javascript src=jquery.js /script script type=text/ javascript alert('here'); $(document).ready(function() { $(a).click(function() { alert(Hello world!); }); }); / script / head body / body /html After opening this HTML file in IE 7.9, I find nothing on the page, not even any javascript error. The code is supposed to display a link, but I do not find any link on the page. Can anyone help me here. - pradeep
[jQuery] Re: Moving select box options up and down
On Mar 5, 5:14 am, Diddly Doo [EMAIL PROTECTED] wrote: a small amount of effort Easier said than done! If I made a donation to your site would you do it for me? Let me now how much. I just wrote the wrapper and put it up, so you can now use all the functions as jQuery functions: http://www.javascripttoolbox.com/lib/selectbox/jquery.php Matt Kruse
[jQuery] Re: Plugin Authoring Help pt 2
J, I for one sure hope that someone follows up on your particular thoughts here. I've not thought of doing what you're talking about here, and I'd love to read other experts opinions on the subject. Thanks for adding to this thread. :o) Chris On Wed, Mar 5, 2008 at 8:57 AM, J Moore [EMAIL PROTECTED] wrote: You might find it easier to simply create objects that use jquery, instead of writing a jquery plugin. The biggest advantage is that you actually have a normal instance of an object. You can pass this instance to other objects, call other methods on it... all the usual good stuff. (jquery plugins seem to be a one-shot deal. you call the method, pass in a bunch of parameters, and it works. If you need to access that instance again, you can't. i had this problem with the pagination plugin. i added more elements to my list, but there was no way to tell the pagination object that the list was longer. i would have to delete it and recreate it.) here's the pattern i use. let's say i wanted a 'fancy' textarea box. function TextBox(opts) { this.jC = opts.container; // all jquery objects start with a 'j' this.visible = 0; }; TextBox.prototype.draw = function() { this.jC.html('textarea/textara'); // could add lots of functionality to the textbox. key press handlers, etc. this.visible = 1; }; // how you use the object... $(document).ready(function() { var txt = new TextBox({container:$('#text')}); // obviously need an element to be the container. txt.draw(); }); Works well for me. Maybe one of the plug-in experts can comment on when it makes sense to write a jquery plugin versus write a normal object that uses jquery? -j On Mar 4, 2:09 pm, Leanan [EMAIL PROTECTED] wrote: Ok, I'm really trying to wrap my head around this, and it's irritating me. I've checked out the following pages: http://docs.jquery.com/Plugins/Authoringhttp://www.learningjquery.com/2007/10/a-plugin-development-pattern And they help some but there's one problem I'm running into. I have: $.fn.myPlugin = function(options) { $.myPlugin.defaults = $.extend($.myPlugin.defaults, options); return(this); }; $.myPlugin = { defaults: { def1: 'default1', def2: 'default2', ... defx: 'defaultx' }, myFunc: function() { var options = $.myPlugin.defaults; //do something here, anything really }, myFunc2: function() { var options = $.myPlugin.defaults; //do something here, again, anything } }; Now, I want to do something like this: jQuery().myPlugin({def1: 'other_def1', def2: 'other_def2'}).myFunc(); Can I? Because it's not working. It tells me that jQuery().myPlugin({def1: 'other_def1', def2: 'other_def2'}) is not a function. However, if I change it so that myFunc is $.fn.myFunc = function() { }, then I can, but I have to do it as: jQuery().myPlugin({def1: 'other_def1', def2: 'other_def2'}).myPlugin.myFunc(); Which I don't like. None of the tutorials or documentation I can find is clear on this point, though they do refer to the functions in $.myPlugin as being user-accessable... and they are, but only if I do $.myPlugin.myFunc. I can't chain. And I want to be able to do that. -- http://cjordan.us
[jQuery] Re: roundcorners+gradient+progression= ...
Looks good and I plan to use it. I would, however, like to be able to put a nice drop-shadow behind that rounded-corner element. What jQuery plug-in could I use to add the shadow? Rick -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Rick Sent: Wednesday, March 05, 2008 9:58 AM To: jQuery (English) Subject: [jQuery] roundcorners+gradient+progression= ... roundcorners-canvas+gradient plugin+jQuery Progression = http://www.meerbox.nl/jrc_demo/example3.html i just released a new version of my plugin jquery-roundcorners-canvas and i created a new demo. You can do a lot of fun stuff with different plugins :)
[jQuery] Re: bizarre width inconsistency between FF and IE using dimensions plugin
Without seeing your page, I would guess it may have something to do with the CSS differences between IE and FF. Those two browsers do not implement CSS the same way. It also depends if you are running in Quirks Mode or not (do you have a DOCTYPE?) I've always dug myself out of these types of problems using Firebug in FF to inspect the offending elements to examine the styles applied to it. JK -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of jquertil Sent: Tuesday, March 04, 2008 7:37 PM To: jQuery (English) Subject: [jQuery] bizarre width inconsistency between FF and IE using dimensions plugin hello... I'm using the dimensions plugin. I'm using UL, LI to generate a scrolling grid. #datatableHead ul has my column headers #datatable is a div that's scrollable first I set widths for the head and scroller: $('#datatableHead ul, #datatable').css({width: $(window).width()-20}); then I set my grid rows' width based on the scroller's width - since its all based on viewport size. $('#datatable ul').css({width: $('#datatable').width()}); looks perfect in IE - but in FF the width of the #datatable ul is about 20 px bigger than in IE. now, please don't say: why use dimensions you should use CSS widths - trust me I tried all of that, it's not working. If only i could figure out why FF renders widths differently? I thought the whole point of dimensions plugin is to make that no longer matter. Thanks! (now I shall look over the list and see if I can help someone else :P )
[jQuery] Re: roundcorners+gradient+progression= ...
On 5 mrt, 18:51, Rick Faircloth [EMAIL PROTECTED] wrote: Looks good and I plan to use it. I would, however, like to be able to put a nice drop-shadow behind that rounded-corner element. What jQuery plug-in could I use to add the shadow? Rick I dont think a other plugin could make a shadow behind the rounded element. The only way it could be done if i (or someone else) builds it into jquery-roundcorners-canvas :)
[jQuery] Re: roundcorners+gradient+progression= ...
Thanks for the info, Rick... :o) Rick -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Rick Sent: Wednesday, March 05, 2008 1:05 PM To: jQuery (English) Subject: [jQuery] Re: roundcorners+gradient+progression= ... On 5 mrt, 18:51, Rick Faircloth [EMAIL PROTECTED] wrote: Looks good and I plan to use it. I would, however, like to be able to put a nice drop-shadow behind that rounded-corner element. What jQuery plug-in could I use to add the shadow? Rick I dont think a other plugin could make a shadow behind the rounded element. The only way it could be done if i (or someone else) builds it into jquery-roundcorners-canvas :)
[jQuery] Re: callbacks calling callbacks calling callbacks ....
On 5 Mrz., 15:40, J Moore [EMAIL PROTECTED] wrote: wouldn't nesting the methods work? e.g. unfortunately not as some methods have to be invoked in parallel. generally exactly this nesting looks fine with no real code behind but it is just cruel if you imagine having error-handling, rollbacks and business logic etc within. what im looking for is some pattern abstracting the async-callbacks or just a real-world example/solution of someone having the same issues with logic involving multiple, dependent ajax-calls. thanks, kai
[jQuery] ASP.NET GridView: losing tablesorter on postback
(I apologize for the ASP.NET WebForms terminology) I'm using ASP.NET's GridView to generate a table, and the jQuery Tablesorter plugin to sort it (awesome plugin, BTW). After the page loads sorting works great, but if I click on any control that performs a postback the page reloads but tablesorter doesn't affect it (no sorting, css styling, etc.) When troubleshooting it I click a control that does a postback and the table loses sorting. I load the table in Firebug's console - it has the 'tablesorter' method, and I call it, but nothing happens. $(#ctl00_ctl00_MainContentPlaceHolder_MainContentPlaceHolder_GridView1).tablesorter() Calling it with '$(...).tablesorter({debug:true})' doesn't print anything to the console either. Does anyone have any ideas? Thanks! orip
[jQuery] Re: Close facebox programatically
Thanks! that did the trick. On Mar 5, 7:33 am, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: i use this: $.facebox.close(); On Mar 5, 5:04 am, [EMAIL PROTECTED] wrote: Hey folks, I'm trying out jQuery for the first time on my little project and I am very excited about all the cool stuff. I'm trying to use the Facebox plugin as a dialog. It works great so far, but I need a way to close the dialog programatically instead of having the user click on the 'Close' button provided by the dialog window. The docs for Facebox indicate that I should be able to do this with the following statement: jQuery(document).trigger('close.facebox') But nothing happens when I execute this statement at all, and I don't get any javascript errors. Thoughts anyone? Thanks, Peter
[jQuery] Re: help with a strategy?
Much like how jquery keeps the javascript out of the HTML, it's so much cleaner to keep PHP out of the HTML as well. Have a look at the Smarty templating system for PHP. It's awesome. that's absolutely pointless, to start a new templating-engine-for-php- rant ... ;) php itself is a templating-language, it's fine to divide your application in tiers like MVC but still php is absolutely wonderful as *the* language to be used in the view. unless you have stupid UI- designers who think it's easier to learn yet-another-ugly-templating- language than to use simple php-syntax... i would stick to multi-dimensional arrays pushed via json, which is fairly lightweight. just my 0.02 euros ...
[jQuery] Re: Execute JavaScript that is added to the page by AJAX?
On 5 Mrz., 16:51, Jonny [EMAIL PROTECTED] wrote: I know that the people who are asking this question (through me) are not wanting to load a heavy js library (Jquery), so the advice below won't really work :( quite dangerous to call jquery heavy in this group, as it's one of the biggest feature of jquery being quite lightweight ;) but if you do not want to use jquery, just download the source and check the getscript-method, the main-parts should get you going. generally i think you need to pass some scope to your ajax-called- script which returns the java-script. then you may create a Map[scope_identifier] - [dom-target] and use that map when the jscript gets returned. of course the returning jscript has to transport the scope-identifier somehow, SCOPE_ID = 23623623... should be enough... when trying to defeat xss-protection of the browser, i think most people use hard-coded callback-functions like: script returned by ajax-called-script __xss_callback(function() { code to execute }); /script function __xss_callback(dlg) { // set right scope dlg.apply(scope, ) } i hope this gets you going but remember: jquery is not heavy (TM) ;)
[jQuery] Re: Evaluation ajax response data
On 5 Mrz., 04:47, jquertil [EMAIL PROTECTED] wrote: probably wont work though - maybe better to have the PHP script return a boolean true or false or 1 and 0 and then making sure your response type is value. i'm also using a boolean identifier like ACK = true, or ACK = false in the JSON-response if (ACK) { do ..} else { fail ...} this has the advantage that even if ACK is null or undefined the comparison evaluates to false and fails properly...
[jQuery] jQuery AJAX Dynamic File Download
I've got an export functionality built into my site, whereby users can choose which rows of a data table to export. They export by clicking an Actions dropdown and choosing Export. This triggers an AJAX call that posts which ids to export to a PHP script, which, in turn, builds an Excel document on the fly and delivers it to the user. Here is my code: input type=checkbox id=selected1 name=Interviews[] value=21 / input type=checkbox id=selected2 name=Interviews[] value=22 / ... inputs = []; $(#dataTableBody input[id^=selected]:checked).each(function() { inputs.push(this.name + '=' + escape(this.value)); }); $.ajax({ type: POST, data: inputs.join(''), url: /gateway/excel.php, success: function(){ return true; }, error: function(XMLHttpRequest, textStatus, errorThrown){ return false; } }); In Firebug, I'm getting the data in TSV format, but I'm not being presented the download dialog within my browser. If this was a straight file download, I would link directly to it, but the file has to be built dynamically. Can I set the dataType option in the ajax call to be file or something? What are my options?
[jQuery] Returning false if $.ajax() experiences an error
If a link has a click event I can stop that from firing by just returning false so that the browser stays on the current page. How would I do this when the click event is supposed to send a synchronous AJAX call using $.ajax()? I only want the click event to return false and stop the link from being followed if the AJAX request experiences an error.
[jQuery] Re: JQuery Hello world not working
also, i'm not saying it's wrong or bad sidecomment but i have literally never ever seen anyone have line breaks in the middle of their closing tags... / sidecomment On Mar 5, 10:33 am, J Moore [EMAIL PROTECTED] wrote: wow, the lag on this list is brutal. is there any way of reducing it, so people don't spend time responding to already-answered questions? On Mar 5, 9:34 am, J Moore [EMAIL PROTECTED] wrote: actually, your code doesn't display a link. it sets up an action when the link is clicked. You're missing: a href=#do something/a There might be other problems too if you aren't even seeing the alert message. Download firefox and firebug. IE isn't much help for developing javascript. -j On Mar 5, 5:16 am, pradeep_tp [EMAIL PROTECTED] wrote: Hi All, I am new to JQuery. I did the following to get started with JQuery. 1) Downloaded JQuery Uncompressed version. Renamed JQuery.1.2.3.js to JQuery.js (I do not know whether this is correct! ) 2) I followed the tutorial for Hello world and typed the following code into an HTML file html head script type=text/javascript src=jquery.js /script script type=text/ javascript alert('here'); $(document).ready(function() { $(a).click(function() { alert(Hello world!); }); }); / script / head body / body /html After opening this HTML file in IE 7.9, I find nothing on the page, not even any javascript error. The code is supposed to display a link, but I do not find any link on the page. Can anyone help me here. - pradeep
[jQuery] Re: append problem in ie7
I don't see my previous message... Try: $(this).text(resources[lang][id]); On 5 mar, 07:07, Don [EMAIL PROTECTED] wrote: hi guys, Im new to jquery. I have this problem and I think you guys can answer it. Here's the source code of the file that I am working on. The purpose of this script is to change the label into different language. - !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd; html head meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 / titletitle/title !-- jQuery -- script type=text/javascript src=js/jquery/jquery-1.2.3.js/ script style html, body { margin:0px; padding:0px; height:100%; } #userlist { border: 1px dashed red; position: fixed; top: 20px; z-index:500;} .group-box { border:1px solid gray; position:relative; width: 100px; height: 40px; text-align: center; margin: 5px; } .clickables * { border: 1px solid silver; background: yellow; margin: 4px; width: 100px; } #chart-box-container { border: 2px solid silver; width: 80%; height:95%; margin-left: 100px; background: white; z-index:1000; } /style script // the language resource object resources = { jp: { NO_REC: Wara lecolds, EXPLODE: Warat, NAME: Borat }, en: { NO_REC: There ain't nuthin here dawg., EXPLODE: See ya!, NAME: Whatcha called }} /script script type=text/javascript function changeLang(lang) { //alert(Change language to + lang); $(multilang).each(function() { id = $(this).attr(label); $(this).empty().append(eval(resources. + lang + . + id)); }); } $(document).ready(function(){ changeLang(jp); $(.clickables *).click(function(){ lang = $(this).attr(lang); changeLang(lang); }); }); /script /head body This defaults to Japanese. Click of the language below to change. div class=clickables div lang=jp[Japanese]/div div lang=en[English]/div /div hr/ This is the string multilang label='EXPLODE'/multilang. divIt can be anywhere in the DOM of course, like this: multilang label='NO_REC'/multilang. See?/div divIt can be anywhere in the DOM of course, like this: multilang label='EXPLODE'/multilang. See?/div label for=xmultilang label='EXPLODE'/multilang/labelinput id=x type=text/br/ label for=ymultilang label='NAME'/multilang/labelinput id=y type=text/ /body /html This work fine in FF. In ie7 I'm getting this error Unexpected call to method or property access. Line: 258 Character: 5 I guess this came from the append function in jquery. Thanks.
[jQuery] calling a php function with jquery
Hello ! I have a php function : helloUser in the file : myFunctions.php. This is my function : ... function helloUser($user) { return Welcome $user !; } ... I'm using jquery for an application but i don't know how to call a php function and give parameter (here :$user) and recover the result (here : welcome ...). Can somebody help me? Thanks a lot. -- View this message in context: http://www.nabble.com/calling-a-php-function-with-jquery-tp15853808s27240p15853808.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] jQuery Cycle - Hover Pager
Hi I am trying to create a pager that works with hovering over the links instead of clicking on them. Would this require an custom transition, or is there a way to add this to an existing transition like 'fade'. Thanks Andrej
[jQuery] Re: how to get the size of the image file before user upload it.
Hi all, I've had lots of run-ins with this sort of problem - lol - and basically ... 1: PHP cannot determine anything about a file until it has it on the server 2: Javascript can create an object, and fill it, and then check the size BUT the file also needs to be on the server which just leaves Flash - which kind of does the same thing, it uses actionscript to 'replace' the contents of a movie clip with the image and then waits till its loaded and then asks how big it is (dimensions). Flash is the only known way to get any dimension related information from an image before it is uploaded. What most people do is let clients upload an image and then use php to delete it (or GD library to modify it) if it doesnt meet your criteria. Unfortunately this means that clients can still innocently upload a HUGE image straight off their camera etc and have to wait for the upload process to complete before you can let them know it was all for nothing :-( Since flash can talk to javascript, the best way is to write a generic flash file that javascript can call - get the dimensions and report back to js - and then relay any information necessary to the client or upload the file. Hope this helps On Mar 5, 3:13 pm, Hamish Campbell [EMAIL PROTECTED] wrote: File size or dimensions? On Mar 4, 4:25 pm, Xinhao Zheng [EMAIL PROTECTED] wrote: hi all, is there a way to do this that can work both under ie and FF.thanks in advance. George
[jQuery] Re: Execute JavaScript that is added to the page by AJAX?
if you load the minified or packed version of jquery, and have gzip compression on your server (which everyone should have anyways), jquery is only around 15kb! is that heavy? On Mar 5, 10:51 am, Jonny [EMAIL PROTECTED] wrote: Ok, sorry, never mind, I guess there was just a delay in this post going live, sorry for my impatience :/ Just to clarify, this is not really a Jquery question, but this group seems to be the most active one that has AJAX experts in it, so that's why I posted it here. I know that the people who are asking this question (through me) are not wanting to load a heavy js library (Jquery), so the advice below won't really work :( - J On Mar 4, 2:54 pm, Jonny M [EMAIL PROTECTED] wrote: I posted this almost an hour ago and it is still not showing up in the Google Group... why? - Jonny On Tue, Mar 4, 2008 at 2:01 PM, Jonny [EMAIL PROTECTED] wrote: Basically, I have a JavaScript function (let's call the function displayDiv) that ends up writing a div to the page. If displayDiv is called within a table cell, the div will be added and displayed in that table cell. Now, what I'm trying to accomplish is replicating this behaviour with an AJAX function (let's call the function callAJAX) that returns HTML containing displayDiv and adding the code to a specific location in the page. I have tried this, problem is that the JavaScript returned from callAJAX was not executed. I then did some research and tried a few things: 1. I tried parsing out the JavaScript (displayDiv) from the returned HTML (callAJAX) and adding it to the head tag, which in theory, should be executed. This approach did not work for me because displayDiv writes a div to the page and from the head it would not know where to write the div. 2. I have tried parsing out the JavaScript (displayDiv) from the returned HTML (callAJAX) and executing it with EVAL() but this would not work because the AJAX function would not know where to write the div created within the displayDiv function. I guess what I'm hoping for is some magical piece of code that would tell the browser to parse the page again and execute the JavaScript that was added to the page by the AJAX function. I am posting this on behalf of a friend who is to busy today :) If anyone can tell me if this is even possible, and if so, where to go next, that would be most excellent! Many thanks, - Jonny
[jQuery] Re: Problem Targetting DIVs (Dynamic List Example)
In reply to my own mail, replacing: #QuickLinks gt; div:first With #QuickLinks div:first-child Seems to do the trick. Is this an acceptable fix? I'm interested to know if this was a browser (IE6/7, Firefox) issue or something in jQuery that I need to be aware of. Richard -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Richard Weeks Sent: 05 March 2008 13:37 To: jQuery (English) Subject: [jQuery] Problem Targetting DIVs (Dynamic List Example) Hi, can anyone tell me why this isn't displaying the default list automatically when the page loads? If you look in the code where the comments are, I think one of those places is where the problem is. I can't work it out however as I am fairly new to jQuery. html head titleQuick Links Tester/title style type=text/css.hide {display : none }/style script type=text/javascript src=jquery-1.2.3.min.js/ script script type=text/javascript $(function() { $(#QuickLinksSelect).show(); // The DIVs are dynamically named, so I can't just put // #0 here... ShowOrHideQuickLinks($(#QuickLinks gt; div:first)); $(select#QuickLinksSelect).change ( function() { var selectedQuickLink = # + $(select#QuickLinksSelect).val(); ShowOrHideQuickLinks(selectedQuickLink); } ); }); function ShowOrHideQuickLinks(quickLinkToShow) { // alert gives [object Object] on load, which is not expected. // alert gives #0 or #1 on select change, which is. alert(quickLinkToShow); $(#QuickLinks div).addClass(hide); $(quickLinkToShow).removeClass(hide); } /script /head body div id=QuickLinksContainer select id=QuickLinksSelect style=display:none option value=0Default.../option option value=11/option /select div id=QuickLinks div id=0 ul lia href=#Default (1)/a/li lia href=#Default (2)/a/li lia href=#Default (3)/a/li lia href=#Default (4)/a/li /ul /div div id=1 ul lia href=#1 (1)/a/li lia href=#1 (2)/a/li lia href=#1 (3)/a/li lia href=#1 (4)/a/li /ul /div /div /div /body /html Many thanks in advance. If anyone is interested, my full example includes using a cookie to remember your choice. I can post full code if I can just get the above code working :) Richard
[jQuery] Re: .html() callback?
I think the OP is adding elements to the dom, and then wondering why the events for the new elements aren't working. you're looking for the fabulous livequery plugin: http://brandonaaron.net/docs/livequery/ so long, kai
[jQuery] Re: append problem in ie7
Try: $(this).text(resources[lang][id]); On 5 mar, 07:07, Don [EMAIL PROTECTED] wrote: hi guys, Im new to jquery. I have this problem and I think you guys can answer it. Here's the source code of the file that I am working on. The purpose of this script is to change the label into different language. - !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd; html head meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 / titletitle/title !-- jQuery -- script type=text/javascript src=js/jquery/jquery-1.2.3.js/ script style html, body { margin:0px; padding:0px; height:100%; } #userlist { border: 1px dashed red; position: fixed; top: 20px; z-index:500;} .group-box { border:1px solid gray; position:relative; width: 100px; height: 40px; text-align: center; margin: 5px; } .clickables * { border: 1px solid silver; background: yellow; margin: 4px; width: 100px; } #chart-box-container { border: 2px solid silver; width: 80%; height:95%; margin-left: 100px; background: white; z-index:1000; } /style script // the language resource object resources = { jp: { NO_REC: Wara lecolds, EXPLODE: Warat, NAME: Borat }, en: { NO_REC: There ain't nuthin here dawg., EXPLODE: See ya!, NAME: Whatcha called }} /script script type=text/javascript function changeLang(lang) { //alert(Change language to + lang); $(multilang).each(function() { id = $(this).attr(label); $(this).empty().append(eval(resources. + lang + . + id)); }); } $(document).ready(function(){ changeLang(jp); $(.clickables *).click(function(){ lang = $(this).attr(lang); changeLang(lang); }); }); /script /head body This defaults to Japanese. Click of the language below to change. div class=clickables div lang=jp[Japanese]/div div lang=en[English]/div /div hr/ This is the string multilang label='EXPLODE'/multilang. divIt can be anywhere in the DOM of course, like this: multilang label='NO_REC'/multilang. See?/div divIt can be anywhere in the DOM of course, like this: multilang label='EXPLODE'/multilang. See?/div label for=xmultilang label='EXPLODE'/multilang/labelinput id=x type=text/br/ label for=ymultilang label='NAME'/multilang/labelinput id=y type=text/ /body /html This work fine in FF. In ie7 I'm getting this error Unexpected call to method or property access. Line: 258 Character: 5 I guess this came from the append function in jquery. Thanks.
[jQuery] Re: Moving select box options up and down
Excellent. Thanks a lot! On Mar 5, 4:56 pm, Matt Kruse [EMAIL PROTECTED] wrote: On Mar 5, 5:14 am, Diddly Doo [EMAIL PROTECTED] wrote: a small amount of effort Easier said than done! If I made a donation to your site would you do it for me? Let me now how much. I just wrote the wrapper and put it up, so you can now use all the functions as jQuery functions:http://www.javascripttoolbox.com/lib/selectbox/jquery.php Matt Kruse
[jQuery] Re: quicktime player and thickbox issue
I solved my problem using jquery.media.js ~Steve http://goodcf.instantspot.com/blog Steve Good wrote: I have a thickbox modal window, in which I have embedded a wav file. The wav file is being played through the quicktime player plugin. The audio plays fine, but when I open a newly created modal window, more often then not, the player doesn't actually show. Instead I see the gray overlay that is behind the modal window. I ran across a script that redraws an element in the window, which supposedly causes the qt player to be redrawn. However, this method doesn't seem to work for me. Has anyone come across this issue before? If so, how did you overcome it? Here's the code that I tried using without any luck. I put it down just above the /body tag. |script type=text/javascript $(document).ready(function() { closeButton = document.getElementById(TB_closeWindowButton); color = closeButton.style.color; closeButton.style.color = white; closeButton.style.color = color; }); /script| I replaced the element ID with one that I was using in my window. Thanks!
[jQuery] Error?
This is the error that firebug returns. Can any one help? -- dr.drummer inline: fireBugError.JPG
[jQuery] Jörn's autocomplete: submitting to a functi on
For reasons beyond my control I am finding myself needing to send an Ajax request to a different plugin that is not jQuery (ajax4jsf). Another Ajax related plugin I use allows for submitting information to a function, which we used as kind of a gateway between the two systems. I call the function with the needed info, the function posts to ajax4jsf. I have already spent some time trying to retrofit autocomplete to allow submitting to a function, but just wanted to check in to make sure I'm not trying to do something that is already in the works, or that someone has done on the side. Any tips on existing efforts, or best ways to accomplish this would be appreciated. Thanks, Aaron Barker
[jQuery] Re: EqualTo but only if checkbox is checked
[EMAIL PROTECTED] schrieb: And so is params and depends new functions that were not originally in the JQuery library? So do I have to update the core .js file on our app in order to use the params and depends on any validator method? The ticket is just that, a ticket. It isn't implemented yet - it would say fixed once its done. You're welcome to help speed things up, eg. by providing code (according to the description in the ticket) or other motivations. Jörn
[jQuery] Re: Jörn's autocomplete: submitting to a fu nction
Aaron Barker schrieb: For reasons beyond my control I am finding myself needing to send an Ajax request to a different plugin that is not jQuery (ajax4jsf). Another Ajax related plugin I use allows for submitting information to a function, which we used as kind of a gateway between the two systems. I call the function with the needed info, the function posts to ajax4jsf. I have already spent some time trying to retrofit autocomplete to allow submitting to a function, but just wanted to check in to make sure I'm not trying to do something that is already in the works, or that someone has done on the side. Any tips on existing efforts, or best ways to accomplish this would be appreciated. I don't quite get submit to a function yet. Do you want to use a function that provides the data for the autocomplete list? Or call the function with the selected value as an argument? The latter is possible using the result-method: http://jquery.bassistance.de/api-browser/plugins.html#resultFunction The first option needs modifications or some trickery. One trick you could try: Proxy $.ajax (http://docs.jquery.com/Types#Proxy_Pattern) and delegate all autocompleted requests to your function, call the success-option manually. Jörn
[jQuery] Re: Fade font color
What are you trying to fade from what to what? Like is the before and after colors both visible? (like for instance blue text on a white background to red text on a white background?) If that's the case, running some sort of counter from one hex value to the other would be the way to go
[jQuery] Re: Error?
Google that error. It's a problem with Firefox. I know I've had the problem and fixed it, but can't remember what I needed to be done. I know I found the answer on Google though. -Dan _ From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of dr.dummer Sent: Wednesday, March 05, 2008 2:35 PM To: jquery-en@googlegroups.com Subject: [jQuery] Error? This is the error that firebug returns. Can any one help? -- dr.drummer
[jQuery] IE8
I was pretty excited to download IE8 today. All the jQuery stuff in my app seems to work fine. The debugger is pretty nice. I've always had trouble finding bugs in IE. Anyone find any IE8 jQuery problems yet?
[jQuery] Re: Fade font color
Try this one: http://plugins.jquery.com/project/color Karl Rudd On Thu, Mar 6, 2008 at 6:11 AM, Bryan Migliorisi [EMAIL PROTECTED] wrote: I am trying to find a way to fade the fore color of the font. I know I can fade the background color of an element, but I would like to fade the color of the font itself. Has anyone been able to do this? Any plugins around that do this?
[jQuery] Re: IE8
Did IE8 overwrite IE7 or can it work standalone? Rey timothytoe wrote: I was pretty excited to download IE8 today. All the jQuery stuff in my app seems to work fine. The debugger is pretty nice. I've always had trouble finding bugs in IE. Anyone find any IE8 jQuery problems yet?
[jQuery] Re: IE8
It seemed to overwrite IE7, but it has an IE7 mode. I only did it on one computer. On Mar 5, 1:41 pm, Rey Bango [EMAIL PROTECTED] wrote: Did IE8 overwrite IE7 or can it work standalone? Rey timothytoe wrote: I was pretty excited to download IE8 today. All the jQuery stuff in my app seems to work fine. The debugger is pretty nice. I've always had trouble finding bugs in IE. Anyone find any IE8 jQuery problems yet?
[jQuery] Re: Multiple Selector Iterator short-cut
If it's an id with a prefix (let's say the prefix is blah) then you could write: $('[id^=blah') Be aware though that this will could be low as it will effectively check the id of _every_ element on the page. If you can narrow down the type of the element you're looking for, say to a DIV, then you could write a much faster: $('div[id^=blah]') Karl Rudd On Thu, Mar 6, 2008 at 12:06 AM, Anjanesh [EMAIL PROTECTED] wrote: Is there a way to reduce this $(#id1, #id2, #id3, #id4, #id5, #id6, #id7, #id8, #id9, #id10).click(function() { ... }); to something like this $(#id[1-10]).click(function() { ... }); ?
[jQuery] Re: Can I use jQuery to superimpose one image over part of another?
That was easy! Thanks, - Dave On Mar 4, 8:35 pm, Karl Swedberg [EMAIL PROTECTED] wrote: Ah, I get it. yeah. you want to add the image via jQuery? Well, keep the css, but now do this: $(document).ready(function() { $('img src=image3.gif alt= /').appendTo('#imageDisplay'); }); --Karl _ Karl Swedbergwww.englishrules.comwww.learningjquery.com On Mar 4, 2008, at 6:59 PM, [EMAIL PROTECTED] wrote: Hi Karl, Thanks for the reply but when the page initially loads, there is no image3 in the DIV div id=imageDisplay align=center img id=backside name=backside alt= width=200 src=image1.gif / img id=frontside name=frontside alt= width=200 src=image2.gif / /div so wouldn't I have to add it to the DOM somehow? - Dave On Mar 3, 9:03 pm, Karl Swedberg [EMAIL PROTECTED] wrote: Hi Dave, You could easily make this happen with CSS alone, or am I missing something? #imageDisplay { position: relative; width: 200px; overflow: hidden; } #image3 { /* give it whatever id you want */ position: absolute; left: 100px; } --Karl _ Karl Swedbergwww.englishrules.comwww.learningjquery.com On Mar 3, 2008, at 4:44 PM, [EMAIL PROTECTED] wrote: Hi, Let's say I have this HTML div id=imageDisplay align=center img id=backside name=backside alt= width=200 src=image1.gif / img id=frontside name=frontside alt= width=200 src=image2.gif / /div and then I have another image, image3.gif. I would like to layer image3.gif 100 pixels from the left most coordinate of image1.gif so that it appears on top of the other two images. The parent DIV, imageDisplay, is relatively positioned. Is there a way, using jQuery, to do what I'm asking that works in both IE and Firefox, don't care about the other browsers for now. Thanks, - Dave- Hide quoted text - - Show quoted text -- Hide quoted text - - Show quoted text -
[jQuery] Dell.com is using jQuery 1.2.2
Just a quick note to say that I noticed today that Dell.com is using jQuery v. 1.2.2 Go to dell.com and look at the source for yourself if you want. It looks like they're using some version of thickbox or something too. Click on My Account and a modal-type window comes up for a login. Pretty damn sweet if you ask me. Has anyone raised a pint to jQuery recently? The jquery dev teams and this community ought to be damn proud of the work they've done! Cheers! Chris -- http://cjordan.us
[jQuery] Re: IE8
Tim, can you point me to the download link? On 3/5/08, timothytoe [EMAIL PROTECTED] wrote: It seemed to overwrite IE7, but it has an IE7 mode. I only did it on one computer. On Mar 5, 1:41 pm, Rey Bango [EMAIL PROTECTED] wrote: Did IE8 overwrite IE7 or can it work standalone? Rey timothytoe wrote: I was pretty excited to download IE8 today. All the jQuery stuff in my app seems to work fine. The debugger is pretty nice. I've always had trouble finding bugs in IE. Anyone find any IE8 jQuery problems yet? -- Benjamin Sterling http://www.KenzoMedia.com http://www.KenzoHosting.com http://www.benjaminsterling.com
[jQuery] Re: IE8
http://www.microsoft.com/windows/products/winfamily/ie/ie8/readiness/Install.htm On Mar 5, 2:52 pm, Benjamin Sterling [EMAIL PROTECTED] wrote: Tim, can you point me to the download link? On 3/5/08, timothytoe [EMAIL PROTECTED] wrote: It seemed to overwrite IE7, but it has an IE7 mode. I only did it on one computer. On Mar 5, 1:41 pm, Rey Bango [EMAIL PROTECTED] wrote: Did IE8 overwrite IE7 or can it work standalone? Rey timothytoe wrote: I was pretty excited to download IE8 today. All the jQuery stuff in my app seems to work fine. The debugger is pretty nice. I've always had trouble finding bugs in IE. Anyone find any IE8 jQuery problems yet? -- Benjamin Sterlinghttp://www.KenzoMedia.comhttp://www.KenzoHosting.comhttp://www.benjaminsterling.com
[jQuery] Re: IE8
One thing I noticed is that the JavaScript is still painfully slow, but perhaps there is a lot of debug stuff in there slowing it down. What takes 7 seconds in Safari and 8 in Firefox 3b3 takes 25 seconds in IE8! (28 seconds in IE6). On Mar 5, 2:54 pm, timothytoe [EMAIL PROTECTED] wrote: http://www.microsoft.com/windows/products/winfamily/ie/ie8/readiness/... On Mar 5, 2:52 pm, Benjamin Sterling [EMAIL PROTECTED] wrote: Tim, can you point me to the download link? On 3/5/08, timothytoe [EMAIL PROTECTED] wrote: It seemed to overwrite IE7, but it has an IE7 mode. I only did it on one computer. On Mar 5, 1:41 pm, Rey Bango [EMAIL PROTECTED] wrote: Did IE8 overwrite IE7 or can it work standalone? Rey timothytoe wrote: I was pretty excited to download IE8 today. All the jQuery stuff in my app seems to work fine. The debugger is pretty nice. I've always had trouble finding bugs in IE. Anyone find any IE8 jQuery problems yet? -- Benjamin Sterlinghttp://www.KenzoMedia.comhttp://www.KenzoHosting.comhttp://www.benjam...
[jQuery] Re: calling a php function with jquery
if you look up the docs for $.ajax() function you will see how to pass variables to the PHP from your calling page. for example: $.ajax({ type: POST, url: some.php, data: name=Johnlocation=Boston, success: function(msg){ alert( Data Saved: + msg ); } }); On Mar 5, 9:18 am, everdream [EMAIL PROTECTED] wrote: Hello ! I have a php function : helloUser in the file : myFunctions.php. This is my function : ... function helloUser($user) { return Welcome $user !;} ... I'm using jquery for an application but i don't know how to call a php function and give parameter (here :$user) and recover the result (here : welcome ...). Can somebody help me? Thanks a lot. -- View this message in context:http://www.nabble.com/calling-a-php-function-with-jquery-tp15853808s2... Sent from the jQuery General Discussion mailing list archive at Nabble.com.