[jQuery] JSON + variable
Hello, well i got a problem with using JSON. My code looks like this: $(function() { $.ajax({ type:'GET', url: url, data:format=jsonid=123, success:function(data) { alert(data); // doesn't work }, dataType:'jsonp' }); }); The URL is an external one. The answer looks something like this: yasearch({q:uboot,f:[k],r:[[uboote],[uboot chat],[uboot pc spiel],[uboot simulation],[modell uboot],[uboot hamburg], [uboot museum],[atom-uboot],[uboot ping],[rc uboot]]}) I always get this error msg in firebug: yasearch is not defined I tried to define it in any way but it doesn't seem to work. I use JSON for the first time now and don't know how to get an useable answer. I hope someone can help me.
[jQuery] Update div content after dynamic select creation
I'm trying to create a page where onchange of first select it appears a second one (which values, readen from a database, depend on previous choise) and on choise of second select results are show in a div. Here some images: Start: http://img269.imageshack.us/i/senzanomejg.png/ http://img269.imageshack.us/i/senzanomejg.png/ On first select choise: http://img534.imageshack.us/i/senzanome2.png/ http://img534.imageshack.us/i/senzanome2.png/ On second select choise: http://img269.imageshack.us/i/senzanome3y.png/ http://img269.imageshack.us/i/senzanome3y.png/ Here's the code: index.php html !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd; html xmlns=http://www.w3.org/1999/xhtml; head meta http-equiv=Content-Type content=text/html; charset=ISO-8859-1 / script type=text/javascript src=jquery.js/script script type=text/javascript $(document).ready(function() { $('#sel_continenti').change(function(){ var cont = $('#sel_continenti').attr('value'); $.post(selection.php, {id_cont:cont}, function(data){ $(#sel_nazioni).empty(); //$(div#result).empty(); $(div#nazioni).empty(); $(div#result).append(prova2br /); //$(div#result).append(document.createTextNode(prova)); $(#sel_nazioni).prepend(data); $(div#nazioni).prepend(data); }); }); $('#sel_nazioni').change(function(){ var id_naz = $('#sel_nazioni').attr('value'); $.post(result.php, {id:id_naz}, function(data){ $(div#result).empty(); $(div#result).append(prova3br /); //$(div#result).prepend(data); }); }); }); /script /head body div id=continenti ?php include_once 'option.class.php'; $obj = new Option(); $obj-ShowContinenti(); ? /div div id=nazioni !--Seleziona una nazione:br select id=sel_nazioni name=sel_nazionioption value=noScegli.../option /select-- /div div id=result prova1br / /div /body /html File option.class.php ?php class Option { public $conn; public function __construct() { $this-DbConnectAndSelect(); } protected function DbConnectAndSelect() { //include_once db_config.php; //$this-conn = mysql_connect($db_host,$username,$password); $this-conn = pg_connect(host= port= user= password= dbname=); //mysql_select_db($db_name, $this-conn); return TRUE; } public function ShowContinenti() { echo 'Seleziona un continente:br'; echo 'select id=sel_continenti name=sel_continentioption value=noScegli.../option'; $sql = SELECT * FROM continenti; //$res = mysql_query($sql,$this-conn); $res = pg_query($this-conn,$sql); while($row = pg_fetch_row($res)) { echo 'option value=' . $row[0] . '' . $row[1] . '/option'; } echo '/select'; } /*public function ShowNazioni() { if($_POST['id_cont'] == no) { die; } //echo 'Seleziona una nazione:br'; //echo 'select id=sel_nazioni name=sel_nazioni'; $id_cont = $_POST['id_cont']; $sql = SELECT * FROM nazioni WHERE id_cont=$id_cont; $res = pg_query($this-conn,$sql); //echo'option value=noScegli.../option'; while($row = pg_fetch_row($res)) { echo 'option value=' . $row[0] . '' . $row[2] . '/option'; } //echo '/select'; }*/ public function ShowNazioni() { if($_POST['id_cont'] == no) { die; } echo 'Seleziona una nazione:br'; echo 'select id=sel_nazioni name=sel_nazioni'; $id_cont = $_POST['id_cont']; $sql = SELECT * FROM nazioni WHERE id_cont=$id_cont; $res = pg_query($this-conn,$sql); echo'option value=noScegli.../option'; while($row = pg_fetch_row($res)) { echo 'option value=' . $row[0] . '' . $row[2] . '/option'; } echo '/select'; } public function ShowResult() { echo dentro shoresult(); if($_POST['id'] == no) { echo post id=no; die; } echo 'brbrHai scelto la nazione: '; $id = $_POST['id']; $sql = SELECT * FROM nazioni WHERE id=$id; $res = pg_query($this-conn,$sql); $row = pg_fetch_row($res); echo 'id: '.$row[0].' id_cont: '.$row[1].' nazione: '.$row[2]; } } ? File selection.php ?php include_once 'option.class.php'; $obj = new
Re: [jQuery] Cluetip with live
I noe its ages old post but it still might be a help to someone. I wasnt diggin too much and im not sure if it is 100% correct fix but it works for me (hover activation). I have added this right after line 420 of jquery.cluetip.js $this.trigger('mouseenter.cluetip', function(event) { activate(event); mouseTracks(event); }); and it seems to work smoothly with live. Regs korg wrote: I'm currently using cluetip with livequery, but is it possible to use it with live too? $('#mydiv a.tooltip').livequery(function(event) { $(this).cluetip({cluetipClass: 'tooltipclass', width: 400}); }); Using the below code doesn't seem to work very well if the content has been dynamically added. I must hover a.tooltip twice for the tooltip to open up, and hovering a third time sometimes brings up broken tooltip content. $('#mydiv a.tooltip').live('mouseover', function(event) { Any ideas? Thanks! :) Regards, -- View this message in context: http://old.nabble.com/Cluetip-with-live-tp22392243s27240p27437606.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
Re: [jQuery] Traversing to next class?
On Tue, Feb 2, 2010 at 11:28 PM, Photonic tmlew...@gmail.com wrote: Now the problem I am having is with $(this).next ('.textDescription').hide(); . What am I doing wrong. I was under the impression that it would select the next object with the class of textDescription and hide it... but it isn't. You need to use nextAll(), not next(). http://api.jquery.com/next/ .next( [ selector ] ) Returns: jQuery Description: Get the immediately following sibling of each element in the set of matched elements, optionally filtered by a selector. http://api.jquery.com/nextAll/ .nextAll( [ selector ] ) Returns: jQuery Description: Get all following siblings of each element in the set of matched elements, optionally filtered by a selector. Nathan
[jQuery] Re: JSON + variable
Hi mueller, The response is look like a function call. /* yasearch( { q: uboot, f: [k], r: [[uboote], [uboot chat], [ubootpc spiel], [uboot simulation], [modell uboot], [uboot hamburg], [uboot museum], [atom-uboot], [uboot ping], [rc uboot]] } ) */ try this, function yasearch(a) { alert(a.q); } $(function() { $.ajax({ type: 'GET', url: 'js.html', data: format=jsonid=123, success: function(data) { eval(data); }, dataType: 'json' }); }); On Feb 3, 5:44 pm, weidc mueller.juli...@googlemail.com wrote: Hello, well i got a problem with using JSON. My code looks like this: $(function() { $.ajax({ type:'GET', url: url, data:format=jsonid=123, success:function(data) { alert(data); // doesn't work }, dataType:'jsonp' }); }); The URL is an external one. The answer looks something like this: yasearch({q:uboot,f:[k],r:[[uboote],[uboot chat],[uboot pc spiel],[uboot simulation],[modell uboot],[uboot hamburg], [uboot museum],[atom-uboot],[uboot ping],[rc uboot]]}) I always get this error msg in firebug: yasearch is not defined I tried to define it in any way but it doesn't seem to work. I use JSON for the first time now and don't know how to get an useable answer. I hope someone can help me.
[jQuery] Re: Is there have any JQuery plugin that can sort 1A,2A,3A,... 10A, 11A, 12A, 13A, 14A?
On Feb 2, 10:37 am, HenryRock henryloke.myetr...@gmail.com wrote: I facing a problem in sorting : 1A,2A,3A,... 10A, 11A, 12A, 13A, 14A [ ... ] May I know is there have any plugin that can sort the sample data above to 1A until 14A? Note that it's not hard to do this in Javascript, though: var sorter = (function() { var regex = /^(\d+)([a-z]+)$/i; return function(o1, o2) { var left = regex.exec( + o1); var right = regex.exec( + o2); if (left) left[1] = Number(left[1]); if (right) right[1] = Number(right[1]); if (!left) return (right ? 1 : ( + o1 + o2 ? -1 : ( + o1 + o2 ? 1 : 0)) ); if (!right) return -1 if (left[1] right[1]) { return -1; } else if (left[1] right[1]) { return 1; } else { if (left[2] right[2]) { return -1; } else if (left[2] right[2]) { return 1; } else { return 0; } } }; })(); var values = [12A, 11B, 1A, 2C, 2B, 2A, 1a, 4B, 13C, 12C, 3B, 3A]; // 1A,1a,2A,2B,2C,3A,3B,4B,11B,12A,12C,13C alert(values.sort(sorter)); Good luck, -- Scott
[jQuery] Re: JSON + variable
Well, wow thats nice! Thanks for your answer. Really awesome, I get an answer! But I have to use dataType: 'jsonp'. If I use dataType: 'json' the alert doesn't work. Oh my god it was so simple and I was thinking about it a million hours, thank you a lot. On 3 Feb., 17:25, rnivash rniv...@gmail.com wrote: Hi mueller, The response is look like a function call. /* yasearch( { q: uboot, f: [k], r: [[uboote], [uboot chat], [ubootpc spiel], [uboot simulation], [modell uboot], [uboot hamburg], [uboot museum], [atom-uboot], [uboot ping], [rc uboot]] } ) */ try this, function yasearch(a) { alert(a.q); } $(function() { $.ajax({ type: 'GET', url: 'js.html', data: format=jsonid=123, success: function(data) { eval(data); }, dataType: 'json' }); }); On Feb 3, 5:44 pm, weidc mueller.juli...@googlemail.com wrote: Hello, well i got a problem with using JSON. My code looks like this: $(function() { $.ajax({ type:'GET', url: url, data:format=jsonid=123, success:function(data) { alert(data); // doesn't work }, dataType:'jsonp' }); }); The URL is an external one. The answer looks something like this: yasearch({q:uboot,f:[k],r:[[uboote],[uboot chat],[uboot pc spiel],[uboot simulation],[modell uboot],[uboot hamburg], [uboot museum],[atom-uboot],[uboot ping],[rc uboot]]}) I always get this error msg in firebug: yasearch is not defined I tried to define it in any way but it doesn't seem to work. I use JSON for the first time now and don't know how to get an useable answer. I hope someone can help me.
[jQuery] Re: A different approach to parsing XML, and a little help on processing attributes more efficiently
Slick, and super fast. Makes it so that I do not even want to move onto JSON ;-)... (JK, my engineers are forcing me too) Made some minor mods, these add a little time and still processes over 50K lines in about 6-8 seconds, and 100K right about 10 seconds. Now everything is its own html object ready for all the beauty of the rest of jQuery. I wrapped each parent in an ID'ed span and each Location and an ID'ed span. OK this has gone in this direction to the point that I would have to take a different approach to get it better. My other goals are introspecting the XML to determine depth of the PARENT = CHILD relationships. And to pull non-stadard (i.e. not id or label) attributes and manipulate them.
Re: [jQuery] Update div content after dynamic select creation
On Wed, Feb 3, 2010 at 7:12 AM, Shinnuz theangusyo...@gmail.com wrote: Database works, but if you see div#result doesn't update with prova3... why? where i'm wrong? I do believe your problem is you're creating the nation select AFTER you've set the handler for the select. Move your declaration of $('#sel_nazioni').change(function() into $.post(selection.php, {id_cont:cont}, function(data){, a la: $(document).ready(function() { $('#sel_continenti').change(function(){ var cont = $('#sel_continenti').attr('value'); $.post(selection.php, {id_cont:cont}, function(data){ $(#sel_nazioni).empty(); //$(div#result).empty(); $(div#nazioni).empty(); $(div#result).append(prova2br /); //$(div#result).append(document.createTextNode(prova)); $(#sel_nazioni).prepend(data); $(div#nazioni).prepend(data); $('#sel_nazioni').change(function(){ var id_naz = $('#sel_nazioni').attr('value'); $.post(result.php, {id:id_naz}, function(data){ $(div#result).empty(); $(div#result).append(prova3br /); //$(div#result).prepend(data); }); }); }); }); }); Nathan
[jQuery] please test my link - takes only 2 secs
Hello all, if you have 2 seconds to spare, please see http://www.tilmauder.com/as4/JS2ASinJquery.htm and send me errors you may (or rather hopefully WILL NOT) be getting. What's supposed to happen: the page displays an orange swf file with a dynamic text field. When you click the button at the top, the text inside the orange swf is supposed to change. I'm interested in people who run: IE7, IE8, FF3 on Windows XP, Vista, 7 Safari 4, FF3 on Mac OSX Thanks a bunch! Your help is appreciated.
[jQuery] Jquery Image Rotator Question
My company has suggested that we replace all our flash based image rotators with jquery versions. I have used Jquery cycle before http://www.malsup.com/jquery/cycle/download.html But have a question Do these plugins allow the images to be downloaded after the page has rendered? Some of our flash rotators have hundreds of larger images in them. Can we use jquery to dynamically load these into a rotator after the page renders? Can somebody point me to a good example if so? Does any know of any other disadvantages to using jquery over flash for this type of thing other then when users have javascript disabled? Thanks for you help!
[jQuery] 1.4 issues using .is()
I have this that has worked just fine in 1.3.2: if($(this).is('li')){ ...do something... }; In 1.4 (and 1.4.1), however, that produces an error: g.nodeName is undefined The only mention I found of this is here: http://forum.jquery.com/topic/window-is-div-returns-error-jquery-1-4 and that's just a mention of the problem. Has anyone else run into this and maybe have a theory as to what is happening? -Darrel
[jQuery] Fwd: Multiple file upload + flash component
Any help is appreciated. -- Forwarded message -- From: jayakumar ala alajay...@gmail.com Date: Mon, Feb 1, 2010 at 8:34 AM Subject: Multiple file upload + flash component To: jquery-en@googlegroups.com Hi , I am looking for a multifile uploader with html or jsp not with php. This should be allowed to select the multiple files from the file selector. I am sure that we can do that using the flash component. I am not familiar with flash. I am using the multifile uploader from Jquery already. Any help on this is appreciated. Thanks Jay
Re: [jQuery] Fwd: Multiple file upload + flash component
I am looking for a multifile uploader with html or jsp not with php. This should be allowed to select the multiple files from the file selector. I am sure that we can do that using the flash component. I am not familiar with flash. I am using the multifile uploader from Jquery already. Any help on this is appreciated. This might be of interest to you: http://www.appelsiini.net/2009/10/html5-drag-and-drop-multiple-file-upload -DA
[jQuery] JQuery Developer
I am currently seeking a JQuery Developer with strong Javascript, HTML, CSS etc. This is a job with an enterprise level company in the peninsual (around Palo Alto). Please contact me ASAP. This position will move fast. Regards, Madan
[jQuery] Ajax Spinner Question
Hi, I'm pretty new to jquery and wanted to know how can I have a different ajax spinner/loader or maybe a dynamic one, that could accept a message as a parameter when it displays. I think one spinner that can accept a message as a parameter may be the best approach though now that I think of it. I have places where I use ajax and when the spinner shows I don't want it to always say the same thing for example. Originally I had an ajax spinner setup but it was showing for every ajax call in my app. I'd like the ability to be able to control it on a per ajax call basis. Certain times I don't want to show the loader, others I do.. Here is my code snippet showing two ajax calls on the same page for demonstration purposes: $.post('/path/proxy.cfc?method=validateData') $.post('/path/proxy.cfc?method=someMethod') So I'd like to call my ajax loader when certain ajax calls happen as well as change the message that gets displayed in the div. How can I do this? -ws -- View this message in context: http://old.nabble.com/Ajax-Spinner-Question-tp27447423s27240p27447423.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.