[jQuery] Animation for cloned elements
Hi All, I am trying to clone an element and add it with some animation efects. something like $item.clone(true).appendTo($list).slideDown("slow"); It adds an element correctly, but I cannot get any effects working (tried fadeIn etc). What am i doing wrong? Thanks
[jQuery] Re: Cannot pass vars via AJAX POST
It was just a crazy setting in firebug (enable console). Otherwise, it doesn't show the output results On Apr 22, 1:01 pm, Andy789 wrote: > Hi All, > > I am stacked with a simple code (it works perfectly on my other site, > but I cannot find what could be wrong here): > > 1) I pass vars to file test.php via > > $.post("test.php", {state: state, city: city, attorney: > isAttorney, paral: isParal, detect: isDetect, same_state: isState}, > function(xml){ > > ..etc > > 2) the test php simply putputs all the vars > > > foreach($_REQUEST as $key => $value){ > echo $key." = ". $value.""; > } > > ?> > > 3) I check all the POST vars with firebug - everything is OK > > 4) I check the Response of test.php with firebug and cannot see ANY of > the POSTed vars. There are some other admin vars from the site, but > not the ones passed from JQuery POST > > Someone has any clue of what could be wrong here? The same code works > OK on my other site (the same server) > > Thanks
[jQuery] Cannot pass vars via AJAX POST
Hi All, I am stacked with a simple code (it works perfectly on my other site, but I cannot find what could be wrong here): 1) I pass vars to file test.php via $.post("test.php", {state: state, city: city, attorney: isAttorney, paral: isParal, detect: isDetect, same_state: isState}, function(xml){ ..etc 2) the test php simply putputs all the vars $value){ echo $key." = ". $value.""; } ?> 3) I check all the POST vars with firebug - everything is OK 4) I check the Response of test.php with firebug and cannot see ANY of the POSTed vars. There are some other admin vars from the site, but not the ones passed from JQuery POST Someone has any clue of what could be wrong here? The same code works OK on my other site (the same server) Thanks
[jQuery] Re: How to prevent loading jquery twice
Thanks, guys. After all, I gave up on jscript solution and added a switch adding jscript to the header on a php level On Mar 23, 11:44 pm, Peter Edwards wrote: > Are you using joomla to load jQuery? or are you wringin script tags in > some sort of template? > I came across > this:http://www.packtpub.com/article/using-javascript-effects-with-joomla > which seems to imply joomla can handle you script inclusion. > hope this helps > > on 23/03/2009 11:41 Andy789 said:: > > > also, it is working (only in FF, though) and not very stable. I think > > what is happening, when I write the reference to > > the header, it does not mean that it is loaded. in fact, it is loaded > > SOMETIMES > > > On Mar 23, 10:28 pm, Andy789 wrote: > > >> we are talking about joomla's index.php (used as a main page) and > >> index2.php (used as an iframe). Index2.php is always a part of > >> index.php. Therefore, > > >> 1) if I include jquery to the main page header, the iframe (generated > >> as index2,php) will not work as there is no jquery in there > >> 2) if I include it to both headers, i will get adoublelibrary > >> 3) if I include it only to the iframe part, which is always a part of > >> the main page, it will work OK, but i will be changing the core > >> joomla's files and will have to hack it every time when a new version > >> is out > > >> So, I am trying to load it only, if it has not been loaded before. > >> Does it make sense now? > > >> On Mar 23, 10:15 pm, Liam Potter wrote: > > >>> well, the onesloadingthrough the iframe will need jquery loaded in the > >>> iframe, and the components loaded one-by-one only need jquery loaded > >>> once.. > > >>> I don't understand what you are trying to do hre, just load jquery in > >>> the head. > > >>> Andy789 wrote: > > >>>> Because some components are loaded inside of iframe and need its own > >>>> jQuery. some compionents are loaded one-by-one and need only one > >>>> common library > > >>>> On Mar 23, 9:39 pm, Liam Potter wrote: > > >>>>> why would you beloadingthe library for each script? > > >>>>> Andy789 wrote: > > >>>>>> Hi all, > > >>>>>> I have different independent modules using jquery and need to avoid > >>>>>> its doubleloading. So, instead ofloadingjquery, I amloadingthe > >>>>>> code: > > >>>>>> if (typeof jQuery != 'undefined') { > >>>>>> document.write(''); > >>>>>> } > > >>>>>> Also, I have added a line var $j = jQuery.noConflict(); as a last line > >>>>>> of jquery library file. > > >>>>>> The problem is that though it writes the code on document write, it > >>>>>> does not seem that jquery is loaded at all, because I am getting an > >>>>>> error jQuery not defined. > > >>>>>> What am i doing wrong here? is there a more elegant way to load a > >>>>>> library dynamically? > > >>>>>> Thanks
[jQuery] Re: How to prevent loading jquery twice
also, it is working (only in FF, though) and not very stable. I think what is happening, when I write the reference to the header, it does not mean that it is loaded. in fact, it is loaded SOMETIMES On Mar 23, 10:28 pm, Andy789 wrote: > we are talking about joomla's index.php (used as a main page) and > index2.php (used as an iframe). Index2.php is always a part of > index.php. Therefore, > > 1) if I include jquery to the main page header, the iframe (generated > as index2,php) will not work as there is no jquery in there > 2) if I include it to both headers, i will get a double library > 3) if I include it only to the iframe part, which is always a part of > the main page, it will work OK, but i will be changing the core > joomla's files and will have to hack it every time when a new version > is out > > So, I am trying to load it only, if it has not been loaded before. > Does it make sense now? > > On Mar 23, 10:15 pm, Liam Potter wrote: > > > well, the onesloadingthrough the iframe will need jquery loaded in the > > iframe, and the components loaded one-by-one only need jquery loaded once.. > > > I don't understand what you are trying to do hre, just load jquery in > > the head. > > > Andy789 wrote: > > > Because some components are loaded inside of iframe and need its own > > > jQuery. some compionents are loaded one-by-one and need only one > > > common library > > > > On Mar 23, 9:39 pm, Liam Potter wrote: > > > >> why would you beloadingthe library for each script? > > > >> Andy789 wrote: > > > >>> Hi all, > > > >>> I have different independent modules using jquery and need to avoid > > >>> its doubleloading. So, instead ofloadingjquery, I amloadingthe > > >>> code: > > > >>> if (typeof jQuery != 'undefined') { > > >>> document.write(''); > > >>> } > > > >>> Also, I have added a line var $j = jQuery.noConflict(); as a last line > > >>> of jquery library file. > > > >>> The problem is that though it writes the code on document write, it > > >>> does not seem that jquery is loaded at all, because I am getting an > > >>> error jQuery not defined. > > > >>> What am i doing wrong here? is there a more elegant way to load a > > >>> library dynamically? > > > >>> Thanks
[jQuery] Re: How to prevent loading jquery twice
we are talking about joomla's index.php (used as a main page) and index2.php (used as an iframe). Index2.php is always a part of index.php. Therefore, 1) if I include jquery to the main page header, the iframe (generated as index2,php) will not work as there is no jquery in there 2) if I include it to both headers, i will get a double library 3) if I include it only to the iframe part, which is always a part of the main page, it will work OK, but i will be changing the core joomla's files and will have to hack it every time when a new version is out So, I am trying to load it only, if it has not been loaded before. Does it make sense now? On Mar 23, 10:15 pm, Liam Potter wrote: > well, the onesloadingthrough the iframe will need jquery loaded in the > iframe, and the components loaded one-by-one only need jquery loaded once.. > > I don't understand what you are trying to do hre, just load jquery in > the head. > > Andy789 wrote: > > Because some components are loaded inside of iframe and need its own > > jQuery. some compionents are loaded one-by-one and need only one > > common library > > > On Mar 23, 9:39 pm, Liam Potter wrote: > > >> why would you beloadingthe library for each script? > > >> Andy789 wrote: > > >>> Hi all, > > >>> I have different independent modules using jquery and need to avoid > >>> its doubleloading. So, instead ofloadingjquery, I amloadingthe > >>> code: > > >>> if (typeof jQuery != 'undefined') { > >>> document.write(''); > >>> } > > >>> Also, I have added a line var $j = jQuery.noConflict(); as a last line > >>> of jquery library file. > > >>> The problem is that though it writes the code on document write, it > >>> does not seem that jquery is loaded at all, because I am getting an > >>> error jQuery not defined. > > >>> What am i doing wrong here? is there a more elegant way to load a > >>> library dynamically? > > >>> Thanks
[jQuery] Re: How to prevent loading jquery twice
Because some components are loaded inside of iframe and need its own jQuery. some compionents are loaded one-by-one and need only one common library On Mar 23, 9:39 pm, Liam Potter wrote: > why would you beloadingthe library for each script? > > Andy789 wrote: > > Hi all, > > > I have different independent modules using jquery and need to avoid > > its doubleloading. So, instead ofloadingjquery, I amloadingthe > > code: > > > if (typeof jQuery != 'undefined') { > > document.write(''); > > } > > > Also, I have added a line var $j = jQuery.noConflict(); as a last line > > of jquery library file. > > > The problem is that though it writes the code on document write, it > > does not seem that jquery is loaded at all, because I am getting an > > error jQuery not defined. > > > What am i doing wrong here? is there a more elegant way to load a > > library dynamically? > > > Thanks
[jQuery] How to prevent loading jquery twice
Hi all, I have different independent modules using jquery and need to avoid its double loading. So, instead of loading jquery, I am loading the code: if (typeof jQuery != 'undefined') { document.write(''); } Also, I have added a line var $j = jQuery.noConflict(); as a last line of jquery library file. The problem is that though it writes the code on document write, it does not seem that jquery is loaded at all, because I am getting an error jQuery not defined. What am i doing wrong here? is there a more elegant way to load a library dynamically? Thanks
[jQuery] Nyro modal - how to check if the div is rendered
HI all, I am getting a synchronization problem when loading an ajax content via nyro modal - spent a few hours debugging it line-by-line. The problem is: sometimes, depending on internet connection, the modal window returns an error (object required) - mainly in IE. I could click the same link 10 times - rendered OK, and then itgenerates an error once. Here is the fragment of the code (narrowed with the debugger) if (currentSettings.autoSizable && (!currentSettings.width || ! currentSettings.height)) { modal.contentWrapper .css({ opacity: 0, width: 'auto', height: 'auto' }) .show(); var tmp = { width: 'auto', height: 'auto' }; . The error happens when IE7 (due to some reasons) does not create the div contentWrapper first. Than jquery tries to assign css to a non- existing element. I have managed to fix it (a very bad way though) by adding a delay of about 400ms in front of that construction: function sleep(delay) { var start = new Date().getTime(); while (new Date().getTime() < start + delay); } It works okey, but it's not a very good solution, because not linked to the contentWrapper element creating. are there any better ways of doing this? In other words, I need a dynamic delay before the element is created. any suggestions?
[jQuery] Re: Simple alert inside each(function.... not working
It was all my mistake, sorry. I had 2 clones of the same function and was editing a wrong one. everything works perfectly, all alerts etc Sorry, guys On Mar 18, 2:16 pm, Andy789 wrote: > OK, finally, I got it: everything was caused by qtip: adding a code > > $j(this).qtip({ > > content: $j(this).attr('title'), > show: { effect: 'grow', length: 400 }, > hide: { effect: 'grow', length: 400 }, > position: { > corner: { > target: 'topMiddle', > tooltip: 'bottomLeft' > }}, > > style: { > tip: 'bottomLeft', > name: 'dark', > border: { > width: 2, > radius: 8 > //color: '#66' > }, > width: 200} > > }); > inside of theeach(function loop caused alerts not functional, > however, all qtips were generated fine. Checked it on different > browsers - the same result. It looks as I will get back to the old > bullet-proof tooltips of Walter Zorn (www.walterzorn.com) > > On Mar 18, 11:52 am, Eric Garside wrote: > > > The problem here appears to be the change jQuery made with 1.3.2 with > > how it determines visibility. > > >http://jsbin.com/omavi/edit > > > That link is a quick demonstration of how it works. A "visible" object > > to jquery is determined by if it takes up space in the page, and has > > nothing to do with the css property "visibility". This is pretty > > deceiving, and I'm not sure why they decided to do it that way, but it > > breaks down like this: > > > A visible element one, even ones with or visibility:hidden" and > > "position: absolute; left: -px" will return with the :visibility > > selector > > An element which does not take up space, such as one with > > "display:none" will not return with the :visibility selector. > > > Now, in your code, you reference $j('selector'). I'm not at all > > familiar with $j as a way to interface with jQuery. But there is proof > > it works, and as expected (at least to what jQuery says). > > > On Mar 17, 8:36 pm, Andy789 wrote: > > > > No, just to make it real simple: > > > >functiontest(){ > > > var vis = $j('li.jqtip:visible').length; > > > alert(vis); //correct alert OK, returns some number here! > > > $j('li.jqtip:visible').each(function() > > > { alert('something here'); //nothing happens !!! > > > > }) > > > } > > > > All alerts inside .each(function do not work. > > > > Any ideas? > > > > On Mar 18, 7:18 am, James wrote: > > > > > What happens if you remove the code for the qtip and leave the alert? > > > > > On Mar 17, 10:14 am, Andy789 wrote: > > > > > > Yes, this is what i was doing, but puzzled as why the second alert > > > > > never triggers: > > > > > >functiontips(){ > > > > > alert($j('li.jqtip:visible').length); //returns 9 > > > > > $j('li.jqtip:visible').each(function() > > > > > { alert('something here'); //returns nothing, but thefunctionis > > > > > working and creates tooltips !! > > > > > $j(this).qtip({ .. > > > > > > How is that possible? > > > > > > On Mar 18, 12:28 am, MorningZ wrote: > > > > > > > First, it would be wise to see what your selector returns > > > > > > > functiontips(){ > > > > > > alert($j('li.jqtip:visible').length); > > > > > > > } > > > > > > > if that returns "0", then your selector is wrong > > > > > > > to help with that, there was this excellent post about breaking > > > > > > changes in 1.3.2 release, in your case reading the ":visible" > > > > > > section > > > > > > would probably be of great help > > > > > > >http://www.learningjquery.com/2009/03/3-quick-steps-for-a-painless-up... > > > > > > > Andy789 wrote: > > > > > > > Hi All, > > > > > > > > Here is a simplefunction- works fine, but I cannot get alerts for > > > > > > > debugging - no errors - no alerts: > > > > > > > >functiontips(){ > > > > > > > > $j('li.jqtip:visible').each(function() > > > > > > > { alert('something here'); //this alert is not working !! > > > > > > > $j(this).qtip({ > > > > > > > content: $j(this).attr('title'), > > > > > > > show: { effect: 'grow', length: 400 }, > > > > > > > hide: { effect: 'grow', length: 400 }, > > > > > > > position: { > > > > > > > corner: { > > > > > > > target: 'topMiddle', > > > > > > > tooltip: 'bottomLeft' > > > > > > > } > > > > > > > }, > > > > > > > style: { > > > > > > > tip: 'bottomLeft', > > > > > > > name: 'dark', > > > > > > > border: { > > > > > > > width: 2, > > > > > > > radius: 8 > > > > > > > //color: '#66' > > > > > > > }, > > > > > > > width: 200 > > > > > > > } > > > > > > > }); > > > > > > > }); > > > > > > > } > > > > > > > > What is wrong here? I feel it is something very obvious...
[jQuery] Re: Simple alert inside each(function.... not working
OK, finally, I got it: everything was caused by qtip: adding a code $j(this).qtip({ content: $j(this).attr('title'), show: { effect: 'grow', length: 400 }, hide: { effect: 'grow', length: 400 }, position: { corner: { target: 'topMiddle', tooltip: 'bottomLeft' } }, style: { tip: 'bottomLeft', name: 'dark', border: { width: 2, radius: 8 //color: '#66' }, width: 200 } }); inside of the each(function loop caused alerts not functional, however, all qtips were generated fine. Checked it on different browsers - the same result. It looks as I will get back to the old bullet-proof tooltips of Walter Zorn (www.walterzorn.com) On Mar 18, 11:52 am, Eric Garside wrote: > The problem here appears to be the change jQuery made with 1.3.2 with > how it determines visibility. > > http://jsbin.com/omavi/edit > > That link is a quick demonstration of how it works. A "visible" object > to jquery is determined by if it takes up space in the page, and has > nothing to do with the css property "visibility". This is pretty > deceiving, and I'm not sure why they decided to do it that way, but it > breaks down like this: > > A visible element one, even ones with or visibility:hidden" and > "position: absolute; left: -px" will return with the :visibility > selector > An element which does not take up space, such as one with > "display:none" will not return with the :visibility selector. > > Now, in your code, you reference $j('selector'). I'm not at all > familiar with $j as a way to interface with jQuery. But there is proof > it works, and as expected (at least to what jQuery says). > > On Mar 17, 8:36 pm, Andy789 wrote: > > > No, just to make it real simple: > > >functiontest(){ > > var vis = $j('li.jqtip:visible').length; > > alert(vis); //correct alert OK, returns some number here! > > $j('li.jqtip:visible').each(function() > > { alert('something here'); //nothing happens !!! > > > }) > > } > > > All alerts inside .each(function do not work. > > > Any ideas? > > > On Mar 18, 7:18 am, James wrote: > > > > What happens if you remove the code for the qtip and leave the alert? > > > > On Mar 17, 10:14 am, Andy789 wrote: > > > > > Yes, this is what i was doing, but puzzled as why the second alert > > > > never triggers: > > > > >functiontips(){ > > > > alert($j('li.jqtip:visible').length); //returns 9 > > > > $j('li.jqtip:visible').each(function() > > > > { alert('something here'); //returns nothing, but thefunctionis > > > > working and creates tooltips !! > > > > $j(this).qtip({ .. > > > > > How is that possible? > > > > > On Mar 18, 12:28 am, MorningZ wrote: > > > > > > First, it would be wise to see what your selector returns > > > > > > functiontips(){ > > > > > alert($j('li.jqtip:visible').length); > > > > > > } > > > > > > if that returns "0", then your selector is wrong > > > > > > to help with that, there was this excellent post about breaking > > > > > changes in 1.3.2 release, in your case reading the ":visible" section > > > > > would probably be of great help > > > > > >http://www.learningjquery.com/2009/03/3-quick-steps-for-a-painless-up... > > > > > > Andy789 wrote: > > > > > > Hi All, > > > > > > > Here is a simplefunction- works fine, but I cannot get alerts for > > > > > > debugging - no errors - no alerts: > > > > > > >functiontips(){ > > > > > > > $j('li.jqtip:visible').each(function() > > > > > > { alert('something here'); //this alert is not working !! > > > > > > $j(this).qtip({ > > > > > > content: $j(this).attr('title'), > > > > > > show: { effect: 'grow', length: 400 }, > > > > > > hide: { effect: 'grow', length: 400 }, > > > > > > position: { > > > > > > corner: { > > > > > > target: 'topMiddle', > > > > > > tooltip: 'bottomLeft' > > > > > > } > > > > > > }, > > > > > > style: { > > > > > > tip: 'bottomLeft', > > > > > > name: 'dark', > > > > > > border: { > > > > > > width: 2, > > > > > > radius: 8 > > > > > > //color: '#66' > > > > > > }, > > > > > > width: 200 > > > > > > } > > > > > > }); > > > > > > }); > > > > > > } > > > > > > > What is wrong here? I feel it is something very obvious...
[jQuery] Re: Simple alert inside each(function.... not working
No, just to make it real simple: function test(){ var vis = $j('li.jqtip:visible').length; alert(vis); //correct alert OK, returns some number here! $j('li.jqtip:visible').each(function() { alert('something here'); //nothing happens !!! }) } All alerts inside .each(function do not work. Any ideas? On Mar 18, 7:18 am, James wrote: > What happens if you remove the code for the qtip and leave the alert? > > On Mar 17, 10:14 am, Andy789 wrote: > > > Yes, this is what i was doing, but puzzled as why the second alert > > never triggers: > > >functiontips(){ > > alert($j('li.jqtip:visible').length); //returns 9 > > $j('li.jqtip:visible').each(function() > > { alert('something here'); //returns nothing, but thefunctionis > > working and creates tooltips !! > > $j(this).qtip({ .. > > > How is that possible? > > > On Mar 18, 12:28 am, MorningZ wrote: > > > > First, it would be wise to see what your selector returns > > > > functiontips(){ > > > alert($j('li.jqtip:visible').length); > > > > } > > > > if that returns "0", then your selector is wrong > > > > to help with that, there was this excellent post about breaking > > > changes in 1.3.2 release, in your case reading the ":visible" section > > > would probably be of great help > > > >http://www.learningjquery.com/2009/03/3-quick-steps-for-a-painless-up... > > > > Andy789 wrote: > > > > Hi All, > > > > > Here is a simplefunction- works fine, but I cannot get alerts for > > > > debugging - no errors - no alerts: > > > > >functiontips(){ > > > > > $j('li.jqtip:visible').each(function() > > > > { alert('something here'); //this alert is not working !! > > > > $j(this).qtip({ > > > > content: $j(this).attr('title'), > > > > show: { effect: 'grow', length: 400 }, > > > > hide: { effect: 'grow', length: 400 }, > > > > position: { > > > > corner: { > > > > target: 'topMiddle', > > > > tooltip: 'bottomLeft' > > > > } > > > > }, > > > > style: { > > > > tip: 'bottomLeft', > > > > name: 'dark', > > > > border: { > > > > width: 2, > > > > radius: 8 > > > > //color: '#66' > > > > }, > > > > width: 200 > > > > } > > > > }); > > > > }); > > > > } > > > > > What is wrong here? I feel it is something very obvious...
[jQuery] Re: Simple alert inside each(function.... not working
Yes, this is what i was doing, but puzzled as why the second alert never triggers: function tips(){ alert($j('li.jqtip:visible').length); //returns 9 $j('li.jqtip:visible').each(function() { alert('something here'); //returns nothing, but the function is working and creates tooltips !! $j(this).qtip({ .. How is that possible? On Mar 18, 12:28 am, MorningZ wrote: > First, it would be wise to see what your selector returns > > functiontips(){ > alert($j('li.jqtip:visible').length); > > } > > if that returns "0", then your selector is wrong > > to help with that, there was this excellent post about breaking > changes in 1.3.2 release, in your case reading the ":visible" section > would probably be of great help > > http://www.learningjquery.com/2009/03/3-quick-steps-for-a-painless-up... > > Andy789 wrote: > > Hi All, > > > Here is a simplefunction- works fine, but I cannot get alerts for > > debugging - no errors - no alerts: > > >functiontips(){ > > > $j('li.jqtip:visible').each(function() > > { alert('something here'); //this alert is not working !! > > $j(this).qtip({ > > content: $j(this).attr('title'), > > show: { effect: 'grow', length: 400 }, > > hide: { effect: 'grow', length: 400 }, > > position: { > > corner: { > > target: 'topMiddle', > > tooltip: 'bottomLeft' > > } > > }, > > style: { > > tip: 'bottomLeft', > > name: 'dark', > > border: { > > width: 2, > > radius: 8 > > //color: '#66' > > }, > > width: 200 > > } > > }); > > }); > > } > > > What is wrong here? I feel it is something very obvious...
[jQuery] Simple alert inside each(function.... not working
Hi All, Here is a simple function - works fine, but I cannot get alerts for debugging - no errors - no alerts: function tips(){ $j('li.jqtip:visible').each(function() { alert('something here'); //this alert is not working !! $j(this).qtip({ content: $j(this).attr('title'), show: { effect: 'grow', length: 400 }, hide: { effect: 'grow', length: 400 }, position: { corner: { target: 'topMiddle', tooltip: 'bottomLeft' } }, style: { tip: 'bottomLeft', name: 'dark', border: { width: 2, radius: 8 //color: '#66' }, width: 200 } }); }); } What is wrong here? I feel it is something very obvious...
[jQuery] Re: How to synchronize ajax events
Thank you guys! I have made a slightly different logic, which seems to be working fine: function zipSearch2(){ var zip = $j('input#zip_entry').attr('value'); alert('second '+validation); ... } function zipSearch(){ var zip = $j('input#zip_entry').attr('value'); $j.post("markers.php", { validate: zip}, function(xml){ var validation = $j.xml2json(xml, true); if(validation.zip[0].city !='na') { zipSearch2(); } else $j('#bad_zip').dialog('open'); }); } So, I am calling the main function zipSearch2 from the ajax callback part of the zipSearch(). Are there any potential synchronization pitfalls here i should be aware of?
[jQuery] Re: How to synchronize ajax events
Thank you guys! I have made a slightly different logic, which seems to be working fine: function zipSearch2(){ var zip = $j('input#zip_entry').attr('value'); alert('second '+validation); ... } function zipSearch(){ var zip = $j('input#zip_entry').attr('value'); $j.post("markers.php", { validate: zip}, function(xml){ var validation = $j.xml2json(xml, true); if(validation.zip[0].city !='na') { zipSearch2(); } else $j('#bad_zip').dialog('open'); }); } So, I am calling the main function zipSearch2 from the ajax callback part of the zipSearch(). Are there any potential synchronization pitfalls here i should be aware of?
[jQuery] How to synchronize ajax events
Hi All, Here is a simple fragment: function zipSearch(){ var zip = $j('input#zip_entry').attr('value'); validateZip(zip); alert('second '+validation); ... } function validateZip(zip){ $j.post("markers.php", { validate: zip}, function(xml){ validation = $j.xml2json(xml, false); alert('first '+validation); }); } The problem is that the first function (zipSearch) calls validateZip and doesn't wait until it gets callback data from php file. So it jumps to the next line. I am getting 1st alert ('second '+validation) and next the alert from ajax function. How can I fix it to make sure the first function waits until validateZip gets its callback? thanks!
[jQuery] Re: How to trigger "click" event in jquery
Thank you guys! I did not know that jquery can handle only its 'own' bound events. I will have to use mootools as it works fine. I just wanted to avoid mixing jquery and mootools in the same function.
[jQuery] How to trigger "click" event in jquery
Hi All, I am struggling with something very simple. 1. onclick event for li element is binded with mootools 2. I can easily trigger onclick via function with mootools like $('lst4').fireEvent('click'); ///works fine 2. I cannot trigger onclick via jquery. I am trying function test(){ //$('lst4').fireEvent('click'); ///works OK, calling mootools $j('#lst4').trigger('click'); // does not work, returns no errors } I am using both mootools ans jquery. $j relates to jquery (var $j = jQuery.noConflict();) How can I trigger onclick for that element programmatically with jquery?
[jQuery] Jquery adds its own tags to divs???
Hi All, I cannot understabd why jquery adds these tags to my divs - something like: jquery1233798431484="2" jquery1233798241359="null" what is this?
[jQuery] How to synchronize callback events
Hi All, This is my workflow logic: 1. I submit $.post AJAX request and get the callback data 2. This data is a raw html code, which is used to append some div 3. I have to scroll through all the new appended elements and make them draggable The problem is that the drag activation function starts BEFORE all the new elements are appended, i.e. create a new DOM, therefore, usually first 1-2 elements are not draggable. All the rest of them are OK. This is a fragment of the code: $j.post("canvas_save.php", queryString, function(data){ if ($j.browser.msie){ $j("div#restored").append(data); $j("div#restored").children("div").each(function(i){ ADD_DHTML($j(this).attr("id")); //this starts before all the children are appended! }); } }); Any suggestions how to synchronize this? Thanks!!
[jQuery] Re: How to get html string including the selected element
Thank you. I think it should work - I will give it a try tomorrow. The whole mess is just to store these html strings in the database and extract it later to render a part of the page. any better solutions for this? On Feb 2, 9:20 pm, boermans wrote: > On Feb 2, 7:50 pm, Frederik Ring wrote: > > > So you could just either wrap it in a dummy-div or add the > id="test"> and code manually? > > Something like this should do the trick. > $('').append($('#test').clone()).html(); > > Not sure if jQuery disposes of the new node and it’s cloned contents > afterwards. > If you are doing this a lot I suggest you assign your phantom div > container a variable and reuse it. > > var temp = $(''); > var thishtml = temp.html($('#test').clone()).html(); > > But really this is a lot of messing around that may not be necessary > depending on what you want to do with thishtml.
[jQuery] Re: How to get html string including the selected element
Because the parent element for #test contains many other divs - not only #test. On Feb 2, 8:38 pm, Frederik Ring wrote: > Why can't you just read the html() of the element containing your > #test?
[jQuery] How to get html string including the selected element
Hi All, I need to get html for a dom structure like this: something if I use $('div#test').html(); it generates its innerHTML excluding How an I get the whole structure including id test? thanks
[jQuery] Re: Convert jquery object to a string
Json parser? http://plugins.jquery.com/project/json any better solutions?
[jQuery] Convert jquery object to a string
Hi all, Is there a simple way to convert jquery object to a string and back? I need to store a generated html dom structure in the database and restore it back to html. Any suggestions how to do it properly? Thank you
[jQuery] Re: Triggering a link with no click event
Guys, thank you, but it still does not work. 1) The Maurício's solution is just a way of extracting the href value and creating onlick event to jump to that link. What I need is to emulate a click on the a element without opening a link directly. The reason for that: Rokbox scans all rel="rokbox" elements and generates a set of divs bevore closing body tag. Somehow the links are binded with some internal RokBox functions, so clicking on the link opens a RokBox with the link target inside. 2) Yes, I am using both mootools and jquery with noConflict() declaration - it works perfectly 3) The problem is that I cannot find the function inside RokBox to call it directly from jscript function. At the same time I would rather prefer to use RokBox, because it works perfectly for complex independent pages with ajax, flash etc inside. RokBox creates an iframe inside. The point is that I need to find either a way of emulating the link click or a function inside RokBox, which is difficult, because it is packed any more ideas?
[jQuery] Re: Triggering a link with no click event
As I can see quite many posts on this subject I wanted to explain why I need this. I generate links for RokBox modal window - something like test next, I need to trigger these links from jscript function (from the external flash application). I could not figure out the way how to call RokBox directly and have to finc out the way how to trigger links via jquery or mootools or whatsoever. Any suggestions?
[jQuery] Triggering a link with no click event
HI All, It could be a silly question, but I cannot find a simple answer... I need to trigger a link with href via an external function, i.e. Emulating click my link function linkClick(){ $("#test").click(); } It does not work and returns nothing. I understanbd that it is because the a#test does not have the actual onclick event. So, how can I emulate click on a#test? Note, that I cannot modify the a link element or add onclick events.
[jQuery] Jquery pagination plugin problem
Hi all, I am playing with the pagination plugin (http://plugins.jquery.com/ node/5912) and cannot figure out how to change number of items showing on a single page. Changing the param items_per_page changes the number of page links (navigation), but still shows a single item on a page. You may play with the demo.htm from the download to see what I am talking about.. Has someone faced the same problem? Any suggestions how to fix this?