[jQuery] Re: HttpHandler not returning JSON data
I did try and am able to use the json.net class for it. The HttpHandler is returning json data now. Thanks. Now I was trying to get 10 items from the json file. My url in $.getJSON looks like: $.getJSON(myjsonfile.json?count=10, {}, function(data) { $.each(data, function(i, item) { alert(item.title); alert(i); }); }); But the above code returns all 20 items in my file. What mistakes am I making? On Dec 28, 3:57 pm, MorningZ morni...@gmail.com wrote: Want to make life MUCH easier than all those IE-specific hacks? Check out Json.NET http://james.newtonking.com/pages/json-net.aspx On Dec 28, 1:15 am, JQueryProgrammer jain.ashis...@gmail.com wrote: I got the solution to this. Actually this code was working in Firefox and not in IE. When I tried to run in IE, it was giving error 12030 (Server unexpectedly terminated connection) from IE's XMLHttpRequest object. The solution: In my HttpHandler I included the code: System.IO.Stream st = context.Request.InputStream; byte[] buf = new byte[100]; while (true) { int iRead = st.Read(buf, 0, 100); if (iRead == 0) break;} st.Close(); Actually ASp.Net does not read the complete incoming input stream automatically. In order for IE's XMLHttpRequest object to properly read return stream the input stream must be completely read by the server (even if you are not interested in it). On Dec 28, 10:29 am, JQueryProgrammer jain.ashis...@gmail.com wrote: Hi All, I was working with a basic example where I wanted to get JSON data from the HttpHandler. My javascript code looks like: $.ajax({ url: 'Handler1.ashx', type: 'POST', data: { name: 'MyName' }, contextType: 'application/json; charset=utf-8', dataType: 'json', success: function(data) { alert(Data Saved + data.name); } }); My Handler1.ashx code looks like: context.Response.ContentType = application/json; string results = { 'name': '+ context.Request.Params[name] +' }; context.Response.Write(results); But I am not getting the results right. Infact I am not getting any result in data.name. Please let me know what is the mistake and what is the correct way to get JSON data.
[jQuery] Re: Hiding a div with content loaded via .load function
you have to make sure the DOM element (i.e. your close button) is available when you define your close() function. or use the livequery plugin. or use event delegation. On Mon, Dec 29, 2008 at 4:09 AM, amnesia440 spaceman...@gmail.com wrote: Hello. I am trying to load a login form into the #login_pop_box div via the .load function: $('#login_pop_box').hide(); $('a#login_pop_box_on').click(function() { $('#login_pop_box').load('ajax/login_global'); $('#login_pop_box').fadeIn('400'); }); $('a#login_pop_box_off').click(function() { $(this).parents('#login_pop_box').fadeOut('300'); }) This works, but when I try to cose the window with a link contained in the content I just loaded, nothing happens. Here is the link i the loaded content: a href=# id=login_pop_box_off[x]close/a
[jQuery] Re: jcarousel autostart
Sorry for beeing so short in the description, so here is my attempt. The Scenario is the following: I want to have an option for the jcarousel having autostart on a per user basis. So here is my attempt by using a cookie via php. In the header i ask for the cookie as follows: ?php if(!empty($_COOKIE['info_autoscroll'])){ $slider = $_COOKIE['info_autoscroll']; } else { $slider = 'manuell'; } ? $slider could get the two values manuell (german for by hand or auto) Next I start the jcarousel as follows: $(document).ready(function() { $('#mycarousel').jcarousel({ scroll: 1, easing: 'easein', ?php if($slider == 'auto') { echo auto: .$sliderduration., wrap: 'both',; }? initCallback: mycarousel_initCallback }); });
[jQuery] Re: jcarousel autostart
My callback goes as follows: function mycarousel_initCallback(carousel) { ?php if($slider == 'auto') { ? // Disable autoscrolling if the user clicks the prev or next button. carousel.buttonNext.bind('click', function() { carousel.startAuto(0); }); carousel.buttonPrev.bind('click', function() { carousel.startAuto(0); }); // Pause autoscrolling if the user moves with the cursor over the clip. carousel.clip.hover(function() { carousel.stopAuto(); }, function() { carousel.startAuto(); }); ?php } ? }; Next I have a function which handles the ajax stuff for the cookie and the success output: function getscrolltype(what) { $.get('autoscroll.php',{scrollmodus: what},function(returned_data) { if(what == auto) { $(#autoscroll_output).html(Automatisch scrollen); } if(what == manuell) { $(#autoscroll_output).html(Manuell scrollen); } } ); } The switch I realised as follows: div id=autoscroller h4Projektfenster:/h4 ul lia href=# onclick=getscrolltype('auto'); id=autoscrollAutomatisch scrollen/a/li lia href=# onclick=getscrolltype('manuell'); id=manuellscrollManuell scrollen/a/li /ul Gewählt: span id=autoscroll_output?php if ($slider==auto){ echo Automatisch scrollen; } else { echo Manuell scrollen; }?/span /div Finally my little page autoscroll.php that sets the php cookie and responds: ?php require_once('includes/config.inc.php'); $slider= $_GET['scrollmodus']; if($slider != auto $style != manuell){ $slider = manuell; } setcookie(info_autoscroll, $slider, time()+(604800 * $styleduration)); echo $slider; ? So what I trying to reach without sucess is to start/stop autoscroll from the javascript function getscrolltype above: function getscrolltype(what) { $.get('autoscroll.php',{scrollmodus: what},function(returned_data) { if(what == auto) { $(#autoscroll_output).html(Automatisch scrollen); *** Start the Autoscroll of my jcarousel now *** } if(what == manuell) { $(#autoscroll_output).html(Manuell scrollen); *** Stop the Autoscroll of my jcarousel now *** } } ); } I tried several things, but nothing worked out for me. The PHP part works well, but it obvious only comes out, if the Visitor clicks on a link. What I want is to start/stop Autoscroll immediately. Is that possible? Hope I described my Problem a lot better. Sorry for my English, I am german. Any help is greatly apreciated, I keep the fingers cross, that somebody couls help me out of this. Thank you.
[jQuery] Re: Problem with reloading AJAX content (Flowplayer) in jqModal window
check1
[jQuery] Re: Problem with reloading AJAX content (Flowplayer) in jqModal window
check1
[jQuery] Getting a menu item Li to do 2 things at once? onclick AND regular href trigger?
Hi... just starting out to get this going. I'm guessing that the reason onclick code has the #, for example: a href=# onclick=someFunction.add etc code etc etc /a is because it can't do the onclick AND more typical things like this example: lia href=#myID/a/li Is because they conflict... SOo! I have my Li/ul menu code doing a bunch of scrollto stuff. Took weeks to figure out. NOW I need to have the SAME menu, when I click on the Li's bring up a different flv video for each menu item (li) sheeesh... do I use live query or what. I'm REALLY stumped... I do have a much greater 'sorta' understanding of the: neolao flv player, swfobject2, jquery.swfobject.js, jmedia plugin, luke's flash plugin, and malsup's medai plugin. whew! :--) Though the REAL problem is to get some kinda elegant way of having the flv videos play in a seperate div location (stop when new video starts as well) when I click on each and every menu item. And, there menu items already are doing their scrollto coda-scroller type thing already. Yes... this question is my biggest question ever... Could a guru please comment on how to get the menu items to do BOTH what they're doing now as standard lia href=#myID/a/li AND also do the calling of the (I guess?) onclick thing to call the videos individually at the same time. I guess it shouldn't take me more than all year to do... hehehe what's left of it thank fully! if that makes sense...hehehe thank you for reading.
[jQuery] Re: Problem with reloading AJAX content (Flowplayer) in jqModal window
check1
[jQuery] Re: Problem with reloading AJAX content (Flowplayer) in jqModal window
check1
[jQuery] Re: corner plugin ie7 bug
http://www.tasker.it/img/demo/ hi sorry for the long delay..i moved everything here http://www.tasker.it/img/demo/ would you check now whether you can see it? On 23 Dic, 16:58, Mike Alsup mal...@gmail.com wrote: mmh..that's weird..i can see it right.. All of the scripts and stylesheets on that page return 403 Forbidden.
[jQuery] Re: Problem with reloading AJAX content (Flowplayer) in jqModal window
check1
[jQuery] Re: Problem with reloading AJAX content (Flowplayer) in jqModal window
check1
[jQuery] Re: Undocumented move/copy behavior of append() et al.
Perfect :) On Sun, Dec 28, 2008 at 11:45 PM, Dave Methvin dave.meth...@gmail.com wrote: Here's what I came up with, does it make sense? -- Content Most jQuery methods that accept content will accept one or more arguments of any of the following: * A DOM node element; * An array of DOM node elements; * A jQuery object; * A string representing HTML. Example: $(#div1).append( document.createElement(br), $(#div2), emafter div2/em ); Auto-Cloning Content inserting methods (append, prepend, before, after, and replaceWith) behave differently depending on the number of DOM elements currently selected by the jQuery object. If there is only one element in the jQuery object, the content is inserted to that element; content that was in another location in the DOM tree will be moved by this operation. This is essentially the same as the W3C DOM appendChild method. http://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#method-appendChild When multiple elements are selected by a jQuery object, these methods clone the content before inserting it to each element. Since the content can only exist in one location in the document tree, cloning is required in these cases so that the same content can be used in multiple locations. This rule also applies to the selector-insertion methods (appendTo, prependTo, insertBefore, insertAfter, and replaceAll), but the auto- cloning occurs if there is more than one element selected by the Selector provided as an argument to the method. When a specific behavior is needed regardless of the number of elements selected, use the .clone() or .remove() methods in conjunction with a selector-insertion method. This example will always clone #Thing, append it to each element with class OneOrMore, and leave the original #Thing unmolested in the document: $(#Thing).clone().appendTo(.OneOrMore); This example will always remove #Thing from the document and append it to .OneOrMore: $(#Thing).remove().appendTo(.OneOrMore);
[jQuery] Re: Querying XML with jQuery in IE6
ok, I find that I can get the json element very easy but still haven't found a way to get the attribute name. $(Test, data).each(function(i){ console.log($([...@name], this).text()); // does not work. console.log($(json, this).text()); // does work }); I have tried with the following queries: /te...@name] /t...@name t...@name @name Is this jQuery not supporting attribute selectors or is my xpath wrong? thanks in advance, jon. On Tue, Dec 23, 2008 at 4:40 PM, Anonymous ilaughlou...@gmail.com wrote: Hi all. I'm trying to get some values from an XML document in jQuery but lack of a (good) debugger in IE6 means that I can't figure this out. The XML is simple: XML: Tests Test name=Help json![CDATA[help.json]]/json /Test Test name=telia-big-box json![CDATA[telia-big-box.json]]/json /Test /Tests I get it through jQuery.get and the document is in the variable data: $(Test, data).each(function(i){ alert(this.childNodes[0].textContent); /*toc.append( tc.li( testLink(this.childNodes[1].textContent, this.attributes[0].nodeValue) ) );*/ }); The commented bit works in FF3 and I have found that it's the childNodes of the Test element that differs. Is there a safer way to query an XML document with jQuery, so I don't run into these abnormalties between browsers? Thanks in advance, Jon.
[jQuery] Re: ajaxStart don't work for ajax/load?
come on..give me a christmas present ;) On 23 Dic, 09:51, hcvitto hcvi...@gmail.com wrote: i'm still here :) ...?
[jQuery] Re: Refactoring problem with jquery-selectors
If you just want to use your function without changing the signature, you have to pass along the current this when calling your function. This is done using the call function JavaScript provides for functions. function addClickHandler(tableId, functionName, myUrl) { jQuery('#' + tableId + ' tbody').children('tr').click(function () { functionName.call(this,myUrl); // alternate syntax: functionName.apply(this, [myUrl]); }); } On Dec 28, 11:04 pm, j0llyr0g3r th3.gr31t.j0lly.r0...@googlemail.com wrote: Hui, fast reply.:-) I did as you proposed and it works fine now. Special thanks for the explanation! On 28 Dez., 22:26, Michael Geary m...@mg.to wrote: The problem is the first line in your clickOnTableRowResultSet() function: var row = jQuery(this); When you were using that function directly as a click handler, 'this' was set to the element being clicked. But now you are calling the function through an ordinary function call, so 'this' is not the same any more. (It's now the global object, i.e. the window object.) To fix it: function addClickHandler(tableId, functionName, myUrl) { jQuery('#' + tableId + ' ' + 'tbody').children('tr').click(function() { functionName(this,myUrl); }); } And: function clickOnTableRowResultSet(element,url) {...} -Mike From: j0llyr0g3r Hey guys, i am having problems with some refactoring: I have some html-tables to which i add an onclick-handler like this: CODE: addClickHandler('myTableID',myFunction); 'addClickHandler' looks like this: CODE: function addClickHandler(tableId, functionName) { jQuery('#' + tableId + ' ' + 'tbody').children('tr').click (functionName); } Now, all the functions i pass to this onclick-Handler look almost the same : CODE: function clickOnTableRowResultSet() { var row = jQuery(this); var songUrl = trimAll(row.find('td:last form input [name=hidden_url_field]').val()); var trackID = trimAll(row.find('td:last form input [name=hidden_id_field]').val()); var trackInfoUrl = /tracks/track_info/ + trackID; sendPlayEventToPlayer(songUrl); jQuery.ajax({success:function(request){$('#track_info').html (request);}, url:trackInfoUrl, async:false}); } CODE with trimAll being: CODE /* * trimAll replaces all whitespace and newlines from a string */ function trimAll(str) { return str.replace(/\n+|\s+/g,); } All of these functions basically do the same: they read out hidden fields in the last column of the table row, send an event to a flash- player and update a certain part of the website. The only thing in which they differ, is this part: var trackInfoUrl = /tracks/track_info/ + trackID; So i wanted to summarize all my almost identical functions into one by passing the above mentioned url to them. I tried it like this: Call to addClickHandler on the website: CODE addClickHandler('list_tracks_table',clickOnTableRowResultSet, '/ tracks/track_info/' ); Then I changed my addClickHandler like this: CODE function addClickHandler(tableId, functionName, myUrl) { jQuery('#' + tableId + ' ' + 'tbody').children('tr').click(function() { functionName(myUrl); }); } And finally summarized my clickOnTable...-functions like this: function clickOnTableRowResultSet(url) { var row = jQuery(this); var songUrl = trimAll(row.find('td:last form input [name=hidden_url_field]').val()); var trackID = trimAll(row.find('td:last form input [name=hidden_id_field]').val()); var trackInfoUrl = url + trackID; sendPlayEventToPlayer(songUrl); jQuery.ajax({success:function(request){$('#track_info').html (request);}, url:trackInfoUrl, async:false}); } So far, this looks good to me, but unfortunately it doesn't work. Using debugging i see that 'clickOnTableRowResultSet' gets passed the correct url, but then the line afterwards: CODE var songUrl = trimAll(row.find('td:last form input [name=hidden_url_field]').val()); gives me the JS-error: Error: str is undefined in function trimAll, which basically means that row.find('td:last form input[name=hidden_url_field]').val() yields undef. This is what i don't get, i didn't change any part of the logic which deals with finding the fields, etc. None of my changes affected these parts - at least in my eyes. But somehow the jquery-selectors seem to be unable to find my rows? Does anybody see what's the problem here?
[jQuery] Re: Problem with reloading AJAX content (Flowplayer) in jqModal window
check1
[jQuery] Re: Problem with reloading AJAX content (Flowplayer) in jqModal window
check1
[jQuery] Re: Problem with reloading AJAX content (Flowplayer) in jqModal window
check1
[jQuery] Re: Problem with reloading AJAX content (Flowplayer) in jqModal window
check1
[jQuery] Re: Problem with reloading AJAX content (Flowplayer) in jqModal window
check1
[jQuery] Re: Problem with reloading AJAX content (Flowplayer) in jqModal window
check1
[jQuery] Re: Problem with reloading AJAX content (Flowplayer) in jqModal window
check1
[jQuery] Re: Querying XML with jQuery in IE6
got it! $(Test, data).each(function(i){ console.log($(this).attr(name)); console.log($(json, this).text()); }); On Mon, Dec 29, 2008 at 11:16 AM, Anonymous ilaughlou...@gmail.com wrote: ok, I find that I can get the json element very easy but still haven't found a way to get the attribute name. $(Test, data).each(function(i){ console.log($([...@name], this).text()); // does not work. console.log($(json, this).text()); // does work }); I have tried with the following queries: /te...@name] /t...@name t...@name @name Is this jQuery not supporting attribute selectors or is my xpath wrong? thanks in advance, jon. On Tue, Dec 23, 2008 at 4:40 PM, Anonymous ilaughlou...@gmail.com wrote: Hi all. I'm trying to get some values from an XML document in jQuery but lack of a (good) debugger in IE6 means that I can't figure this out. The XML is simple: XML: Tests Test name=Help json![CDATA[help.json]]/json /Test Test name=telia-big-box json![CDATA[telia-big-box.json]]/json /Test /Tests I get it through jQuery.get and the document is in the variable data: $(Test, data).each(function(i){ alert(this.childNodes[0].textContent); /*toc.append( tc.li( testLink(this.childNodes[1].textContent, this.attributes[0].nodeValue) ) );*/ }); The commented bit works in FF3 and I have found that it's the childNodes of the Test element that differs. Is there a safer way to query an XML document with jQuery, so I don't run into these abnormalties between browsers? Thanks in advance, Jon.
[jQuery] Re: Problem with reloading AJAX content (Flowplayer) in jqModal window
check1
[jQuery] Re: Problem with reloading AJAX content (Flowplayer) in jqModal window
check1
[jQuery] Re: Problem with reloading AJAX content (Flowplayer) in jqModal window
check1
[jQuery] Re: Problem with reloading AJAX content (Flowplayer) in jqModal window
check1
[jQuery] Re: Problem with reloading AJAX content (Flowplayer) in jqModal window
check1
[jQuery] Re: Problem with reloading AJAX content (Flowplayer) in jqModal window
check1
[jQuery] Re: jCarousel
Dear Maddy, Jcarousel can display more 3 images and also can scroll more than 1 image ! you just have to mention some parameter $(some_selector).jCarouselLite({ btnNext: someId Or Class, btnPrev: someId Or Class, visible: 5, scroll:4 }); With Regards, Chandan Luthra Intelligrape Software On Sun, Dec 28, 2008 at 5:13 PM, maddy postbo...@gmail.com wrote: Hi thanks Torstein for your reply on my personal Mail ID regarding using Hi-slide along side jCarousel , what i would like to know is a) jCarousel displays only three images in the scroll can i increase it to to say five b) when i use Hi-slide as my default gallery viewer will all the functions of Hi-slide come into effect?? do i have to d\enable it with some script apart from what you have suggested in my mail see below snippet First, add the JS and the CSS for the page like in the Highslide download examples. Second, find this in the jCarousel example: // Apply thickbox tb_init(item); Change it to: // Apply Highslide item.onclick = function () { return hs.expand(this); }; Best regards, Torstein Hønsi /snippet thanks in advance maddy
[jQuery] Re: [treeview] Would like to limit toggle to the plus/minus icons
I'd like to do the opposite. Clicking any link in the tree (whether a parent or leaf) should load the page AND toggle to expand/collapse. In the demo, it LOOKS like this works. But the demo does not use real links, so the page isn't reloaded with another. You can see this on zunga.orgfree.com when clicking Meatballs, for example. The page is reloaded, but the node isn't expanded unless you click the + or -. Really happy with the plugin, very professional look. On Dec 12, 6:23 pm, Jörn Zaefferer joern.zaeffe...@googlemail.com wrote: Thetreeviewbinds click events on span-elements. If you remove or replace those, you should get the desired behaviour. Jörn On Fri, Dec 12, 2008 at 4:55 PM, Syntaxis m.hage...@gmail.com wrote: A few feature requests: 1. I want to be able to click on the text inside an LI-tag without toggling the tree. Just like in a filesystem, I want to select the folder, but not necessarily expand it's view. 2. Please keep up the good work!
[jQuery] Re: Problem with reloading AJAX content (Flowplayer) in jqModal window
check1
[jQuery] Re: Problem with reloading AJAX content (Flowplayer) in jqModal window
check1
[jQuery] Re: Problem with reloading AJAX content (Flowplayer) in jqModal window
check1
[jQuery] Re: ajaxStart don't work for ajax/load?
I dont think there is a problem with your javascript code. Did you try to set #load initial style to display:none ? Cheers, Daniel On Dec 29, 5:33 pm, hcvitto hcvi...@gmail.com wrote: come on..give me a christmas present ;) On 23 Dic, 09:51, hcvitto hcvi...@gmail.com wrote: i'm still here :) ...?
[jQuery] $.getJSON not returning specified count
Hi, I was trying to get 10 items from the json file. My url in $.getJSON looks like: $.getJSON(myjsonfile.json?count=10, {}, function(data) { $.each(data, function(i, item) { alert(item.title); alert(i); }); }); But the above code returns all 20 items from my file. What mistakes am I making?
[jQuery] Re: Problem with reloading AJAX content (Flowplayer) in jqModal window
check1
[jQuery] Re: Problem with reloading AJAX content (Flowplayer) in jqModal window
check1
[jQuery] Re: Problem with reloading AJAX content (Flowplayer) in jqModal window
check1
[jQuery] Re: Problem with reloading AJAX content (Flowplayer) in jqModal window
check1
[jQuery] Re: Problem with reloading AJAX content (Flowplayer) in jqModal window
check1
[jQuery] Re: $.getJSON not returning specified count
What's the returned JSON look like? On Dec 29, 6:50 am, JQueryProgrammer jain.ashis...@gmail.com wrote: Hi, I was trying to get 10 items from the json file. My url in $.getJSON looks like: $.getJSON(myjsonfile.json?count=10, {}, function(data) { $.each(data, function(i, item) { alert(item.title); alert(i); }); }); But the above code returns all 20 items from my file. What mistakes am I making?
[jQuery] Re: corner plugin ie7 bug
The page isnt loading correctly for me On Dec 29, 4:44 pm, hcvitto hcvi...@gmail.com wrote: http://www.tasker.it/img/demo/ hi sorry for the long delay..i moved everything here http://www.tasker.it/img/demo/ would you check now whether you can see it? On 23 Dic, 16:58, Mike Alsup mal...@gmail.com wrote: mmh..that's weird..i can see it right.. All of the scripts and stylesheets on that page return 403 Forbidden.
[jQuery] Re: $.getJSON not returning specified count
It contains all items from my json file. The file looks like: [ {title:Title1}, {title:Title2}, {title:Title3}, ... ... {title:Title20} ] On Dec 29, 4:55 pm, MorningZ morni...@gmail.com wrote: What's the returned JSON look like? On Dec 29, 6:50 am, JQueryProgrammer jain.ashis...@gmail.com wrote: Hi, I was trying to get 10 items from the json file. My url in $.getJSON looks like: $.getJSON(myjsonfile.json?count=10, {}, function(data) { $.each(data, function(i, item) { alert(item.title); alert(i); }); }); But the above code returns all 20 items from my file. What mistakes am I making?
[jQuery] [jCarousel] fetching the script with a PHP function?
I love this little and flexible script. The problem i got is that i'd like to fetch it with a PHP function instead of a plain HTNL address, but i cannot figure out how to do this. to explain it better, i've a php function called tep_image() wich supplied with an image address can create a thumbnail of the size i need, and i'd like the script to work with this script. Any clue?
[jQuery] Re: window.location = 'test/index.html'; error
try this http://www.aptana.com/node/336 skyspark wrote: Hello, I have been trying out the code from http://code.jquery.com/nightlies/jquery-nightly.build.zip as a solution for doing server side javascript with dom parsing/ manipulation. when i do sample code,some error happen like this r...@sec-portal:/usr/local/apache2/htdocs# java -jar build/js.jar Rhino 1.6 release 6 2007 06 28 js load('build/runtest/env.js'); js window.location = 'test/index.html'; test/index.html js Exception in thread Thread-0 org.mozilla.javascript.EcmaError: TypeError: Cannot call method createEvent of null (build/runtest/env.js#29) at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3343) at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:) at org.mozilla.javascript.ScriptRuntime.typeError(ScriptRuntime.java:3349) at org.mozilla.javascript.ScriptRuntime.typeError2(ScriptRuntime.java:3368) at org.mozilla.javascript.ScriptRuntime.undefCallError(ScriptRuntime.java:3387) at org.mozilla.javascript.ScriptRuntime.getPropFunctionAndThis(ScriptRuntime.java:2026) at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:3080) at script(build/runtest/env.js:29) at script.makeRequest(build/runtest/env.js:650) at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2393) at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:162) at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:393) at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:2834) at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:160) at org.mozilla.javascript.Context.call(Context.java:548) at org.mozilla.javascript.JavaAdapter.callMethod(JavaAdapter.java:507) at adapter1.run(adapter) at java.lang.Thread.run(Unknown Source) why it happend? help me. thanks -- View this message in context: http://www.nabble.com/window.location-%3D-%27test-index.html%27--error-tp21198825s27240p21199343.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: Problem with reloading AJAX content (Flowplayer) in jqModal window
check1
[jQuery] Tablesorter, problems ordering numbers
Hello, I have a tablesorter with a numeric column (the type is String so I have to use a parser to order the column as number ), the problem is that it does not order long numbers with comas separator. Here is the example of the sorted column: desc order-- -363,122,000.00; -28,000.00; 3,364,000.00; 10,000.00; 68,000.00 asc order-- 68,000.00; 10,000.00; 3,364,000.00; -28,000.00; -363,122,000.00 And this is part of my code: $.tablesorter.addParser({ id: digit2, is: function(s,table) { var c = table.config; return $.tablesorter.isDigit(s,c); }, format: function(s) { alert(s); if (s.match(',')) { s = s.replace(/\,/, ''); } if (s.match('')) { s = s.replace(/\/, ''); } if (s.match(' ')) { s = s.replace(/\ /, ''); } return $.tablesorter.formatFloat(s); }, type: numeric }) $(#credits).tablesorter({headers: {0:{sorter:'text'}, 1:{sorter:'text'}, 2:{sorter:'text'}, 3:{sorter:'digit2'}, 4:{sorter:'digit2'}, 5:{sorter:'digit2'}, 6:{sorter: 'date/MM/DD'}, 7: {sorter:'digit2'}}}); Can anybody help me with this?? Thanks a lot!! Sole
[jQuery] Re: corner plugin ie7 bug
stylesheet main.css seems to be missing. On Dec 29, 6:56 am, Daniel dqmin...@gmail.com wrote: The page isnt loading correctly for me On Dec 29, 4:44 pm, hcvitto hcvi...@gmail.com wrote: http://www.tasker.it/img/demo/ hi sorry for the long delay..i moved everything here http://www.tasker.it/img/demo/ would you check now whether you can see it? On 23 Dic, 16:58, Mike Alsup mal...@gmail.com wrote: mmh..that's weird..i can see it right.. All of the scripts and stylesheets on that page return 403 Forbidden.
[jQuery] Extend Joomla Simplify with the superfishmenu!!!
Hello, can anybody tell me where i should copy the extended files of the ZIP- file mod_superfishmenu.zip? I want to use the basic-style menu in my Joomla simplify-template. I don't know exactly where I have to copy the files of teh ZIP-file to my simplify template. Does anybody also know how I can integrate the menu if i copied the files to the right place? Thx, Ben
[jQuery] jQuery.getJSON Current Url Prefixed
hi am using jQuery.getJSON to request a cross-domain page using the following code jQuery.getJSON(crossDomainUrl, function(result) { processResult(result); }); but i never reach the cross domain url as the current url is always prefixed to it, like so Current Page Url : http://localhost/page.aspx Cross Domain Url : http://remoteServer getJSON final request url is : http://localhost/page.aspxhttp://remoteServer so i always get a 404 error can you please tell me why is this happening thanks -- View this message in context: http://www.nabble.com/jQuery.getJSON-Current-Url-Prefixed-tp21201707s27240p21201707.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] closures and for loop question, NS_ERROR_XPC_BAD_CONVERT_JS
JQuery users, I'm receiving the following error: Error: [Exception... Could not convert JavaScript argument arg 0 [nsIDOMViewCSS.getComputedStyle] nsresult: 0x80570009 (NS_ERROR_XPC_BAD_CONVERT_JS) location: JS frame :: http://REMOVED.net/jquery-1.2.6.min.js :: anonymous :: line 22 data: no] Source File: http://REMOVED.net/jquery-1.2.6.min.js Line: 22 When I run this code: $(function () { var imgs = $(div).filter(.fc_Picture); var parentDiv; for(i=0; iimgs.length; i++) { var img = new Image(); parentDiv = imgs[i]; $(img) .load(function(parentDiv,image) { return function() { $(image).hide() $(parentDiv).removeClass('fc_loader'); $(parentDiv).append(image); $(image).fadeIn(); }(parentDiv,image); }) .attr('src','fc_image.php?imageid='+$(imgs[i]).attr ('id').split(_)[2]) .attr('width','50') } }); What I'm trying to do is have a set of images and each one loads with one of those cute little loader swirl things. I understand the pitfalls of for loops and closures (after much head scratching) but I still can't get it to work and to be honest I haven't the faintest what that error message means. Thanks for your help Joel
[jQuery] Re: jQuery.getJSON Current Url Prefixed
Is your http://remoteServer page a json file or is it returning a json data? buaziz wrote: hi am using jQuery.getJSON to request a cross-domain page using the following code jQuery.getJSON(crossDomainUrl, function(result) { processResult(result); }); but i never reach the cross domain url as the current url is always prefixed to it, like so Current Page Url : http://localhost/page.aspx Cross Domain Url : http://remoteServer getJSON final request url is : http://localhost/page.aspxhttp://remoteServer so i always get a 404 error can you please tell me why is this happening thanks -- View this message in context: http://www.nabble.com/jQuery.getJSON-Current-Url-Prefixed-tp21201707s27240p21201707.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Table Sorter - Problem sorting numbers with comma seperators
Hi! it`s me again, I`m new using tablesroter and I don´t know how to solve this problem of sorting numbers with comma separators(it doesn`t sort well), I`ve been looking everywhere but I didn`t get a solution. Can anybody help me?? Thanks Sole.
[jQuery] Re: jQuery.getJSON Current Url Prefixed
the remoteServer is returning JSON data. -- View this message in context: http://www.nabble.com/jQuery.getJSON-Current-Url-Prefixed-tp21201707s27240p21203328.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: jQuery.getJSON Current Url Prefixed
Can u paste the remote server url over here. I will try from my local m/c. I tried the sample given on http://docs.jquery.com /Ajax/jQuery.getJSON#urldatacallback and it works perfectly fine. On Dec 29, 6:34 pm, buaziz bua...@gmail.com wrote: the remoteServer is returning JSON data. -- View this message in context:http://www.nabble.com/jQuery.getJSON-Current-Url-Prefixed-tp21201707s... Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: corner plugin ie7 bug
this is driving me crazy!! anyway, i moved everything here http://www.pipelabitta.it/demo/ and this should be it! On 29 Dic, 14:07, donb falconwatc...@comcast.net wrote: stylesheet main.css seems to be missing. On Dec 29, 6:56 am, Daniel dqmin...@gmail.com wrote: The page isnt loading correctly for me On Dec 29, 4:44 pm, hcvitto hcvi...@gmail.com wrote: http://www.tasker.it/img/demo/ hi sorry for the long delay..i moved everything here http://www.tasker.it/img/demo/ would you check now whether you can see it? On 23 Dic, 16:58, Mike Alsup mal...@gmail.com wrote: mmh..that's weird..i can see it right.. All of the scripts and stylesheets on that page return 403 Forbidden.
[jQuery] Re: ajaxStart don't work for ajax/load?
hi daniel thanks for the replay.. yes, it's initial state is hidden..As far as you know, should the ajaxStart/ajaxStop functions work with the load function too? On 29 Dic, 12:49, Daniel dqmin...@gmail.com wrote: I dont think there is a problem with your javascript code. Did you try to set #load initial style to display:none ? Cheers, Daniel On Dec 29, 5:33 pm, hcvitto hcvi...@gmail.com wrote: come on..give me a christmas present ;) On 23 Dic, 09:51, hcvitto hcvi...@gmail.com wrote: i'm still here :) ...?
[jQuery] Re: ajaxStart don't work for ajax/load?
yes it should. Do you have a test page ? Cheers, Daniel On Dec 29, 8:47 pm, hcvitto hcvi...@gmail.com wrote: hi daniel thanks for the replay.. yes, it's initial state is hidden..As far as you know, should the ajaxStart/ajaxStop functions work with the load function too? On 29 Dic, 12:49, Daniel dqmin...@gmail.com wrote: I dont think there is a problem with your javascript code. Did you try to set #load initial style to display:none ? Cheers, Daniel On Dec 29, 5:33 pm, hcvitto hcvi...@gmail.com wrote: come on..give me a christmas present ;) On 23 Dic, 09:51, hcvitto hcvi...@gmail.com wrote: i'm still here :) ...?
[jQuery] Re: ajaxStart don't work for ajax/load?
Unfortunately not at the moment. To make one a have to move everything on another server.. i 'll wait fotr the website to be published, then i will post again. Thanks a lot, anyway VItto On 29 Dic, 15:01, Daniel dqmin...@gmail.com wrote: yes it should. Do you have a test page ? Cheers, Daniel On Dec 29, 8:47 pm, hcvitto hcvi...@gmail.com wrote: hi daniel thanks for the replay.. yes, it's initial state is hidden..As far as you know, should the ajaxStart/ajaxStop functions work with the load function too? On 29 Dic, 12:49, Daniel dqmin...@gmail.com wrote: I dont think there is a problem with your javascript code. Did you try to set #load initial style to display:none ? Cheers, Daniel On Dec 29, 5:33 pm, hcvitto hcvi...@gmail.com wrote: come on..give me a christmas present ;) On 23 Dic, 09:51, hcvitto hcvi...@gmail.com wrote: i'm still here :) ...?
[jQuery] Selector Logic
Hey guys, Sorry for a real basic question but I just cant work this out.. I have the following structure based on a jqGrid output.. div id=div_1 div table tbody tr td class='headerLeft'IMG //tdthTEXT/th td class='headerButton'IMG //td td class='headerRight'IMG //td /tr /tbody /table /div /div based on that structure how do access the IMG that belongs to the td with class headerButton? Been scratching my head for 2 hours now :(
[jQuery] Re: $.getJSON not returning specified count
The count parameter must be implemented server-side, the ajax call has nothing to do with it. If you want to filter the first 10 items, use something like this: $.getJSON(myjsonfile.json, {}, function(data) { $(data).slice(10).each(function(i, item) { alert(item.title); alert(i); }); }); -ricardo On Dec 29, 9:58 am, JQueryProgrammer jain.ashis...@gmail.com wrote: It contains all items from my json file. The file looks like: [ {title:Title1}, {title:Title2}, {title:Title3}, ... ... {title:Title20} ] On Dec 29, 4:55 pm, MorningZ morni...@gmail.com wrote: What's the returned JSON look like? On Dec 29, 6:50 am, JQueryProgrammer jain.ashis...@gmail.com wrote: Hi, I was trying to get 10 items from the json file. My url in $.getJSON looks like: $.getJSON(myjsonfile.json?count=10, {}, function(data) { $.each(data, function(i, item) { alert(item.title); alert(i); }); }); But the above code returns all 20 items from my file. What mistakes am I making?
[jQuery] Re: fetching the script with a PHP function?
uh? Just have your PHP script run the function and return the new thumbnail URL, then it's easy: $('somewhere').get('create_thumbnail.php', { url: 'http://images.com/ image.jpg' }, function(newURL){ $('img/').attr('src',newURL).appendTo('body'); }); (if that's any close to what you meant) On Dec 29, 8:59 am, Drako a...@drako.it wrote: I love this little and flexible script. The problem i got is that i'd like to fetch it with a PHP function instead of a plain HTNL address, but i cannot figure out how to do this. to explain it better, i've a php function called tep_image() wich supplied with an image address can create a thumbnail of the size i need, and i'd like the script to work with this script. Any clue?
[jQuery] Re: Selector Logic
Sorry - left out the important part The containing div (div_1) can be created more than one on a page -- so div_1 , div_2 , div_3 and they would all contain the structure described above.. this is why I cant just access using $ (.headerButton) as there could be potentially more than 1. I reasoned therefore that i need to access via the unique div_n id and make way through the selectors to ensure i get the right one..?
[jQuery] Re: $.getJSON not returning specified count
Yeah, as there are 20 items returned over the wire, i'm not sure how that loop was supposed to know to stop at 10 Time to revisit the server side code of things On Dec 29, 10:05 am, Ricardo Tomasi ricardob...@gmail.com wrote: The count parameter must be implemented server-side, the ajax call has nothing to do with it. If you want to filter the first 10 items, use something like this: $.getJSON(myjsonfile.json, {}, function(data) { $(data).slice(10).each(function(i, item) { alert(item.title); alert(i); }); }); -ricardo On Dec 29, 9:58 am, JQueryProgrammer jain.ashis...@gmail.com wrote: It contains all items from my json file. The file looks like: [ {title:Title1}, {title:Title2}, {title:Title3}, ... ... {title:Title20} ] On Dec 29, 4:55 pm, MorningZ morni...@gmail.com wrote: What's the returned JSON look like? On Dec 29, 6:50 am, JQueryProgrammer jain.ashis...@gmail.com wrote: Hi, I was trying to get 10 items from the json file. My url in $.getJSON looks like: $.getJSON(myjsonfile.json?count=10, {}, function(data) { $.each(data, function(i, item) { alert(item.title); alert(i); }); }); But the above code returns all 20 items from my file. What mistakes am I making?
[jQuery] Re: bind add hash to url to an existing function
First, use a single function for all your sections: function showSection(hash) { var tp = '.'+hash.substring(1); $(#projectselect li).not(tp).removeClass('selected').hide().end() .filter(tp).addClass('selected').show(); } $(#subnav a).click(function(){ showSection( $(this).attr('href') ); }); Then you can reuse it on load: $(document).ready(function(){ showSection( window.location.hash ); }); cheers, - ricardo On Dec 28, 9:39 pm, John Przepadlo j...@jlanedesign.com wrote: Hey, I am a designer who is redesigning my portfolio and incorporating some jQuery on the new site. I have a function that acts to filter some items on a page. I would like to also be able to link into the page and have it already filter the results. Here is the page:http://www.jlanedesign.com/download/jld_new/code/projects/ If you click any one of the inline list items near the top: web design, web dev, print, branding, photography, they have an onclick function that hides the other options. What I would like to do is have a url be able to directly do this same function. IE:http://www.jlanedesign.com/download/jld_new/code/projects/#print would filter the results of the page and show only the print projects as the link at top does. Okay be kind but my basic function looks like this: // filtering for sub nav on projects/index.html $(a.print).click(function(){ $(.webprojects, .devprojects, .photoprojects, .logoprojects).hide (); $(.all, .printprojects).show(); $(.print).addClass(selected); $(.all, .web, .dev, .photo, .logo).removeClass(selected); }); $(a.web).click(function(){ $(.printprojects, .devprojects, .photoprojects, .logoprojects).hide (); $(.all, .webprojects).show(); $(.web).addClass(selected); $(.all, .print, .dev, .photo, .logo).removeClass(selected); }); ... Is there a way to bind the hash to this function? Is there another way to go about this? Thoughts, ideas, comments?
[jQuery] Re: jQuery.getJSON Current Url Prefixed
its basically the panoramio url given here http://www.panoramio.com/api/ sample query : http://www.panoramio.com/map/get_panoramas.php?order=popularityset=publicfrom=0to=20minx=-180miny=-90maxx=180maxy=90size=medium -- View this message in context: http://www.nabble.com/jQuery.getJSON-Current-Url-Prefixed-tp21201707s27240p21204663.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: bind add hash to url to an existing function
Much more compact. Thanks for the direction. I'll wrap my head around it, give it a whirl and let you know the results. On Dec 29, 7:30 am, Ricardo Tomasi ricardob...@gmail.com wrote: First, use a single function for all your sections: function showSection(hash) { var tp = '.'+hash.substring(1); $(#projectselect li).not(tp).removeClass('selected').hide().end() .filter(tp).addClass('selected').show(); } $(#subnav a).click(function(){ showSection( $(this).attr('href') ); }); Then you can reuse it on load: $(document).ready(function(){ showSection( window.location.hash ); }); cheers, - ricardo On Dec 28, 9:39 pm, John Przepadlo j...@jlanedesign.com wrote: Hey, I am a designer who is redesigning my portfolio and incorporating some jQuery on the new site. I have a function that acts to filter some items on a page. I would like to also be able to link into the page and have it already filter the results. Here is the page:http://www.jlanedesign.com/download/jld_new/code/projects/ If you click any one of the inline list items near the top: web design, web dev, print, branding, photography, they have an onclick function that hides the other options. What I would like to do is have a url be able to directly do this same function. IE:http://www.jlanedesign.com/download/jld_new/code/projects/#print would filter the results of the page and show only the print projects as the link at top does. Okay be kind but my basic function looks like this: // filtering for sub nav on projects/index.html $(a.print).click(function(){ $(.webprojects, .devprojects, .photoprojects, .logoprojects).hide (); $(.all, .printprojects).show(); $(.print).addClass(selected); $(.all, .web, .dev, .photo, .logo).removeClass(selected); }); $(a.web).click(function(){ $(.printprojects, .devprojects, .photoprojects, .logoprojects).hide (); $(.all, .webprojects).show(); $(.web).addClass(selected); $(.all, .print, .dev, .photo, .logo).removeClass(selected); }); ... Is there a way to bind the hash to this function? Is there another way to go about this? Thoughts, ideas, comments?
[jQuery] Re: Selector Logic
Depending on what you are trying to do: $(#div_1 .headerButton img); // return the img in header button for div_1 $(.headerButton img); // return an array of img for each .headerButton You can then iterate over the array for additional processing. If you are passing the div_n (divId) dynamically, the following will work: $(# + divId + .headerButton img); Hope that helps. -Eric On Dec 29, 7:19 am, daveyoi dave_andr...@foobar.me.uk wrote: Sorry - left out the important part The containing div (div_1) can be created more than one on a page -- so div_1 , div_2 , div_3 and they would all contain the structure described above.. this is why I cant just access using $ (.headerButton) as there could be potentially more than 1. I reasoned therefore that i need to access via the unique div_n id and make way through the selectors to ensure i get the right one..?
[jQuery] Re: Why isn't the name attr in this code incrementing?
('#main-photo-next :last').name You're missing the $/jQuery and trying to get a property that doesn't exist. change that to $(this).attr('name').replace(...) and you're set. On Dec 29, 1:36 am, Rick Faircloth r...@whitestonemedia.com wrote: Hi, all... I'm cloning a section of code to create additional image inputs in a form, along with a yes/no select field. When the cloning occurs, I also need to increment the field names of the select statement (main-photo-1, main-photo-2, etc.), and the file input field (image-upload-1, image-upload-2, etc.) Here's the HTML: div id=image-input div id=image-div-1 pIs this photo the main property photo?/p select id=main-photo-next name=main-photo-1 class=textinput01 cfif isdefined(form.fieldnames) option value=cfoutput#form.main-photo-1#/cfoutput selected/option /cfif option value=YesYes/option option value=NoNo/option /select input id=image-next name=image-upload-1 type=file size=65 value= /div /div button id=add-imageAdd New Image Field/button Here's the jQuery (a hacked-up version of something simpler that worked well, but was missing functionality I now need) that I'm using to clone the entire div, image-div-1. script type=text/javascript $(document).ready(function() { $('#add-image').click(function() { $('#image-div-1').clone(true) .attr('id', function() { return this.id.replace(/(.+)(\d+$)/, function(s, p1, p2) { return p1 + (parseInt(p2, 10) + 1); }) }) .appendTo('#image-input'); return false; $('#main-photo-next :last').attr('name', function() { return ('#main-photo-next :last').name.replace(/(.+)(\d+$)/, function(s, p1, p2) { return p1 + (parseInt(p2, 12) + 1); }) }); }); }); /script As you can tell, the code is not complete, as it doesn't deal with incrementing the image-next file input field. When I click the button to clone the div, everything appears in the DOM as it should, but the name of the select input is not incrementing. Each select statement is named main-photo-1. How do I need to adjust the code to cause the name to increment? Also, what code would I add to increment the image-next filefield? One last issue is how to increment the value in the select statement, cfoutput#form.main-photo-1#/cfoutput. Any tips or code would be appreciated! Thanks, Rick
[jQuery] Re: Getting a menu item Li to do 2 things at once? onclick AND regular href trigger?
You can add as many listeners as you want: $('a').click(function(){ scrollTo(moon); }); $('a').click(function(){ alert('Me works too'); }); $('a').click(function(){ alert('damn, stop using alerts'); }); $('a').click(function(){ openFlash(); }); On Dec 29, 7:37 am, yvonney yvonn...@gmail.com wrote: Hi... just starting out to get this going. I'm guessing that the reason onclick code has the #, for example: a href=# onclick=someFunction.add etc code etc etc /a is because it can't do the onclick AND more typical things like this example: lia href=#myID/a/li Is because they conflict... SOo! I have my Li/ul menu code doing a bunch of scrollto stuff. Took weeks to figure out. NOW I need to have the SAME menu, when I click on the Li's bring up a different flv video for each menu item (li) sheeesh... do I use live query or what. I'm REALLY stumped... I do have a much greater 'sorta' understanding of the: neolao flv player, swfobject2, jquery.swfobject.js, jmedia plugin, luke's flash plugin, and malsup's medai plugin. whew! :--) Though the REAL problem is to get some kinda elegant way of having the flv videos play in a seperate div location (stop when new video starts as well) when I click on each and every menu item. And, there menu items already are doing their scrollto coda-scroller type thing already. Yes... this question is my biggest question ever... Could a guru please comment on how to get the menu items to do BOTH what they're doing now as standard lia href=#myID/a/li AND also do the calling of the (I guess?) onclick thing to call the videos individually at the same time. I guess it shouldn't take me more than all year to do... hehehe what's left of it thank fully! if that makes sense...hehehe thank you for reading.
[jQuery] Re: Getting a menu item Li to do 2 things at once? onclick AND regular href trigger?
really? I thought one had to namespace an event for it not to overwrite previously set behaviours. $('a').bind('click.scroll',function(){ scrollTo(moon); }); $('a').bind('click.alert1',function(){ alert('Me works too'); }); }); On Mon, Dec 29, 2008 at 5:06 PM, Ricardo Tomasi ricardob...@gmail.com wrote: You can add as many listeners as you want: $('a').click(function(){ scrollTo(moon); }); $('a').click(function(){ alert('Me works too'); }); $('a').click(function(){ alert('damn, stop using alerts'); }); $('a').click(function(){ openFlash(); }); On Dec 29, 7:37 am, yvonney yvonn...@gmail.com wrote: Hi... just starting out to get this going. I'm guessing that the reason onclick code has the #, for example: a href=# onclick=someFunction.add etc code etc etc /a is because it can't do the onclick AND more typical things like this example: lia href=#myID/a/li Is because they conflict... SOo! I have my Li/ul menu code doing a bunch of scrollto stuff. Took weeks to figure out. NOW I need to have the SAME menu, when I click on the Li's bring up a different flv video for each menu item (li) sheeesh... do I use live query or what. I'm REALLY stumped... I do have a much greater 'sorta' understanding of the: neolao flv player, swfobject2, jquery.swfobject.js, jmedia plugin, luke's flash plugin, and malsup's medai plugin. whew! :--) Though the REAL problem is to get some kinda elegant way of having the flv videos play in a seperate div location (stop when new video starts as well) when I click on each and every menu item. And, there menu items already are doing their scrollto coda-scroller type thing already. Yes... this question is my biggest question ever... Could a guru please comment on how to get the menu items to do BOTH what they're doing now as standard lia href=#myID/a/li AND also do the calling of the (I guess?) onclick thing to call the videos individually at the same time. I guess it shouldn't take me more than all year to do... hehehe what's left of it thank fully! if that makes sense...hehehe thank you for reading.
[jQuery] Re: UI Colorpicker plugin doesn't work with IE
These are known issues and are some of the reasons colorpicker was removed after 1.6rc2. It will not be in the 1.6 final release, but will be refactored, hopefully in time for 1.7. - Richard On Sun, Dec 28, 2008 at 4:59 PM, Samuel Santos sama...@gmail.com wrote: I've been trying to get the UI Colorpicker plugin working, but it has been tricky because the documentation and CSS styles are either missing or pretty buggy. I've got a working example a href=http://samaxes.appspot.com/zip/ colorpicker.zip http://samaxes.appspot.com/zip/colorpicker.ziphere/a. My example works correctly with almost all the browsers I've tested it with (Firefox, Chrome, and Safari), but unfortunately it doesn't work with IE (tested with IE7). I've fixed the CSS bugs, but I'm yet to find if there is any JavaScript bug. Have anyone successfully make it working with IE? If yes, please let me know how.
[jQuery] Re: jQuery.getJSON Current Url Prefixed
Try this code: $.getJSON(http://www.panoramio.com/map/get_panoramas.php? order=popularityset=publicfrom=0to=20minx=-180miny=-90maxx=180maxy=90size=mediumcallback=?, {}, function(data) { $(data).each(function(i, item) { alert($(this)[0].photos[i].photo_id); }) } ); See if it helps :) On Dec 29, 8:30 pm, buaziz bua...@gmail.com wrote: its basically the panoramio url given here http://www.panoramio.com/api/ sample query : http://www.panoramio.com/map/get_panoramas.php?order=popularityset=p... -- View this message in context:http://www.nabble.com/jQuery.getJSON-Current-Url-Prefixed-tp21201707s... Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: Getting a menu item Li to do 2 things at once? onclick AND regular href trigger?
How WONDERFUL to have had your info on this. Thank you both for the puzzle pieces!!! I will get right to it to try to get this working.:---)))
[jQuery] Re: Why isn't the name attr in this code incrementing?
Well...close, but no cigar at the moment. I've got this jQuery now: $(document).ready(function() { $('#add-image').click(function() { $('#image-div-1').clone(true) .attr('id', function() { return this.id.replace(/(.+)(\d+$)/, function(s, p1, p2) { return p1 + (parseInt(p2, 10) + 1); }) }) .appendTo('#image-input'); $('#main-photo-next:last').attr('name', function() { return $(this).attr('name').replace(/(.+)(\d+$)/, function(s, p1, p2) { return p1 + (parseInt(p2, 10) + 1); }) }); return false; }); }); And it's still cloning div correctly, but the last part, $('#main-photo-next:last') etc., is now renumbering the original name attribute of the first #main-photo-next div, instead of the second (which would be the last when the first clone is created). So I end up with select id=main-photo-next name=main-photo-2 followed by select id=main-photo-next name=main-photo-1 instead of select id=main-photo-next name=main-photo-1 followed by select id=main-photo-next name=main-photo-2 Is the functioning order of the code wrong somewhere? Rick -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Ricardo Tomasi Sent: Monday, December 29, 2008 11:02 AM To: jQuery (English) Subject: [jQuery] Re: Why isn't the name attr in this code incrementing? ('#main-photo-next :last').name You're missing the $/jQuery and trying to get a property that doesn't exist. change that to $(this).attr('name').replace(...) and you're set. On Dec 29, 1:36 am, Rick Faircloth r...@whitestonemedia.com wrote: Hi, all... I'm cloning a section of code to create additional image inputs in a form, along with a yes/no select field. When the cloning occurs, I also need to increment the field names of the select statement (main-photo-1, main-photo-2, etc.), and the file input field (image-upload-1, image-upload-2, etc.) Here's the HTML: div id=image-input div id=image-div-1 pIs this photo the main property photo?/p select id=main-photo-next name=main-photo-1 class=textinput01 cfif isdefined(form.fieldnames) option value=cfoutput#form.main-photo-1#/cfoutput selected/option /cfif option value=YesYes/option option value=NoNo/option /select input id=image-next name=image-upload-1 type=file size=65 value= /div /div button id=add-imageAdd New Image Field/button Here's the jQuery (a hacked-up version of something simpler that worked well, but was missing functionality I now need) that I'm using to clone the entire div, image-div-1. script type=text/javascript $(document).ready(function() { $('#add-image').click(function() { $('#image-div-1').clone(true) .attr('id', function() { return this.id.replace(/(.+)(\d+$)/, function(s, p1, p2) { return p1 + (parseInt(p2, 10) + 1); }) }) .appendTo('#image-input'); return false; $('#main-photo-next :last').attr('name', function() { return ('#main-photo-next :last').name.replace(/(.+)(\d+$)/, function(s, p1, p2) { return p1 + (parseInt(p2, 12) + 1); }) }); }); }); /script As you can tell, the code is not complete, as it doesn't deal with incrementing the image-next file input field. When I click the button to clone the div, everything appears in the DOM as it should, but the name of the select input is not incrementing. Each select statement is named main-photo-1. How do I need to adjust the code to cause the name to increment? Also, what code would I add to increment the image-next filefield? One last issue is how to increment the value in the select statement, cfoutput#form.main-photo-1#/cfoutput. Any tips or code would be appreciated! Thanks, Rick
[jQuery] Re: [autocomplete] Pressing Enter submits the form. Please Help
Please provide a testpage. Jörn On Sat, Dec 27, 2008 at 1:25 AM, Olaf olaf.spaarm...@googlemail.com wrote: Hi, thanks for the great plugin! I'm having some problems here on Firefox 3 and Safari: When adding autocomplete to a field everything works fine, except that the form gets submitted when I select a entry from the list and press Enter. If I put a onsubmit = return false; in my form, nothing happens at all and firebug doesn't show any errors. I also googled a lot and some people seem to have the same problem, but I didn't find any solution. Here's my form HTML: form action=/people class=new_person id=new_person method=post onSubmit=return false; input autocomplete=off id=person_company_name name=person [company_name] size=30 type=text / input id=person_submit name=commit type=submit value=Save / /form And here is the jQuery Code in a Javascript File: jQuery(document).ready(function() { jQuery(#person_company_name).autocomplete(/people/ auto_complete_for_company_name) }); Please help anyone! I would really appreciate it! If you need any more information, just drop me a note. Thanks!
[jQuery] Re: [tooltip] - Hover over tooltip so you can add a link
The site isn't reachable... Jörn On Sat, Dec 27, 2008 at 8:36 PM, kenitech keithhop...@gmail.com wrote: This is an easy way to hack Jorn's tooltip so you may hover over the tooltip and click on a link: http://www.artworknotavailable.com/2008/12/27/jorn-zaefferers-tooltip-hacks/ hack of: http://bassistance.de/jquery-plugins/jquery-plugin-tooltip/
[jQuery] Re: Selector Logic
Use the associated div's context: $(.headerbutton img,#div_1); This is also highly optimal as jQuery no longer searches the entire DOM for all classes of headerbutton, only the nodes with class headerbutton in the context of #div_1. You can read more about context here: http://docs.jquery.com/Core/jQuery#expressioncontext Cheers. Joe http://www.subprint.com On Dec 29, 9:51 am, Eric Martin emarti...@gmail.com wrote: Depending on what you are trying to do: $(#div_1 .headerButton img); // return the img in header button for div_1 $(.headerButton img); // return an array of img for each .headerButton You can then iterate over the array for additional processing. If you are passing the div_n (divId) dynamically, the following will work: $(# + divId + .headerButton img); Hope that helps. -Eric On Dec 29, 7:19 am, daveyoi dave_andr...@foobar.me.uk wrote: Sorry - left out the important part The containing div (div_1) can be created more than one on a page -- so div_1 , div_2 , div_3 and they would all contain the structure described above.. this is why I cant just access using $ (.headerButton) as there could be potentially more than 1. I reasoned therefore that i need to access via the unique div_n id and make way through the selectors to ensure i get the right one..?
[jQuery] Re: writting plugin
Which is the right plugin writting way? Of course, there isn't any :) In javascript you can structure your code in almost countless ways. For a simple plugin here's what you need: http://www.learningjquery.com/2007/10/a-plugin-development-pattern but if you want to write object oriented plugins it's a bit more complicated (if you look at my profile or search on the list there are some quite long discussion about it) - though if you don't really know what is private and public just go for the link above. For a really good and short introduction to javascript I'd advise watching Douglas Crockford's videos on Yahoo Theatre. Briefly, the scope of the variable (or function) will be the function/closure it was declared in. This is the key to understand the differencies above. $myObj.fn.extend = $myObj.extend = $.extend I haven't seen this before but it is actually a very smart thing: it reuses jquery's extend function, which will work on any object because it uses the `this` keyword, so it will be able to extend $myObj too. (see here what extend is used for: http://docs.jquery.com/Utilities/jQuery.extend). $myObj.fn is most likely a reference to $myObj.prototype but it's not indicated in your code above. Hope I could help a bit, the mailing seems to be dead during the holidays :) On Dec 28, 12:11 pm, Saledan bastil...@gmail.com wrote: up, please! bye max On 26 Dic, 12:19, Saledan bastil...@gmail.com wrote: Hi, i'm trying to write a jQuery plugin, i have read some posts, documents and other plugin code, but i don't understand the right standard to write a plugin. I found some patterns... == example 1== (function($) { $.fn.myPlugin = function(o) { return this.each(function() { // do something }); }; })(jQuery); == example 2== (function($) { $.fn.myPlugin = function(o) { return this.each(function() { // do something }); }; // private function function functionA () {..do something..}; })(jQuery); == example 3== (function($) { $.fn.myPlugin = function(o) { return this.each(function() { // do something }); }; // Public function?!? $.fn.myPlugin.functionA () {..do something..} })(jQuery); == example 4== (function($) { $.fn.myPlugin = function(o) { return this.each(function() { // do something }); }; $.extend(myPlugin.prototype, { functionA : function() {..do something..}, functionB : function() {..do something..} } })(jQuery); == example 5== (function($) { $.fn.myPlugin = function(o) { return this.each(function() { // do something var functionA = function () {..do something..} }); }; })(jQuery); == example 6== (function($) { $.fn.myPlugin = function(o) { return this.each(function() { // do something }); }; $.fn.extend ({ functionA : function () {..do something..} }); })(jQuery); == example 7== (function($) { $.fn.myPlugin = function(o) { return this.each(function() { new myObj(); }); }; $.myObj = function () {..do something..}; $myObj = $.myObj; $myObj.fn.extend = $myObj.extend = $.extend; $myObj.fn.extend ({ functionA: function() {..do something..}, functionB: function() {..do something..} }); $myObj.extend ({ functionC: function() {..do something..} }); })(jQuery); Which is the right plugin writting way? I think that the last example is well done... but i don't understand this line $myObj.fn.extend = $myObj.extend = $.extend; and the differents between $myObj.fn.extend and $myObj.extend .. public or private function? the first is for public function? Please may you help me? Many thanks bye Max
[jQuery] Re: livequery matchedFn scope?
If you generate the IDs dinamically and somehow an empty string is passed as the selector the document will be selected, so all these are the same: $()[0]; $()[0]; $(document)[0]; On Dec 27, 9:25 pm, Stephen sathoma...@gmail.com wrote: Sorry to bother folks with what is probably a silly question, but I can't quite figure out the scope for livequery matched functions. For example, if I have the following: $(#id:not(.inactive)).livequery(function() {alert(this);}) Then the alert shows this to be the matched selector, which is what I would expect. But if I have the following: $(#id).not(.inactive).livequery(function() {alert(this);}) Then the alert shows this to be the entire document. What's the reason for the difference in behavior? If anyone can explain this behavior, then it will probably let me figure out my real problem. In case someone has a lot of spare time, though, and wants to help with the root problem, here it is. I'm using ajax to load a lot of dynamically generated content, and I'm doing a fair bit of livequery processing on that content. The processing includes collapsing various sections of the content by hiding them. With a straightforward implementation, the browser briefly displays the entire (expanded) content before livequery has a chance to complete it's processing, so users are treated to an annoying peek-a- boo effect as the full content briefly appears and then collapses down to something more manageable. My approach for solving this problem is to deliver the content within a div wrapper with a css property of display:none. As soon as the content arrives, I add a livequery handler that calls show() on the div wrapper. Since this handler goes to the end of the livequery queue, it fires only after all the other livequery processing is complete. Works like a charm on test pages where all the IDs are hard-coded. On the real page, though, the IDs aren't hard-coded, so I have to dynamically figure out which elements to show. I'm stuck on trying to find a handle to the content so that I can show it. I would expect this to be the delivered content in the matched function, but, instead, it's the entire document. TIA, Stephen P.S. This is on Safari if it matters. I've briefly tried Firefox and it seems to behave the same way, so I haven't done exhaustive testing other than in Safari.
[jQuery] Re: Getting a menu item Li to do 2 things at once? onclick AND regular href trigger?
OK... I'm flying fairly blind though I'm enjoying it! 1) I guess that the scrollto stuff I'm doing is irrelevant. 2)The menu items each have a different #. There's nothing in the html other than the following example. (except for a jpg call or an alt=) Each pair surrounded by unique UL # of course The scrollto and localscroll stuff is all in the js and css. right?:-) lia href=#first-a/a/li lia href=#first-b/a/li lia href=#second-a/a/li lia href=#second-c/a/li lia href=#third-a/a/li lia href=#third-b/a/li 3) So, I was hoping that I could add an onclick or bind or whatever to each li only. And then I could have what's already happening just continue. (localscroll/scrollto etc.) WITH the addition of being able to have a new swf/jpeg/whatever appear and play/show in a totally seperate DIV. (I believe this is a different subject somewhat so initially I guess having a jpg show up in the seperate div and then be totally REPLACED by another one when I click on a different menu li would be a good start. Right now I'm just fumbling towards adding the onclick/bind. Would it be possible to get an example of what I'd add to the li's...and maybe how and where the JQ code would go and look like? I also read about the jjquery.listen plugin. Don't know at all if that would be useful. This is SO important right now for me. Very grateful for pointers...!
[jQuery] Re: Superfish - Nav-bar style with bgIframe?
Worked it out through process of elimination. Looks like the menu is ducking behind items with position:relative in the css. Not sure why, and I think bgIframe should display over it regardless of position rule, but I'll post more as I unravel it all in case someone in the future has this issue. (The specific example url above was bugged thanks to position:relative star hacks in cforms' wide_form.css stylesheet.) On Dec 24, 12:41 pm, Alkafy alk...@gmail.com wrote: Superfish ver. 1.4.8 Bgiframe ver. 2.1.1 JQuery ver. 1.2.6 Are you using the nav-bar style as well? I'm not sure if that matters or not since the ul's are displayed differently. On Dec 24, 11:48 am, SLR sean.rab...@gmail.com wrote: No dice, I'm afraid. The only change was that it generated white, drop- down arrows again. Thank you for trying to help me out. I'm going to create a test environment later today, with the same settings and files, but without being embedded in one of my pages. I think bgIframe may have a conflict with other javascript on the page. I'll post any results. Odd... I'm using that same code and it's working fine on my end. What version of Superfish and BgiFrame are you using? Currently, I'm running Superfish ver. 1.4.8 and BgiFrame ver. 2.1.1 with the code I mentioned earlier, and it's working flawlessly.
[jQuery] Re: Why isn't the name attr in this code incrementing?
How didn't I notice... IDs are unique, you can't do that. Use a class instead, .main-photo-next. You can also chain everything so you don't need to search again for the new element: $(document).ready(function() { $('#add-image').click(function() { $('#image-div-1').clone(true) .attr('id', function() { return this.id.replace(/(.+)(\d+$)/, function(s, p1, p2) { return p1 + (parseInt(p2, 10) + 1); }) }) .appendTo('#image-input') .find('.main-photo-next').attr('name', function() { return $(this).attr('name').replace(/(.+)(\d+$)/, function(s, p1, p2) { return p1 + (parseInt(p2, 10) + 1); }) }); return false; }); }); $(document).ready(function() { $('#add-image').click(function() { $('#image-div-1').clone(true) .attr('id', function() { return this.id.replace(/(.+)(\d+$)/, function(s, p1, p2) { return p1 + (parseInt(p2, 10) + 1); }) }) .appendTo('#image-input'); $('#main-photo-next:last').attr('name', function() { return $(this).attr('name').replace(/(.+)(\d+$)/, function(s, p1, p2) { return p1 + (parseInt(p2, 10) + 1); }) }); return false; }); }); And it's still cloning div correctly, but the last part, $('#main-photo-next:last') etc., is now renumbering the original name attribute of the first #main-photo-next div, instead of the second (which would be the last when the first clone is created). So I end up with select id=main-photo-next name=main-photo-2 followed by select id=main-photo-next name=main-photo-1 instead of select id=main-photo-next name=main-photo-1 followed by select id=main-photo-next name=main-photo-2 Is the functioning order of the code wrong somewhere? Rick -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Ricardo Tomasi Sent: Monday, December 29, 2008 11:02 AM To: jQuery (English) Subject: [jQuery] Re: Why isn't the name attr in this code incrementing? ('#main-photo-next :last').name You're missing the $/jQuery and trying to get a property that doesn't exist. change that to $(this).attr('name').replace(...) and you're set. On Dec 29, 1:36 am, Rick Faircloth r...@whitestonemedia.com wrote: Hi, all... I'm cloning a section of code to create additional image inputs in a form, along with a yes/no select field. When the cloning occurs, I also need to increment the field names of the select statement (main-photo-1, main-photo-2, etc.), and the file input field (image-upload-1, image-upload-2, etc.) Here's the HTML: div id=image-input div id=image-div-1 pIs this photo the main property photo?/p select id=main-photo-next name=main-photo-1 class=textinput01 cfif isdefined(form.fieldnames) option value=cfoutput#form.main-photo-1#/cfoutput selected/option /cfif option value=YesYes/option option value=NoNo/option /select input id=image-next name=image-upload-1 type=file size=65 value= /div /div button id=add-imageAdd New Image Field/button Here's the jQuery (a hacked-up version of something simpler that worked well, but was missing functionality I now need) that I'm using to clone the entire div, image-div-1. script type=text/javascript $(document).ready(function() { $('#add-image').click(function() { $('#image-div-1').clone(true) .attr('id', function() { return this.id.replace(/(.+)(\d+$)/, function(s, p1, p2) { return p1 + (parseInt(p2, 10) + 1); }) }) .appendTo('#image-input'); return false; $('#main-photo-next :last').attr('name', function() { return ('#main-photo-next :last').name.replace(/(.+)(\d+$)/, function(s, p1, p2) { return p1 + (parseInt(p2, 12) + 1); }) }); }); }); /script As you can tell, the code is not complete, as it doesn't deal with incrementing the image-next file input field. When I click the button to clone the div, everything appears in the DOM as it
[jQuery] Re: Superfish - Nav-bar style with bgIframe?
Similar thread here, so mine doesn't seem to be an isolated case: Superfish with bgiframe does not cover position:relative div in IE http://groups.google.com/group/jquery-en/browse_thread/thread/49e836df04d9b45b
[jQuery] Anyone have any ideas on why this code doesn't increment properly?
I've got this jQuery: $(document).ready(function() { $('#add-image').click(function() { $('#image-div-1').clone(true) .attr('id', function() { return this.id.replace(/(.+)(\d+$)/, function(s, p1, p2) { return p1 + (parseInt(p2, 10) + 1); }) }) .appendTo('#image-input'); $('#main-photo-next:last').attr('name', function() { return $(this).attr('name').replace(/(.+)(\d+$)/, function(s, p1, p2) { return p1 + (parseInt(p2, 10) + 1); }) }); return false; }); }); And it's cloning the div (image-div-1) correctly, but the last part, $('#main-photo-next:last') etc., is now renumbering the original name attribute of the first #main-photo-next div, instead of the second (which would be the last when the first clone is created). So I end up with select id=main-photo-next name=main-photo-2 followed by select id=main-photo-next name=main-photo-1 instead of select id=main-photo-next name=main-photo-1 followed by select id=main-photo-next name=main-photo-2 Is the functioning order of the code wrong somewhere? Rick -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Ricardo Tomasi Sent: Monday, December 29, 2008 11:02 AM To: jQuery (English) Subject: [jQuery] Re: Why isn't the name attr in this code incrementing? ('#main-photo-next :last').name You're missing the $/jQuery and trying to get a property that doesn't exist. change that to $(this).attr('name').replace(...) and you're set. On Dec 29, 1:36 am, Rick Faircloth r...@whitestonemedia.com wrote: Hi, all... I'm cloning a section of code to create additional image inputs in a form, along with a yes/no select field. When the cloning occurs, I also need to increment the field names of the select statement (main-photo-1, main-photo-2, etc.), and the file input field (image-upload-1, image-upload-2, etc.) Here's the HTML: div id=image-input div id=image-div-1 pIs this photo the main property photo?/p select id=main-photo-next name=main-photo-1 class=textinput01 cfif isdefined(form.fieldnames) option value=cfoutput#form.main-photo-1#/cfoutput selected/option /cfif option value=YesYes/option option value=NoNo/option /select input id=image-next name=image-upload-1 type=file size=65 value= /div /div button id=add-imageAdd New Image Field/button Here's the jQuery (a hacked-up version of something simpler that worked well, but was missing functionality I now need) that I'm using to clone the entire div, image-div-1. script type=text/javascript $(document).ready(function() { $('#add-image').click(function() { $('#image-div-1').clone(true) .attr('id', function() { return this.id.replace(/(.+)(\d+$)/, function(s, p1, p2) { return p1 + (parseInt(p2, 10) + 1); }) }) .appendTo('#image-input'); return false; $('#main-photo-next :last').attr('name', function() { return ('#main-photo-next :last').name.replace(/(.+)(\d+$)/, function(s, p1, p2) { return p1 + (parseInt(p2, 12) + 1); }) }); }); }); /script As you can tell, the code is not complete, as it doesn't deal with incrementing the image-next file input field. When I click the button to clone the div, everything appears in the DOM as it should, but the name of the select input is not incrementing. Each select statement is named main-photo-1. How do I need to adjust the code to cause the name to increment? Also, what code would I add to increment the image-next filefield? One last issue is how to increment the value in the select statement, cfoutput#form.main-photo-1#/cfoutput. Any tips or code would be appreciated! Thanks, Rick
[jQuery] Re: Getting a menu item Li to do 2 things at once? onclick AND regular href trigger?
They will all add up, that's the native addEventListener behaviour. You 'add' listeners, not replace them :) But that way you can only remove them all at once with unbind('click') or having the original function at hand, namespacing allows you to remove them separately and by name only. On Dec 29, 2:26 pm, Alexandre Plennevaux aplennev...@gmail.com wrote: really? I thought one had to namespace an event for it not to overwrite previously set behaviours. $('a').bind('click.scroll',function(){ scrollTo(moon); }); $('a').bind('click.alert1',function(){ alert('Me works too'); }); }); On Mon, Dec 29, 2008 at 5:06 PM, Ricardo Tomasi ricardob...@gmail.com wrote: You can add as many listeners as you want: $('a').click(function(){ scrollTo(moon); }); $('a').click(function(){ alert('Me works too'); }); $('a').click(function(){ alert('damn, stop using alerts'); }); $('a').click(function(){ openFlash(); }); On Dec 29, 7:37 am, yvonney yvonn...@gmail.com wrote: Hi... just starting out to get this going. I'm guessing that the reason onclick code has the #, for example: a href=# onclick=someFunction.add etc code etc etc /a is because it can't do the onclick AND more typical things like this example: lia href=#myID/a/li Is because they conflict... SOo! I have my Li/ul menu code doing a bunch of scrollto stuff. Took weeks to figure out. NOW I need to have the SAME menu, when I click on the Li's bring up a different flv video for each menu item (li) sheeesh... do I use live query or what. I'm REALLY stumped... I do have a much greater 'sorta' understanding of the: neolao flv player, swfobject2, jquery.swfobject.js, jmedia plugin, luke's flash plugin, and malsup's medai plugin. whew! :--) Though the REAL problem is to get some kinda elegant way of having the flv videos play in a seperate div location (stop when new video starts as well) when I click on each and every menu item. And, there menu items already are doing their scrollto coda-scroller type thing already. Yes... this question is my biggest question ever... Could a guru please comment on how to get the menu items to do BOTH what they're doing now as standard lia href=#myID/a/li AND also do the calling of the (I guess?) onclick thing to call the videos individually at the same time. I guess it shouldn't take me more than all year to do... hehehe what's left of it thank fully! if that makes sense...hehehe thank you for reading.
[jQuery] Re: Why isn't the name attr in this code incrementing?
Thanks, Richard...I'll give it a go! Rick -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Ricardo Tomasi Sent: Monday, December 29, 2008 2:35 PM To: jQuery (English) Subject: [jQuery] Re: Why isn't the name attr in this code incrementing? How didn't I notice... IDs are unique, you can't do that. Use a class instead, .main-photo-next. You can also chain everything so you don't need to search again for the new element: $(document).ready(function() { $('#add-image').click(function() { $('#image-div-1').clone(true) .attr('id', function() { return this.id.replace(/(.+)(\d+$)/, function(s, p1, p2) { return p1 + (parseInt(p2, 10) + 1); }) }) .appendTo('#image-input') .find('.main-photo-next').attr('name', function() { return $(this).attr('name').replace(/(.+)(\d+$)/, function(s, p1, p2) { return p1 + (parseInt(p2, 10) + 1); }) }); return false; }); }); $(document).ready(function() { $('#add-image').click(function() { $('#image-div-1').clone(true) .attr('id', function() { return this.id.replace(/(.+)(\d+$)/, function(s, p1, p2) { return p1 + (parseInt(p2, 10) + 1); }) }) .appendTo('#image-input'); $('#main-photo-next:last').attr('name', function() { return $(this).attr('name').replace(/(.+)(\d+$)/, function(s, p1, p2) { return p1 + (parseInt(p2, 10) + 1); }) }); return false; }); }); And it's still cloning div correctly, but the last part, $('#main-photo-next:last') etc., is now renumbering the original name attribute of the first #main-photo-next div, instead of the second (which would be the last when the first clone is created). So I end up with select id=main-photo-next name=main-photo-2 followed by select id=main-photo-next name=main-photo-1 instead of select id=main-photo-next name=main-photo-1 followed by select id=main-photo-next name=main-photo-2 Is the functioning order of the code wrong somewhere? Rick -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Ricardo Tomasi Sent: Monday, December 29, 2008 11:02 AM To: jQuery (English) Subject: [jQuery] Re: Why isn't the name attr in this code incrementing? ('#main-photo-next :last').name You're missing the $/jQuery and trying to get a property that doesn't exist. change that to $(this).attr('name').replace(...) and you're set. On Dec 29, 1:36 am, Rick Faircloth r...@whitestonemedia.com wrote: Hi, all... I'm cloning a section of code to create additional image inputs in a form, along with a yes/no select field. When the cloning occurs, I also need to increment the field names of the select statement (main-photo-1, main-photo-2, etc.), and the file input field (image-upload-1, image-upload-2, etc.) Here's the HTML: div id=image-input div id=image-div-1 pIs this photo the main property photo?/p select id=main-photo-next name=main-photo-1 class=textinput01 cfif isdefined(form.fieldnames) option value=cfoutput#form.main-photo-1#/cfoutput selected/option /cfif option value=YesYes/option option value=NoNo/option /select input id=image-next name=image-upload-1 type=file size=65 value= /div /div button id=add-imageAdd New Image Field/button Here's the jQuery (a hacked-up version of something simpler that worked well, but was missing functionality I now need) that I'm using to clone the entire div, image-div-1. script type=text/javascript $(document).ready(function() { $('#add-image').click(function() { $('#image-div-1').clone(true) .attr('id', function() { return this.id.replace(/(.+)(\d+$)/, function(s, p1, p2) { return p1 + (parseInt(p2, 10) + 1); }) }) .appendTo('#image-input'); return false; $('#main-photo-next :last').attr('name', function() { return
[jQuery] Re: Getting a menu item Li to do 2 things at once? onclick AND regular href trigger?
$(document).ready(function(){ $('li a').click(function(){ //get all as inside the lis $(this).attr('href') //do something, get the images etc. }); }); calling click for multiple elements is the same as calling $('li a').each(function(){ $(this).bind('click', ...) On Dec 29, 5:07 pm, yvonney yvonn...@gmail.com wrote: OK... I'm flying fairly blind though I'm enjoying it! 1) I guess that the scrollto stuff I'm doing is irrelevant. 2)The menu items each have a different #. There's nothing in the html other than the following example. (except for a jpg call or an alt=) Each pair surrounded by unique UL # of course The scrollto and localscroll stuff is all in the js and css. right?:-) lia href=#first-a/a/li lia href=#first-b/a/li lia href=#second-a/a/li lia href=#second-c/a/li lia href=#third-a/a/li lia href=#third-b/a/li 3) So, I was hoping that I could add an onclick or bind or whatever to each li only. And then I could have what's already happening just continue. (localscroll/scrollto etc.) WITH the addition of being able to have a new swf/jpeg/whatever appear and play/show in a totally seperate DIV. (I believe this is a different subject somewhat so initially I guess having a jpg show up in the seperate div and then be totally REPLACED by another one when I click on a different menu li would be a good start. Right now I'm just fumbling towards adding the onclick/bind. Would it be possible to get an example of what I'd add to the li's...and maybe how and where the JQ code would go and look like? I also read about the jjquery.listen plugin. Don't know at all if that would be useful. This is SO important right now for me. Very grateful for pointers...!
[jQuery] Re: Superfish - Nav-bar style with bgIframe?
Been working on this page: http://www.farmanddairy.com/shop/index.php?main_page=product_infocPath=65products_id=181 Div #absolutekartbutton was position:relative with float:left. Columns under News was disappearing behind many objects. I fixed most by removing float:left from #absolutekartbutton. Still, the Farm and Dairy - 1 Year Subscription image header was above the Columns menu. Oddly enough, this was fixed by _adding_ float:left to that h3. Weirdly, the bug is definitely dependent on position:relative, especially when it's combined with a float. For anyone suffering this bug: toy around with combinations of these two properties. I had to float that h3 for no good flippin' reason because it was the child of a position:relative object, but it fixed the problem.
[jQuery] Re: Getting a menu item Li to do 2 things at once? onclick AND regular href trigger?
SO nice Ricardo! I must explain and say sorry in advance for asking for help on such simple problems and my lack of understanding. I do not yet know how everything works together quite. I will be much better in the future as I am really studying though the following may be very boring, though I will try to be clear and brief!:-) OBJECTIVE (any good?): I click on each of the li lines (as above). Something that has been added to the li lines (onclick code?) makes a jpg or video show up in the html div I have named in css as #video. - In my css I have: #video - In my single html page I have: div class=video 'stuff goes here' /div Ineed only one jpg or video to show up at a time. Kinda lost on this one. How can I have a bunch of jpgs or videos 'in the waiting' to be called to the video div without having them in the html page. They must be hidden until called, then replaced when new li is selected. So... 1) I add your script above to my single test page. I would need to change it? 2) What do I add to each Li? onclick? that points to the unique jpg or video for each li? 3) There will be some way to hide all but the needed jpg or video that will show up in the div for #video. geez I should stop now as I'm quite far away from this. You are very kind to have helped. in any event I am most happy to have had all the help. Tonight I must start with the basics as there are many holes in my understanding. My problem is I need to get this working this week.
[jQuery] Re: Getting a menu item Li to do 2 things at once? onclick AND regular href trigger?
This now makes more sense to me. http://nettuts.com/javascript-ajax/how-to-load-in-and-animate-content-with-jquery/ I've started to attempt things. I added the UL class as there are other lis though I only need the #nav ones affected. $('#nav li a').click(function(){ One small step for mehehehe No I must firure out the changes/additions for: $(this).attr('href')
[jQuery] jquery ui accordion - begin minimized
Hello all- As a newbie to jQuery, let me first say I'm terribly impressed. I like to think I've created a great project by using jQuery and the credit should go where it's due- the devs. Thanks guys! My question pertains to the accordion plugin. I have it fully functioning (I can post it if you need) but for the life of me I can't figure out how to make it so all of the menus stay closed when the page loads. I have 4 accordion menus on a page, and no one can have precedence over the others by starting open. Am I missing an option somewhere? I'd prefer not to write my own jQuery script for it. Thanks for any and all help, Ben
[jQuery] Re: HOW: jQuery AJAX to replace iFRAME
I'm trying to do the same thing, the code you suggested works, but the text on the page changes to what's in the html file I link to but then the browser also moves to the page, how do i stop this? On Dec 22, 1:51 pm, Alexandre Plennevaux aplennev...@gmail.com wrote: say the container that will display the loaded content, i.e, your iframe becomes div id=menu a href=page/to/load.html class=ajaxLinkclick me/a a href=page/to/load2.html class=ajaxLinkclick me 2/a div id=ihateiframes pthis will be replaced/p /div your javascript will be: $(document).ready(function(){ $('a.ajaxLink').click(function(){ var url = $(this).attr('href'); $('#ihateiframes').empty().load(url); }); }); On Mon, Dec 22, 2008 at 6:51 AM, Ayan ios...@gmail.com wrote: Hi Currently my page has a iFrame (loads an external web-page) in it. I have seen this tutorial that uses simple AJAX to replace this iFrame. http://www.dynamicdrive.com/dynamicindex17/ajaxcontent.htm (see the small DEMO, I want exactly the same with just 2 Links) My question is - How can I do the same using jQuery's AJAX to do the same ? Thats is, when these 2 Button/Link hit, it will fetch corresponding remote html and paste it in a DIV. Thats it. Please do reply. Ayan Debnath INDIA.
[jQuery] Hover and fade in and out jquery code....
HI, I am making a website kinda like a social networkng site. I am trying to make a hover effect when the mouse is over the users image I want to pop up a image menu like upload image and edit image etc. I so far do have the codes working. The problem I face is... when the user puts the mouse over his image a menu pops up not into a new window but like a image is viewable which is supposed to happen. So if your mouse dosen't go over the image meaning the new popup menu then the menu stays at that position until your mouse goes over the image and back out it would fade out the menu. What I want is to have a menu to fade out when the mouse is either off the image or off the menu so then the menu would fade out. So in my code so far I was able to fade in the menu when the mouse is on the user image. But in order to fade out the menu you will have to put your mouse on the menu and then make the mouse go off the menu and it would fade out. If you had your mouse on the user image and slide the mouse off the user image no fade out effect will happen to the menu. Hope this explains what I want. Which is to have a fade out effect on 2 events I wounder if I should use a IF statement. I want to fade out only if the mouse is not on either the user image or the menu itself.
[jQuery] rounded corners plug in
i've loaded all js files to root. script not executing. help please. thanks. script type=text/javascript src=jquery-1.2.6.min.js/ script script type=text/javascript src=jquery.corners.min.js/script script type=text/javascript div style=background-color:#acc; padding:10px class=rounded {10px} class=rounded {10px} /div script$(document).ready( function(){ $('.rounded').corners(4px); });/script
[jQuery] pass variable from button click to iframe
I am currently grabbing data from a mysql db and presenting it to the user in a table. In certain cases, a volunteer button is displayed to the user. I want the user to click on the volunteer button, and have an iframe dialog pop up. When the user clicks on this volunteer button, the corresponding date column should be passed to the iframe (which in turn uses the iframe to look up the correct data in another db). I can't seem to figure out how to pass the date variable. here is part of my php file: [code] while($row = mysql_fetch_array($result)) { echo trtd; } echo $row['date']; echo /tdtd; if ($row['location'] == PVI) { echo input type='button' value='Volunteer' name='volunteer' id='volunteer' /; echo /td/tr; [\code] That part works fine. When the user clicks on the Volunteer button, here is the jquery code: [code] $('#volunteer').click(function(){ * need to get date in here somewhere! popup(date); return false; }); [/code] And here is the popup part - I actually get the dialog, but since I can't figure out how to pass the date, it can't look up the correct info! [code] function popup() { var url = 'popup.php?date='+ date; $('iframe id=popup src=' + url + ' /').addClass(flora).dialog({ modal: true, resizable: true, bgiframe: true, [/code] If anyone could point me in the right direction, I'd appreciate it! -- View this message in context: http://www.nabble.com/pass-variable-from-button-click-to-iframe-tp21207413s27240p21207413.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] [Validate] Double click to submit form
Hi i am using jquery validator plugin to validate my form. In my form, the field numero_commissione must contains a non- negative number and this must not be in use. So i use a remote validation in order to accomplish this. The problem occurs when i want to modify an item. The edit page shows the form filled with the values of the item. If no change were made, the first click on the submit button cause the validation of the remote field (i see it in the console of firebug) and only the second click cause the submit of the form. The main piece of code is this: var validatorEdit = $(#form_edit_commissione).validate({ rules: { numero_commissione: { required: true, number: true, min: 1, remote: { url: /admin/commissione/check/op/edit, type: get, data: { numero_commissione: function() { return $(#e_numero_commissione).val(); }, vecchio_numero_commissione: function() { return $ (#vecchio_numero_commissione).val(); } } } }, presidente: { required: true }, medico_lavoro: { required: true }, medico_categoria: { required: true }, medico_specialista: { required: true } }, messages: { numero_commissione: { remote: Numero di commissione già in uso } } }); I try to use the option submitHandler, but i get the javascript error form.submit is not a function: $(.selector).validate({ submitHandler: function(form) { // do other stuff for a valid form form.submit(); } }) Thank in advance. Hello from Italy
[jQuery] Plugin that highlights divs
Hi, I've seen a Jquery plugin before that triggers an event which pulsates or highlights a div of your choice. I've also seen the plugin scroll the page to the correct div. Does anybody know what this plugin is called? I'd really like to use it... I've been searching the plugins directory for a while, but can't seem to find it! Thanks