[jQuery] AJAX sample code

2007-04-04 Thread wyo
I'm currently evaluation jQuery for a web site and it looks promising. Yet jQuery is rather new and documentation is rather sparse IHMO, especially for AJAX. I'm looking for working sample code which allows to filter a list of elements (e.g. persons) through some input fields (e.g. lastname,

[jQuery] How to load picture after picture

2007-04-10 Thread wyo
I currently retrieve all pictures of my gallery with the following PHP code $files = getFiles ($d); if (count ($files) 0) { foreach ($files as $key = $f) { echo img align=\center\ src=\$f\brbr; } } simply adding picture after picture. But since there will be many more

[jQuery] Re: How to load picture after picture

2007-04-11 Thread wyo
On Apr 10, 11:58 pm, Jonathan Sharp [EMAIL PROTECTED] wrote: Another approach would be to print out the images like: echo img align=\center\ src=\$f\ style=\display: none;\ class=\photo\brbr; Doesn't this load all the pictures right away? Since I expect soon a few hundreds pictures I don't

[jQuery] Understanding $(document).ready() etc

2007-04-12 Thread wyo
As I understand $(document).ready() is more or less just an enclosure to make sure the DOM is correcly available for use with jQuery. As it seems this makes the use of any on... event handler obsolete since any event can be bound in the $(document).ready() enclosure. Is that right or is there

[jQuery] How to load picture after picture (take 2)

2007-04-14 Thread wyo
I've now reworked my sample and it finally loads picture after picture yet it doesn't show them. My code is now var files = new Array(); files = ?PHP echo $json-encode ($files) ?; var pos = 0; (pos 0)? $('#prev').show(): $('#prev').hide(); (pos (files.length-1))?

[jQuery] Re: How to load picture after picture (take 2)

2007-04-14 Thread wyo
On 14 Apr., 20:18, wyo [EMAIL PROTECTED] wrote: Okay found the mistake myself just after posting. $('#files').html('img src='+files[pos]+' $('#pictures').html('img src='+files[pos]+' div id=pictures echo img src=\$files[0]\ class=\picture\; /div O. Wyss

[jQuery] Re: Showing a bind(click...) as clickable

2007-04-15 Thread wyo
On 15 Apr., 14:28, boermans [EMAIL PROTECTED] wrote: Adding a class may be preferable if you wish to provide further visual cues (such as a border) to your clickable images. $('#prev').addClass('clickable').bind('click', function() {...} Nice. And then in your css: .clickable

[jQuery] Re: Showing a bind(click...) as clickable

2007-04-16 Thread wyo
On 16 Apr., 00:21, Brian Cherne [EMAIL PROTECTED] wrote: Good point, Paul. Assuming it's not too much work, changing the IMG to an A tag would take care of most your problems... You wouldn't need ugly js hacks to get IE to understand hover and the only thing you'd need to do is Okay but how

[jQuery] How to bind to dynamic elements

2007-04-21 Thread wyo
I've a dynamically created array var folders = new Array(); folders = ?PHP echo $json-encode ($folders) ?; and html created with foreach ($folders as $key = $d) { echo p id=\f$key\ class=\folder\$d/p; } and would like to bind a click handler to each

[jQuery] Re: How to bind to dynamic elements

2007-04-21 Thread wyo
The javascript part looks alright to me. Is there any data in the folders array on the client side when the script gets executed? Do you have a sample page online? Yes, http://www.orpatec.ch/index.php?page=gallery.php Is there a way to retrieve the id of the bound element? O. Wyss

[jQuery] Re: How to bind to dynamic elements

2007-04-21 Thread wyo
On 21 Apr., 14:52, Giant Jam Sandwich [EMAIL PROTECTED] wrote: Unless you need the unique ID for each paragraph, it might be easier to bind the click by the class name. jQuery will perform the foreach logic for you. Well depending on which folder is clicked I'd like to switch to a certain

[jQuery] Re: How to bind to dynamic elements

2007-04-21 Thread wyo
On 21 Apr., 15:12, Giant Jam Sandwich [EMAIL PROTECTED] wrote: Try this instead: for (var i in folders) { $('#f'+i).bind('click', function() { alert ($(this).attr(id)); }); } Perfect. Besides is it allowed to use just number as id's? O. Wyss

[jQuery] Re: Showing a bind(click...) as clickable

2007-04-22 Thread wyo
On 17 Apr., 00:06, Jörn Zaefferer [EMAIL PROTECTED] wrote: wyo schrieb: On 15 Apr., 18:27, Brian Cherne [EMAIL PROTECTED] wrote: .hover is this a jQuery function? Where is it described? http://jquery.bassistance.de/api-browser/#hoverFunctionFunctionhttp://docs.jquery.com/Events#hover

[jQuery] How to make a methode in jQuery

2007-04-24 Thread wyo
Sorry my question might be rather basic stuff but none of the tutorials, sample code or API description helps me solving my question. I've a function cropImage which I'd like to use as a methode. What's the correct syntax for function cropImage () { ... $(this).css

[jQuery] Determining the optimal page width,height

2007-04-27 Thread wyo
My cropping image function works just after loading the image but not during window resizing. The problem is if there's a width=100% somewhere in the page but no height=100%, enlarging vertical only adds white space instead of cropping larger. Any size calculation based on actual values fails so

[jQuery] AJAX parameter problem

2007-04-27 Thread wyo
I've done my first AJAX call but since the documentation isn't clear about how parameter passing is done, it's not working on the first try. My code = var files = new Array(); $.getJSON (getfiles.php, {basedir: gallery}, function (data){

[jQuery] Re: About form upload

2007-04-27 Thread wyo
On 27 Apr., 20:38, Mike Alsup [EMAIL PROTECTED] wrote: I've also just tried it out but where is upload.php? As with any form processing, there must be a server component that handles the data. upload.php is just the action target for Massimiliano's form. Oh, I though it would be nice to

[jQuery] Determining when an image is fully loaded

2007-04-28 Thread wyo
I load images with $('#pictures').html('img src='+files[pos]+' id=file'+pos+' class=picture'); and want to save the loaded width,height afterwards. It seems this is only possible after the image is fully loaded. Is there an event which I could bind a function? O. Wyss

[jQuery] Difference of $.getJSON versus $get

2007-04-28 Thread wyo
What's the difference of $.getJSON versus $.get? I currently use $.getJSON to load JSON data but I can't see any advantages. Is $.getJSON just another way for $.ajax({ type: GET, url: link name, dataType: json, complete: function name }) or is the callback excuted only when

[jQuery] Re: Determining when an image is fully loaded

2007-04-28 Thread wyo
On 28 Apr., 15:39, Sean Catchpole [EMAIL PROTECTED] wrote: Try this: $('#pictures').html(...).bind(load,function(){...}); I've tried $('#pictures').html('img src=...').bind ('load', sizeImage); function sizeImage() { alert ('sizeImage'); } The alert is never shown, see

[jQuery] Re: Determining when an image is fully loaded

2007-04-29 Thread wyo
On 28 Apr., 23:12, Mike Alsup [EMAIL PROTECTED] wrote: var $img = $('img src='+files[pos]+' id=file'+pos+'class=picture') .appendTo('#pictures') .bind('load', function() { alert('loaded') }); Thanks, this works. Why do you use appendTo instead of html? I must say I don't understand

[jQuery] Re: Determining when an image is fully loaded

2007-04-29 Thread wyo
On 28 Apr., 23:18, Erik Beeson [EMAIL PROTECTED] wrote: Maybe $('#pictures').html(...).children().bind(...) Amazingly this works, see http://www.orpatec.ch/gallery4.html But I think you're trying to hard to use jQuery. How about this (tested on FF2/Mac): Possibly but I want to learn jQuery.

[jQuery] Re: Plugin downloads

2007-05-07 Thread wyo
On May 4, 9:44 am, Giuliano Marcangelo [EMAIL PROTECTED] wrote: Otto, seems fairly easy to me to download the js http://menu.n2cms.com/Js/n2menu.js Well it's just shown as text without any formating when I access the link. O. Wyss

[jQuery] Form plugin shows just result

2007-05-08 Thread wyo
I'm playing around with the form plugin yet when I press the submit button only the result (in my case true is shown afterwards. The full form is gone. My code is rather simple script type=text/javascript $(document).ready(function() { var options = { beforeSubmit:

[jQuery] Re: Form plugin shows just result

2007-05-08 Thread wyo
On May 8, 11:33 pm, Aaron Heimlich [EMAIL PROTECTED] wrote: Onhttp://www.orpatec.ch/termola/index.php?page=contact.phpFirebug gives me the following error: validateInput is not definedhttp://www.orpatec.ch/termola/contact.php?page=contact.php Line 30 Well that can't be the reason since

[jQuery] Re: Form plugin shows just result

2007-05-10 Thread wyo
On May 9, 1:53 pm, Mike Alsup [EMAIL PROTECTED] wrote: Both pages have the same problem with this line: $('#kontakt_formular').ajaxForm (function() {alert (data[0]? 'success': 'failure')}); 'data' is undefined here. If you bind a function to ajaxError you should see an error. You need to

[jQuery] Disable an input element

2007-05-10 Thread wyo
I'd like to disable a button (input element) after an action. So far I can hide it $('#kontakt_senden').hide(); input id=kontakt_senden type=submit value=abschicken yet I don't know how to disable it. Does anybody know? O. Wyss

[jQuery] Download indicator

2007-05-12 Thread wyo
My gallery including size fitting now works mosty (except with Firefox/ SeaMonkey) but I need to have a download indicator to show when the download takes a little longer. I've seen Thickbox uses a loadingAnimation.gif. Is there a general available download indicator which I could use? Is this

[jQuery] Question about load()

2007-05-14 Thread wyo
I consider to embed a page from one domain into a page from another domain with an iframe. Yet when I click a link inside the embedded page, only the embedded part should be loaded without involving the outer page. Does anybody know if I could do this with load()? Has anybody already tried

[jQuery] Form plugin: Multiple submit buttons

2007-05-15 Thread wyo
I've a form with serveral submit buttons which should call quite some different functions. Is there a way to overwrite the URL depending on the submit button, calling separate server functions or do I have to separate them on the server? O. Wyss

[jQuery] Re: Form plugin: Multiple submit buttons

2007-05-16 Thread wyo
On May 15, 3:25 pm, Scott Sauyet [EMAIL PROTECTED] wrote: You could easily do this in JQuery, but then you have to realize that the site would not work with Javascript disabled. Since you are going to have to do server-side processing anyway, it doesn't seem that big a deal to do the

[jQuery] Form plugin parameter passing

2007-06-16 Thread wyo
Is it possible to pass additional parameters to the AJAX call? On my page I have a get value (e.g. mode=1) which I'd like to pass to the called server function. Or do I have to store the value in a hidden input field so it's passed with the other fields? O. Wyss

[jQuery] Form plugin, filling results into the fields

2007-06-16 Thread wyo
I'm not sure if I understand it right, does the form plugin move the results back into the form fileds after the call succeeds? If yes how has the results look like? If no, what's the best solution? O. Wyss

[jQuery] Problems with bind

2008-01-29 Thread wyo
I've tried to build a table collapser yet I've problems with the statements $('#collapser_'+i+', .expanding').bind('click', collapser_collapse (i)); $('#collapser_'+i+', .collapsing').bind('click', collapser_expand (i)); To me they look correct yet Javascript stops working. The source is

[jQuery] Accessing jQuery functions from outside

2008-01-31 Thread wyo
I've some functions which I'd like to use outside of jQeury in normal HTML, e.g. script type=text/javascript $(document).ready(function() { function collapse (i) { $('#expanded_'+i).hide(); } }); /script ... img src=images/plus01.png onclick=javascript:

[jQuery] Re: Accessing jQuery functions from outside

2008-02-01 Thread wyo
On Jan 31, 3:38 pm, Giovanni Battista Lenoci [EMAIL PROTECTED] wrote: wyo ha scritto: Why don't you declare the function outside the document.ready ? Since I want to use the function during startup but prevent it from being used before document.ready and I want to use it afterwards. Why

[jQuery] How to bind to a dynamically created object

2008-02-02 Thread wyo
Isn't it possible to bind to a previous created object? I've the following code for (var i in data) { $('#eintragsliste').append( 'trtdtabletbody' + ' tr' + 'tdimg class=expanding src=images/plus01.png/ th' + 'td.../td' +

[jQuery] Re: How to bind to a dynamically created object

2008-02-02 Thread wyo
On Feb 2, 5:06 pm, Glen Lipka [EMAIL PROTECTED] wrote: http://brandonaaron.net/docs/livequery/ This will do the trick. Perfect. Yet if I rework the sample to bind each image separate, the script takes for ages and the browser complains about stopping the script. for (var i in data) {

[jQuery] Re: How to bind to a dynamically created object

2008-02-02 Thread wyo
maybe cutting that 'id=' ? simply: $('.expanding, #'+i+). Unfortunately not since I've done this before. IMO the only solution would be to use the onclick clause in HTML but I haven't figured out to access jQuery from outside. E.g. img class=expanding src=images/plus01.png onclick=$

[jQuery] Re: How to bind to a dynamically created object

2008-02-04 Thread wyo
On Feb 3, 5:39 pm, Brandon Aaron [EMAIL PROTECTED] wrote: Ugh ... large tables always needs lots of optimizations. First ... you'll want to minimize the number of .append()s. Concat all your HTML into an array and then append. Something like this: var html = []; ... Thanks. cause issues

[jQuery] Form plugin using ajaxSubmit to fill initial values into form

2008-10-11 Thread wyo
I'd like to read the initial values of the input fields from a DB (php script) with ajaxSubmit. So far ajaxSubmit didn't fire the request to my php script. See sample at http://www.orpatec.ch/test/formdata.html (view source) Is there a sample anywhere which does about the same? Besides how are

[jQuery] Using multiple selectors

2008-10-14 Thread wyo
I've a form like form id=Test ... fieldset table ... tbody tr tdinput name=Prefix/td Now I try to access it in the following way: $('#Test, Prefix').value = 'Testing; I also tried $('#Test', 'Prefix').value = 'Testing; with no success. Any idea what's wrong?

[jQuery] Re: Using multiple selectors

2008-10-15 Thread wyo
of value. On Oct 14, 2:49 pm, wyo [EMAIL PROTECTED] wrote: I've a form like form id=Test ... fieldset table ... tbody tr tdinput name=Prefix/td Now I try to access it in the following way: $('#Test, Prefix').value = 'Testing; I also tried