Re: [jQuery] Autocomplete plugin: update for jQuery 1.01
Simple explanation: e.preventDefault prevents the default event from happening jQuery should make this available in ie are you sure you have the right event as e? On 9/2/06, Geoff Knutzen [EMAIL PROTECTED] wrote: Hi Dylan, Thanks for making your autocomplete plugin for jquery. This is my first adventure with jquery. So far I really like it. I do have a question for you about your plugin. What is the purpose of e.preventDefault(); in the keydown function? The reason I ask is because I have been pretty successful at modifying your original plugin to work with my data on a test html file. But now when I try and place the autocomplete script on my main html page, I am getting an error in ie because of these statements. If I comment it them out, all is okay. Error: object doesn't support this property or method. It seems that preventDefault() is not a property of e at this point. (it is on FF) So I am wondering a bunch of things Am I missing something by commenting them out? What is there purpose? Why does this work on my test page and not on my original page? (you won't be able to answer that, I know) Again, thanks a bunch for making this plugin -Geoff ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Menu with SelectBox showing through
There are several plugins that tackle this same problem. With the help of the people on the list, I found a nice solution that works with an iframe, but in a simpler way than most. You can see it work in http://www.dyve.net/jquery?autocomplete, I don't have my references here to point you to the original idea. It's somewhere on this list as well. On 9/1/06, Lipka, Glen [EMAIL PROTECTED] wrote: I am using jQuery for a drop down menu. Currently, select boxes are showing through the menu. On the date picker plugin, he appends an iFrame behind the menu. Is this the best way or is there an easier way to achieve the desired effect? Thanks, Glen Lipka | Sr. UI Designer, WCG | Intuit Inc. | ext. 46435 | Cell: 510.701.8203 ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] jCarousel
Woo woo! I was working on a carrousel myself, but I'm hopping on your bus now! Great work, really slick stuff! On 9/2/06, jsorgalla [EMAIL PROTECTED] wrote: Hi there, i'm the next one staying in the line of jQuery plugin authors. I've created a new plugin called jCarousel. Its inspired by Bill Scott's Carousel Component for YUI. Check it out at http://sorgalla.com/pages/jcarousel.html and let me know what you think. Thanks, Jan -- View this message in context: http://www.nabble.com/jCarousel-tf2205628.html#a6108635 Sent from the JQuery forum at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] eval.call( window,jscode) does not work in IE
I created a ticket for this issue here: http://proj.jquery.com/dev/bugs/bug/171/ I'll get to it ASAP. --John On 9/1/06, ashutosh bijoor [EMAIL PROTECTED] wrote: That's IT, Francisco! That does the trick. In jquery svn, we need to change the following lines: Line number 4910: eval.call( window, this.text || this.textContent || this.innerHTML || ); should be changed to {var src=window, this.text || this.textContent || this.innerHTML || ; window.evalScript?window.evalScript(src):eval.apply(window,src);} Unfortunately this does not work: (window.evalScript?window.evalScript:eval).apply(window,this.text || this.textContent || this.innerHTML || ); Similarly, line 5134: if ( type == script ) eval.call( window, data ); should be changed to: if ( type == script ) {window.evalScript?window.evalScript(data):eval.call( window, data );} John, pls do the needful. Thanks Regards Ashutosh On 9/1/06, Francisco Brito [EMAIL PROTECTED] wrote: Use window.execScript for IE. (some switch would be needed, such as:) (window.execScript || self.eval)(script); cheers Brito On 9/1/06, ashutosh bijoor [EMAIL PROTECTED] wrote: The solution suggested earlier for executing javascript code embedded in HTML returned by an ajax call by using eval.call(window,...) works great in FF, but not in IE6. eval.call(window,jscode) still executes in the context of the block in which eval is called. Hence, any functions that are defined in the loaded javascript are not available outside. i tried all kinds of things to get around this such as : with (window) { eval(jscode); } I thought maybe the prototype guys have cracked this problem, but alas - they do not even do the eval.call (window,...) so I expect their code will not even work in FF. Any suggestions? How can we change the execution context of eval? Regards Ashutosh On 8/17/06, ashutosh bijoor [EMAIL PROTECTED] wrote: On a related issue to load, I was running into trouble with the embedded script execution that jquery does by default as follows: // Execute all the scripts inside of the newly-injected HTML $(script, self).each(function(){ eval( this.text || this.textContent || this.innerHTML || ); }); I noticed in my tests in FF 1.5, that if there are any functions defined in the script tags, these functions have scope only in the block containing the eval - in this case, the callback function for each, and hence these are unavailable in the global scope. To circumvent this problem, I did the following: // Execute all the scripts inside of the newly-injected HTML $(script, self).each(function(){ eval.call(window,this.text || this.textContent || this.innerHTML || ); }); This solves the problem of making the scripts globally scoped. I also noticed during my tests that the scripts which loaded external js files were also giving me trouble. But before I suggest my solution for the same, I'd like some inputs on whether this problem is genuine. To illustrate the above problems, assume we make an ajax call as follows: $('#mydiv').load('test.html'); and test.html contained: script type=text/javascript function myfunc() { alert(Hi); } /script script type=text/javascript src=myfile.js input type=button value=click here onclick=myfunc() input type=button value=click here too onclick=myotherfunc() And myfile.js contained : function myotherfunc() { alert(MyOtherFunc); } Now once test.html is loaded in mydiv, if we click on the two buttons, we should expect the respective alerts, right? Well no - it did not work that way for me. And then with a little bit of digging, I found the following: 1. The first script was indeed executed, but the myfunc() was defined only in the scope of the eval block. So the above fix worked for solving this problem. 2. For the other script tag script type=text/javascript src= myfile.js, somehow myfile.js did not get loaded at all! For now, I've fixed this in a round-about way by actually adding a script tag to the head etc. But would appreciate if someone could give me inputs regarding this problem. Does it behave the same in other browsers? Or is it just my browser? Or just me :-) Regards Ashutosh On 8/17/06, Taku Sano (Mikage Sawatari) [EMAIL PROTECTED] wrote: With Ajax facilities of jQuery, it is not easy to deal with errors. In addition, it is inconvenient to repeat reloading the same URL to observe changes. Please confirm my patch handles these issues. [patch for svn.208]
Re: [jQuery] Bugs in 1 and 1.01
It seems that set (both name:value and hash) is not working, as well as removeclass on multiple classes (and, of course, toggleclass with multiple classes). In 1.0, .set is now .attr - I made this particular change as it was much clearer, and now affords you with the ability to do: $(div).attr(height) to get the height of the first element matched (for example) I'm not sure if removeClass and toggleClass ever worked on multiple classes - but if they did, cool :-) I'll have to see if I can get those features back in. --John ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Tests that crash Safari
That's such a strange bug. There's a weird bug occurrng in IE too - I'm probably going to re-write the test suite soon to fix this. Here's the bug report: http://proj.jquery.com/dev/bugs/bug/173/ --John Trial and error (and a lot of Saft recovering my tabs) indicates that these are the culprits: tests/10-jQuery.find.js: ... t( Checked UI Element, input:checked, [radio2,check1] ); ... t( Is Visible, input:visible, [text1,text2,radio1,radio2,check1,check2] ); t( Is Hidden, input:hidden, [hidden1,hidden2] ); Haven't had time to figure out what the actual issue is, but I'm guessing there's something funny about input objects in Safari. :) ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Animation dimensions - problem and solution
I've fixed this and checked it in to SVN - this'll be in the next point release (probably 1.0.2). Thanks! --John On 8/31/06, Alistair Potts [EMAIL PROTECTED] wrote: When jquery tries to get the height of a (display:none) element, it clones the element as (visiblity:hidden display:block), appends it to the BODY, calculates the dimensions, and removes it. Which is all very clever. The problem comes that if you style your element using css selectors, then you have to ensure that the css is valid when the above 'trick' takes place. For instance, say we had a paragraph with padding defined in the css like this: div p { padding: 10px; display: none; } div pyadda bla/p /div jquery will not work as expected if you do animation on it, for instance to make it slide into view. The calculation of the height won't take into account the padding, because the cloning method won't 'see' the css. Solution: always use ids and classes, but don't nest them in the css; e.g. p.invisible { padding: 10px; display: none; } div p class=invisibleyadda bla/p /div The css will always be valid regardless of where the paragraph is in the DOM. Thought this might be useful! ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] problem with $(TAGNAME, httprequest.responseXML) with certain browsers
Mario - yes I first encountered the problem with an earlier version. I now replaced the old version of jQuery with the version you specified and replaced the deprecated syntax. The problem still persists. In a responseXML containing XML without namespaces, Opera and FF find all the elements and IE finds nothing. If the responseXML contains namespaces but doesn't use prefixes, FF and Opera find all the elements (ignoring the namespaces of the elements) and IE finds nothing. If the responseXML contains both namespaces prefixes, no browser finds the elements (but I guess for different reasons). I don't know if the mailing list accepts attachments so I'll include the test case I used here: Thanks for the great test case, I'll be checking into this. Ticket: http://proj.jquery.com/dev/bugs/bug/174/ --John ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] Interface: Question about Blind Up/Down
It was a bug in Blind, fold and open/close. I fixed this, download the Interface again ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] Synchronizing
Hi folks, is there any way to synchronize calls in javascript without using callbacks? Example: doSomething(); reset(); doSomethingElse(); Reset calls some asychronous code and I don't want it to return until the call is complete. The obvious solution is to pass doSomethingElse as a callback for reset, but that makes it very difficult in the given scenario. Any ideas? -- Jörn ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Bugs in 1 and 1.01
Great! I could have sworn some of the docs and visualjquery (nice work Yehuda) still had set yesterday, but I'm seeing attr now. When I'm debugging jquery problems, I have a habit of switching between three or four different versions I have kicking around, and I know one of them did work with toggle/remove on multiple classes. I'll see if I can find it. John Resig wrote: It seems that set (both name:value and hash) is not working, as well as removeclass on multiple classes (and, of course, toggleclass with multiple classes). In 1.0, .set is now .attr - I made this particular change as it was much clearer, and now affords you with the ability to do: $(div).attr(height) to get the height of the first element matched (for example) I'm not sure if removeClass and toggleClass ever worked on multiple classes - but if they did, cool :-) I'll have to see if I can get those features back in. --John ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Synchronizing
Hi folks, is there any way to synchronize calls in javascript without using callbacks? You could use a sort of proof of concept I wrote months ago: http://fmarcia.info/jquery/chain. I'm not sure it'll work with the latest version of jQuery though. Franck. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Issue with adding to tables.
On 9/2/06, Gordon Heydon [EMAIL PROTECTED] wrote: Hi,I have implemented a page where I have jQuery cloning the last row andextending the table,I have the table that I am extending in a div which I use the jq-cornersto make it look pretty.The problem that I am getting is that when the table is extending that page isn't. So what happens is that stuff starts disappearing of thebottom of the page.I don't think I have all the information for someone to help me, soplease bear with me and I will provide any information required. If someone can help get the page to extend at the same rate as thetable, I would appreciated it alot.Thanks in advance.Gordon.Gordon,Basically what you need to do is extend the height of the div to match the growing height of the table. Without seeing a test case, I don't know if (a) the div has room to grow before it needs to be expanded, or if (b) the first time you clone a row, the div needs expanded.If (a) is true then loop through the height of all the elements with the div as their parent adding up their heights (totalChildrenHeight). if totalChildrenHeight div height, then get the difference and expand the div accordingly. Note - you may have to make concessions for padding and margins. if (b) add the height of the row to the height of the div.Hope this helps. :)Regards,-- Shawn TumeyCofounderMT Web Productions LLC ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Interface: Question about Blind Up/Down
Stefan, Thanks for the update. It works great now. Jim On 9/2/06, Stefan Petre [EMAIL PROTECTED] wrote: It was a bug in Blind, fold and open/close. I fixed this, download the Interface again ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] Interface and Safari?
I've had reports that Interface, particular the slideshow, doesn't work in Safari. Can anyone corroborate and/or figure out how to fix it? g -- Morbus Iff ( worship the computer and continue to live ) Technical: http://www.oreillynet.com/pub/au/779 Culture: http://www.disobey.com/ and http://www.gamegrene.com/ icq: 2927491 / aim: akaMorbus / yahoo: morbus_iff / jabber.org: morbus ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Interface and Safari?
@ Morbus Iff [EMAIL PROTECTED] : I've had reports that Interface, particular the slideshow, doesn't work in Safari. Can anyone corroborate and/or figure out how to fix it? g It's true. It stays in the loading state forever*, while Safari is doing nothing (not trying to download an image). * http://fil.rezo.net/slideshow_safari.png But before being in that state, it first displays two pictures of cars, floating above the gray square. -- Fil ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] Charset and load()
Hi, When loading HTML with the load()-function in jQuery, Danish characters like æ, ø, å, Æ, Ø, Å etc. shows up like question marks. How and where should I configure the charset? When I open the site I want to load directly in Firefox, nothing is wrong with the charset - only when loading with jQuery. Apart from this, jQuery is the best thing that ever happened to DOM scripting! Best regards, Søren Haagerup ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Using xpath: can't find relative href
Dave Methvin wrote: In all browsers, or just IE? That's a quirk of IE that it changes relative URLs to absolute. http://www.glennjones.net/Post/809/getAttributehrefbug.htm I thought there was a getAttribute(,2) fix in jQuery for this already. Hi Dave. I got the same behavior in Firefox, IE, and Opera. Klaus Hartl wrote: Or change the selector to this: $([EMAIL PROTECTED]'/my/relative/url']) Thanks, Klaus, I don't know why I overlooked that before. I guess I was looking on the XPath page on jQuery.com, and the syntax was right there on the CSS page. This will work just fine for me. -- View this message in context: http://www.nabble.com/Using-xpath%3A-can%27t-find-relative-href-tf2199426.html#a6104002 Sent from the JQuery forum at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Submit a form?
Myles Angell wrote: $(#report-form).get(0).submit(); Return false isn't neccessary On 9/1/06, *Lewis, David* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Using jQuery, is there an easy way to find a form in an HTML document, submit it, then return false (to avoid resubmission of the form). Using the HTML snippet: form id=report-form action=test_charts.jsp method=post input type=text name=chart_value value=Test chart value / input id=report-submit type=submit value=Chart it! / /form … and the Javascript: $('#report-submit').click(function() { $('#report-form').submit(); return false; /* cancel the form submission */ }); … the form does not appear to be submitted. Thanks in advance for any help! ~ David ___ jQuery mailing list discuss@jquery.com mailto:discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ attachment: trial_1.jpg ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Synchronizing
On Sat, 2 Sep 2006, John Resig wrote: Neil Mix has released a library that lets you write Javascript code just like that: http://www.neilmix.com/narrativejs/doc/index.html Wow, that is really impressive. I've been thinking about different ways to approach the sync vs. async barrier. One approach has been to chain functions together, which I've described here: http://dev.bestpartyever.com/2006/08/05/taking-the-pain-out-of-async/ Lately I've been experimenting with Parenscript, which is a Lisp-to-JavaScript translator that allows you to write macros; if anyone's interested I can post some sequencing macro code I've been working on... =) Dave ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Synchronizing
Lately I've been experimenting with Parenscript, which is a Lisp-to-JavaScript translator that allows you to write macros; if anyone's interested I can post some sequencing macro code I've been working on... Go ahead! I'm interested :-) --John ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Synchronizing
On Sat, 2 Sep 2006, John Resig wrote: Lately I've been experimenting with Parenscript, which is a Lisp-to-JavaScript translator that allows you to write macros; if anyone's interested I can post some sequencing macro code I've been working on... Go ahead! I'm interested :-) Right on. So, for a simple example, here's a snippet of Parenscript code that creates a DIV, puts some text in it, and fades it in, out, and back in again: (.append #$body (html ((:div :id mydiv :style (css-inline :background white)) Hello, world!))) (seq (.fade-in #$div #mydiv slow) (.fade-out #$div #mydiv slow) (.fade-in #$div #mydiv fast))) A few notes about the syntax: The #$ is a reader-macro I wrote for for convenience; #$body gets transformed into ($ body). I haven't yet decided if this is a good thing or not. ;) In Parenscript, functions that start with a . such as .append and .fade-in, above, are treated as method calls. Capitalization is translated by Parenscript from Lisp-style to JavaScript-style, which is why the jQuery methods end up looking like .fade-in. The html and css-inline macros are part of Parenscript, and allow you to generate JavaScript that builds HTML and CSS from s-expressions. The sequencing macro is seq. The above seq call gets transformed into the following: (.fade-in #$div #mydiv slow (lambda () (.fade-out #$div #mydiv slow (lambda () (.fade-in #$div #mydiv fast) The resulting JavaScript is this: function main() { $('body').append('div id=mydiv style=' + ('background:white') + 'Hello, world!/div'); $('div #mydiv').fadeIn('slow', function () { $('div #mydiv').fadeOut('slow', function () { $('div #mydiv').fadeIn('fast'); }); }); } So, this has similar effects to what I think you're trying to achieve with method chaining, but is more general because you are not limited to a single jQuery object for the dispatch of each chained operation. Here's my working definition of seq: (defjsmacro seq (rest forms) (labels ((aux (lst) (cond ((null lst) nil) ((and (consp lst) (not (cdr lst))) (car lst)) (t (append (car lst) (list `(lambda () ,(aux (cdr lst) (aux forms))) I'd like to extend it to allow inserting ordinary code in the middle of the sequence with a par construct - I'm lifting this terminology out of an interesting but obscure concurrent language called Occam: http://en.wikipedia.org/wiki/Occam_programming_language Ironically, in an event-driven model, par is really the default behavior. When working with background functions, everything is parallel; you have to really work at making things sequential. Dave ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Issue with adding to tables.
Hi, Thanks for this, This helps a lot and is quite logical. thanks. Gordon. Shawn Tumey wrote: On 9/2/06, *Gordon Heydon* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Hi, I have implemented a page where I have jQuery cloning the last row and extending the table, I have the table that I am extending in a div which I use the jq-corners to make it look pretty. The problem that I am getting is that when the table is extending that page isn't. So what happens is that stuff starts disappearing of the bottom of the page. I don't think I have all the information for someone to help me, so please bear with me and I will provide any information required. If someone can help get the page to extend at the same rate as the table, I would appreciated it alot. Thanks in advance. Gordon. Gordon, Basically what you need to do is extend the height of the div to match the growing height of the table. Without seeing a test case, I don't know if (a) the div has room to grow before it needs to be expanded, or if (b) the first time you clone a row, the div needs expanded. If (a) is true then loop through the height of all the elements with the div as their parent adding up their heights (totalChildrenHeight). if totalChildrenHeight div height, then get the difference and expand the div accordingly. Note - you may have to make concessions for padding and margins. if (b) add the height of the row to the height of the div. Hope this helps. :) Regards, -- Shawn Tumey Cofounder MT Web Productions LLC !DSPAM:1000,44f99a7c109411804284693! ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ !DSPAM:1000,44f99a7c109411804284693! ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Issue with adding to tables.
Hi again. Thanks again, this worked perfectly. The strange thing is that the docs over at visual docs says that $('div').height() will return 'nnpx', where as I was only getting nn. Getting it as just nn, is great as I can just add the new height, but I don't know what other browsers are going to give me. Gordon. Shawn Tumey wrote: On 9/2/06, *Gordon Heydon* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Hi, I have implemented a page where I have jQuery cloning the last row and extending the table, I have the table that I am extending in a div which I use the jq-corners to make it look pretty. The problem that I am getting is that when the table is extending that page isn't. So what happens is that stuff starts disappearing of the bottom of the page. I don't think I have all the information for someone to help me, so please bear with me and I will provide any information required. If someone can help get the page to extend at the same rate as the table, I would appreciated it alot. Thanks in advance. Gordon. Gordon, Basically what you need to do is extend the height of the div to match the growing height of the table. Without seeing a test case, I don't know if (a) the div has room to grow before it needs to be expanded, or if (b) the first time you clone a row, the div needs expanded. If (a) is true then loop through the height of all the elements with the div as their parent adding up their heights (totalChildrenHeight). if totalChildrenHeight div height, then get the difference and expand the div accordingly. Note - you may have to make concessions for padding and margins. if (b) add the height of the row to the height of the div. Hope this helps. :) Regards, -- Shawn Tumey Cofounder MT Web Productions LLC !DSPAM:1000,44f99a7c109411804284693! ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ !DSPAM:1000,44f99a7c109411804284693! ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] no action after $.load.. why?
Hey, i'd like to know why it happens..The code:$(document).ready( function(){ $(#main).load(get_calcform.php,{ idref: iditem }, function(txt){ $(#main).html(txt); } );$(#calculate).click( function(){ alert('hi'); });//output - form method=post//some inputsinput type='button' value='calculate' id='calculate'/formthen nothing happens when Calculate is clicked... Even if i change it (without form tag and submit button):...function(txt){ $(#main).html(txt+a id='calculate'calculate it/a); }...But if i do $(#main).html(txt+a id='calculate' hmm it works')'calculate it/a); IT WORKS..Am i doing something wrong? ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Charset and load()
Hmm... I'm not entirely sure why this might be happening. what happens if you copy-and-paste the page that you're loading in, in to the page that you're loading in to. In other words, you have: pageA.html script $(#foo).load(pageB.html); /script div id=foo/div pageB.html: æ, ø, å, Æ, Ø, Å etc Now just copy the contents from pageB.html into the div in pageA and see if it renders correctly. If it doesn't - could you try and make a test case for me, so that I can hunt it down? Thanks. --John When loading HTML with the load()-function in jQuery, Danish characters like æ, ø, å, Æ, Ø, Å etc. shows up like question marks. How and where should I configure the charset? When I open the site I want to load directly in Firefox, nothing is wrong with the charset - only when loading with jQuery. Apart from this, jQuery is the best thing that ever happened to DOM scripting! ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] no action after $.load.. why?
$load automatically loads the result of that request into the selected DIV, so in that case you wouldnt need a callback.On 9/3/06, Rafael Santos [EMAIL PROTECTED] wrote:Hey, i'd like to know why it happens.. The code:$(document).ready( function(){ $(#main).load(get_calcform.php,{ idref: iditem }, function(txt){ $(#main).html(txt); } );$(#calculate).click( function(){ alert('hi'); });//output - form method=post//some inputsinput type='button' value='calculate' id='calculate'/formthen nothing happens when Calculate is clicked... Even if i change it (without form tag and submit button):...function(txt){ $(#main).html(txt+a id='calculate'calculate it/a); }...But if i do $(#main).html(txt+a id='calculate' hmm it works')'calculate it/a); IT WORKS..Am i doing something wrong? ___jQuery mailing listdiscuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] Blog Post About Visual jQuery
Hey guys,There's a big blog post up at the jQuery Blog about Visual jQuery, including a couple of big announcements. Check it out at http://jquery.com/blog/2006/09/02/taking-jquery-documentation-to-the-next-level/-- Yehuda KatzWeb Developer(ph)718.877.1325(fax) 718.686.4288 ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] no action after $.load.. why?
Thanks you two... How silly was i... lol2006/9/3, John Resig [EMAIL PROTECTED]: The code: $(document).ready( function(){ $(#main).load(get_calcform.php,{ idref: iditem }, function(txt){ $(#main).html(txt); } ); $(#calculate).click( function(){alert('hi');});The problem is that you're binding the click handler to #calculatebefore it even exists in the page (since it's still being loaded by .load(),before). Some working code would look like this:$(#main).load(get_calcform.php,{ idref: iditem }, function(){$(#calculate).click( function(){ alert('hi'); });});Since .load() already injects the HTML into #main, it's redundant todo it again. Additionally, the click binding now waits until the newHTML is in the page before trying to bind to it, giving you you're desired effect. Hope that helps.--John___jQuery mailing listdiscuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Charset and load()
Søren Haagerup schreef: When loading HTML with the load()-function in jQuery, Danish characters like æ, ø, å, Æ, Ø, Å etc. shows up like question marks. -You can always transform special characters to their appropriate character code (http://www.redbrick.dcu.ie/help/reference/html-tags/characters.html). How and where should I configure the charset? When I open the site I want to load directly in Firefox, nothing is wrong with the charset - only when loading with jQuery. -You can configure the charset of your document in your editor. The charset of the html file where you load the html with special characters into is probably the reason for causing the questionmarks. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/