[jQuery] [validate] custom error messages from remote method
Hi all. In the new version of jquery.validate (1.5.3) there is an option to get a remote error message from the server for invalid elements. I did not find what should be the exact response from the server for producing such an error message. From the documentation: The response is evaluated as JSON and must be true for valid elements, and can be any false, undefined or null for invalid elements, using the default message; or a string, eg. That name is already taken, try peter123 instead to display as the error message. But if i return a string, isn't it evaluated as true ? Thanks in advance, David
[jQuery] Re: ajaxSetup and getJSON
Isn't it more a server side question ? I would suggest that you try in the browser location bar to generate the url (by hand) and see if there also the problem consists. If yes then you have first to solve it on the server side. I use in my scripts a session id which i pass through getjson as arguments without the ajaxSetup method On Jun 16, 6:12 am, Antony Currington acurring...@paradise.net.nz wrote: Hi all, Is it possible to use ajaxSetup to define a username and password that will then be used by getJSON? I have an enviuronment where I have a web server that I'm passing a URL to for a web service call that returns me JSON. I'm doing the call via the getJSON method, and get back the data I want, except that I'm being prompted to log in and I don't want the users to authenticate. I need to provide a username and password somewhere in the URL (or additional details) and so added an ajaxSetup call right before I call getJSON to set the username and password as follows: jQuery.ajaxSetup({username: myusername, password: mypassword }); jQuery.getJSON(url, function (jsonObject) { //do some stuff } ); For some reason I'm still getting prompted for the username and password for the URL, even though they're being set. I'm working with IE6, and jQuery 1.3.2. Any assistance would be greatly appreciated. Regards, Antony
[jQuery] Re: [validate] custom error messages from remote method
Nope, not anymore. The check is now more explicit: if (response === true) { ... } else { displayError }, where before if was just if (response) ... Jörn On Tue, Jun 16, 2009 at 8:55 AM, davidmichaelg...@gmail.com wrote: Hi all. In the new version of jquery.validate (1.5.3) there is an option to get a remote error message from the server for invalid elements. I did not find what should be the exact response from the server for producing such an error message. From the documentation: The response is evaluated as JSON and must be true for valid elements, and can be any false, undefined or null for invalid elements, using the default message; or a string, eg. That name is already taken, try peter123 instead to display as the error message. But if i return a string, isn't it evaluated as true ? Thanks in advance, David
[jQuery] Re: [validate] custom error messages from remote method
Thanks. mir ist ein licht aufgegangen On Jun 16, 10:57 am, Jörn Zaefferer joern.zaeffe...@googlemail.com wrote: Nope, not anymore. The check is now more explicit: if (response === true) { ... } else { displayError }, where before if was just if (response) ... Jörn On Tue, Jun 16, 2009 at 8:55 AM, davidmichaelg...@gmail.com wrote: Hi all. In the new version of jquery.validate (1.5.3) there is an option to get a remote error message from the server for invalid elements. I did not find what should be the exact response from the server for producing such an error message. From the documentation: The response is evaluated as JSON and must be true for valid elements, and can be any false, undefined or null for invalid elements, using the default message; or a string, eg. That name is already taken, try peter123 instead to display as the error message. But if i return a string, isn't it evaluated as true ? Thanks in advance, David
[jQuery] what is wrong with firefox :(
This code works on ie7, but it does not work on firefox. it just shows a alert when focus occur on an element. you can just click something on the page and you will see alert at ie7. var _focusedElement; $(document).ready(function() { $(*).bind(focus, function(e) { alert(this.id); _focuedElement = this; }).bind (blur, function(e) { _focuedElement = null; }); });
[jQuery] Hide button based on combo value
Hi all, I have a select option like this: select id=color name=color option value=Select a color/option option value=1Red/option option value=2Green/option option value=3Blue/option option value=4White/option option value=5Black/option /select and a button: div id=buttons class=sportelloamiacque_formline input type=submit id=submitButton name=submitButton value=Continue / /div How can I hide the button is the combo has Select a color selected, and show the button when the user select a color? Thanks in advance. Luis
[jQuery] Re: Hide button based on combo value
$(#color).change(function() { if($(this).val() == 2) { $(#buttons).hide(): } else { $(#buttons).show(); } }); On Tue, Jun 16, 2009 at 11:09 AM, ciupaz luigi.zambe...@gmail.com wrote: Hi all, I have a select option like this: select id=color name=color option value=Select a color/option option value=1Red/option option value=2Green/option option value=3Blue/option option value=4White/option option value=5Black/option /select and a button: div id=buttons class=sportelloamiacque_formline input type=submit id=submitButton name=submitButton value=Continue / /div How can I hide the button is the combo has Select a color selected, and show the button when the user select a color? Thanks in advance. Luis
[jQuery] Re: Hide button based on combo value
Perfect, thank you very much Waseem. Luis
[jQuery] History and ajax has me stuck
Hi folks, I'm having difficulty understanding how to get Klaus's history plugin working in my application.I have an ebook application in which the page has a static index of pages which, when an individual link is clicked, a file is loaded into an adjacent div (#ebook). Upon being loaded, the file is scanned and any a.linkto tags are scanned for as these tags are my between page links which I was hoping to get the history plugin to capture and do its magic. Once found, the a.linkto tags are prepared - as far as I can understand - for the history plugin. However, my attempt has gone all pear-shaped and I cannot find any reference/article/documentation via Google to help me see my error. What tends to happen is that upon clicking an a.link from within #ebook, a copy of the entire current page, sans the targetted page, is loaded into #ebook. Any help would be appreciated - even if it is a suggestion to try a different approach. Thanks, Bruce $(document).ready(function() { $.ajaxHistory.initialize(); var pgname = $('a.eb0').attr('id'); fnGetEbookFile(pgname); }); function fnGetEbookFile(pgname){ $.get('textfiles/' + pgname + '.html?q=' + new Date().getTime(),function(txt){ $(#ebook).html(txt).show(); $('a').each(function() { var $a = $(this); var theid = $a.attr('id'); var q = $a.attr('class'); if (q=='linkto') { $a.attr(id,'#textfiles/' + theid + '.html').remote('#ebook').bind(click,function() {fnGetEbookFile(theid);}); }; }); }); };
[jQuery] Re: GPL e MIT Jquery
Egipicio wrote: Good night I think wanting to know if you have GPL on my site .. someone asked the sorce of the whole system if I only mandatory available? obs: The system does not GPL and everything was done by my in php . just plug jquery GPL and that this coupled system ... The GPL only covers distribution of code (not usage), so you don't have to worry about having to disclose your php even if you use GPLed php code in your website. If you're using javascript that's under the GPL license, I guess you are distributing code with every page load, so you'll need to link to the source code (which you do, as the javascript is the source code anyway). So if you leave all copyright statements intact you should be fine. disclaimer: I'm not a lawyer and this might be completely wrong advice. Jonathan
[jQuery] How to post HTML data in jQuery using $.ajax() method?
I want to post some HTML (contained in a div on the page) data using jQuery using $.ajax() method. But it is not working. script language=javascript type=text/javascript function PostHTMLContentTOServer() { var pageData = document.getElementById (MainDiv).innerHTML; $.ajax({ url: MyData.aspx, type: POST, data: pageData, dataType: html, success: function(returnData) { alert(Success post); } }); } /script -- Kindly suggest what should I do.
[jQuery] validate plugin - phone number processing prior to validation
I want to remove spaces from pasted phone numbers into a phone number field prior to the validation being run. I've applied class=number to the phone number input field, which validates correctly when anything other than numbers are entered or onsubmit. I've also created an event handler that removes spaces from that field: $(document).ready(function () { $(#phone).bind(blur, function(e){ $(#phone).val($(#phone).val().replace(' ','')); }); });
[jQuery] validate plugin - phone number processing prior to validation
I want to remove spaces from pasted phone numbers into a phone number field prior to the validation being run. I've applied class=number to the phone number input field, which validates correctly when anything other than numbers are entered or onsubmit. I've also created an event handler that removes spaces from that field: $(document).ready(function () { $(#phone).bind(blur, function(e){ $(#phone).val($(#phone).val().replace(' ','')); }); });
[jQuery] - Superfish menu screws up my menu..
What is causing superfish to screw up my menu here: http://www.ramvalley.com/new/ ive tried changing the templates but everytime its the same thing.. i have no knowledge of css or php :( please help. Thank you
[jQuery] Get jQuery object from collection
I have collection: var collection = $(input); var i = 3; Is there easier way to get third jquery object from collection. Currently i'm using method like $(collection.get(i)) or $(collection[i]) But i think something like this could be more comfort: example: collection.get(i).addClass('blah');
[jQuery] Re: Get jQuery object from collection
var collection = $(input); collection.each(function(i) { collection.addClass(blah); if(i == 3) { } }); did you mean something like that ? On Tue, Jun 16, 2009 at 12:59 PM, Lauri B. lau...@gmail.com wrote: I have collection: var collection = $(input); var i = 3; Is there easier way to get third jquery object from collection. Currently i'm using method like $(collection.get(i)) or $(collection[i]) But i think something like this could be more comfort: example: collection.get(i).addClass('blah');
[jQuery] Re: - Superfish menu screws up my menu..
this is a css issue very common with Joomla integration of new menu, the original template menu css does not get removed when installing a new menu and some of this css is needed to adapt new menu to theme of template. There are different techniques that can be used to style a menu , yet arrive at the same visual look. Superfish is extremely well designed to be very adaptable however due to the all the methods available for menu design it is virtually impossible to expect plug and play for all scenarios there is no "one size fits all" when it comes to menus, you'll have to customize the css Faraz Khan wrote: What is causing superfish to screw up my menu here: http://www.ramvalley.com/new/ ive tried changing the templates but everytime its the same thing.. i have no knowledge of css or php :( please help. Thank you
[jQuery] Re: what is wrong with firefox :(
i am giving my answer to my question. The fireworks does not support focus event on table or div elements. ie7 does. That is way i get problem. Here is text code below. You can test it by clicking div and table elements. If it works you will get an alert (ie7 only) Fireworks and opera shows alert only you click on input element. html head script src=http://code.jquery.com/jquery-latest.js;/script script type=text/javascript var _focusedElement; $(document).ready(function() { $(*).bind(focus, function(e) { alert(this.id); _focuedElement = this; }).bind(blur, function(e) { _focuedElement = null; }); }); /script /head body div id=div1 style=border:1px solid #ccc;width:200px;height: 200px; sdxsdxs br / sdxsdxs br / sdxsdxs br / sdxsdxs br / div id=div2 style=background:#ff; denem denem denem /div /div br / br / table width=200 id=table1 style=border:1px solid #ccc;width: 200px;height:200px; tr td/td /tr tr td/td /tr tr td id=td1 style=background:#ff;/td /tr /table input type=text value= /body /html On Jun 16, 11:23 am, MadeOfRose mehmetgul...@gmail.com wrote: This code works on ie7, but it does not work on firefox. it just shows a alert when focus occur on an element. you can just click something on the page and you will see alert at ie7. var _focusedElement; $(document).ready(function() { $(*).bind(focus, function(e) { alert(this.id); _focuedElement = this; }).bind (blur, function(e) { _focuedElement = null; }); });
[jQuery] Re: Edittable plugin problem
On Jun 3, 2009, at 5:56 PM, Gustavo Salomé wrote: If youre talking about Jeditable then id of the edited dom element is sent automatically. There is no need for any unorthodox magic. Try get it here: http://jsbin.com/ejejo/edit I made a live example too. 2009/6/3 bharani kumar bharanikumariyer...@gmail.com The Boss , Link redirecting site not working BOSS , Please provide alternate link, Thanks On Tue, Jun 2, 2009 at 10:38 PM, Gustavo Salomé gustavon...@gmail.com wrote: Its here: http://jquery.izfree.com/editable.js Now any function get the return (data, object) You can use it, for example, this way: $('object').editable({onSubmit:function(data,$this){ class=$this.attr('class'); }}); 2009/6/2 bharani kumar bharanikumariyer...@gmail.com yes please send it On Tue, Jun 2, 2009 at 6:26 AM, Gustavo Salomé gustavon...@gmail.com wrote: No way you can do this. Ive a modified version of the plugin that i made which can do this. Ill send to if u want it. 2009/6/1 bharani kumar bharanikumariyer...@gmail.com Hi All, Am using the editable plug in , When i edit the values , i want to check the already exist and also want to pass the unique key to the query , for the Update WHERE condition , script type=text/javascript charset=utf-8 var oTable; $(document).ready(function() { /* Apply the jEditable handlers to the table */ $('#example tbody td').editable( 'edit_update.php?id='(i want the getID value here ), { callback: function( sValue, y ) { var aPos = oTable.fnGetPosition( this ); oTable.fnUpdate( sValue, aPos[0], aPos[1] ); } } ); /* Init DataTables */ oTable = $('#example').dataTable(); } ); /script tbody ?php while($row=mysql_fetch_object($result)){ $id = $row-id; echo tr; echo td onclick = getID($id) $row-value/td; echo /tr; } ? /tbody How i do this , Thanks -- Regards B.S.Bharanikumar http://php-mysql-jquery.blogspot.com/ -- Gustavo Salome Silva -- Regards B.S.Bharanikumar http://php-mysql-jquery.blogspot.com/ -- Gustavo Salome Silva -- Regards B.S.Bharanikumar http://php-mysql-jquery.blogspot.com/ -- Gustavo Salome Silva -- Mika Tuupola http://www.appelsiini.net/
[jQuery] Re: Get jQuery object from collection
Not really. My question is there function like .get() that returns jQuery object instead of dom element On Jun 16, 2:04 pm, waseem sabjee waseemsab...@gmail.com wrote: var collection = $(input); collection.each(function(i) { collection.addClass(blah); if(i == 3) { } }); did you mean something like that ? On Tue, Jun 16, 2009 at 12:59 PM, Lauri B. lau...@gmail.com wrote: I have collection: var collection = $(input); var i = 3; Is there easier way to get third jquery object from collection. Currently i'm using method like $(collection.get(i)) or $(collection[i]) But i think something like this could be more comfort: example: collection.get(i).addClass('blah');
[jQuery] Re: IE Bug Help: breaks column CSS heights when select box changed
I fixed this issue by flushing IE by doing $(this).hide(); followed immediately by $(this).show(); and it recalc'd the heights and display was normal then. On 15 June, 18:47, Jimbo james.zielin...@gmail.com wrote: Hi guys, Got a nice problem with IE :-( FF and chrome etc are absolutely fine. Using IE7 atm. I have a structure of 2 columns and ive emptied the left column to nothing to narrow the bug hunt down but the right hand column is a list of results quite a substantial height. On load they are fine until the jQuery is ran which makes changes to a select box above the results in the right hand column. I can actually update the options using $(this).html(...) but as soon as I make a change using attr() it then chops the whole height down hiding the results even though they are there. Its as though higher up the tree its forgetting the height of its content. Ive tried a few things and still get the issue and really struggling for ideas. Any willing to help? Thanks guys.
[jQuery] Re: Need help cuz I don't get 'this'
Thank you that worked!!! I think I may understand how to use children if you could also show how to get the img src attribute when 'this' contains: div class=logo table width=100% border=0 cellspacing=0 cellpadding=0 tr td height=170 align=center valign=middleimg src=/ images/somelogo.gif /br / a href=http://www.test.org; target=_blankTest Logo/a/ td /tr /table /div
[jQuery] Re: Need help cuz I don't get 'this'
I don't think you understood what code to show what you need to show is what is wrapped around your initial post's code so that it will be easier to help you understand this On Jun 16, 8:18 am, Logictrap dlyck...@gmail.com wrote: Thank you that worked!!! I think I may understand how to use children if you could also show how to get the img src attribute when 'this' contains: div class=logo table width=100% border=0 cellspacing=0 cellpadding=0 tr td height=170 align=center valign=middleimg src=/ images/somelogo.gif /br / a href=http://www.test.org; target=_blankTest Logo/a/ td /tr /table /div
[jQuery] Get first element when there are multiple classes
Hi How do you get the first element when the element got multiple classes? ul id=ulList li class=liRow1/li li class=liRow liEven2/li li class=liRow3/li li class=liRow liEven4/li /ul input id=btSave type=button value=Save / $(#btSave).click(function(event) { alert($(#ulList .liRow:first).attr(class));/* Success */ alert($(#ulList .liRow .liEven:first).attr(class));/* Hmm */ }); Cheers
[jQuery] Re: Get first element when there are multiple classes
var list_items = $(.liRow); $(#btSave).click(function() { alert(list_items).eq(0).attr(class)); } }); On Tue, Jun 16, 2009 at 2:57 PM, Dave messedupp...@gmail.com wrote: Hi How do you get the first element when the element got multiple classes? ul id=ulList li class=liRow1/li li class=liRow liEven2/li li class=liRow3/li li class=liRow liEven4/li /ul input id=btSave type=button value=Save / $(#btSave).click(function(event) { alert($(#ulList .liRow:first).attr(class));/* Success */ alert($(#ulList .liRow .liEven:first).attr(class));/* Hmm */ }); Cheers
[jQuery] Re: Get first element when there are multiple classes
Sorry syntax error var list_items = $(.liRow); $(#btSave).click(function() { alert(list_items.eq(0).attr(class)); } }); On Tue, Jun 16, 2009 at 3:01 PM, waseem sabjee waseemsab...@gmail.comwrote: var list_items = $(.liRow); $(#btSave).click(function() { alert(list_items).eq(0).attr(class)); } }); On Tue, Jun 16, 2009 at 2:57 PM, Dave messedupp...@gmail.com wrote: Hi How do you get the first element when the element got multiple classes? ul id=ulList li class=liRow1/li li class=liRow liEven2/li li class=liRow3/li li class=liRow liEven4/li /ul input id=btSave type=button value=Save / $(#btSave).click(function(event) { alert($(#ulList .liRow:first).attr(class));/* Success */ alert($(#ulList .liRow .liEven:first).attr(class));/* Hmm */ }); Cheers
[jQuery] Re: Get first element when there are multiple classes
Ok, so I have to split it up. Thanks for the answer. =) On Jun 16, 3:02 pm, waseem sabjee waseemsab...@gmail.com wrote: Sorry syntax error var list_items = $(.liRow); $(#btSave).click(function() { alert(list_items.eq(0).attr(class)); } }); On Tue, Jun 16, 2009 at 3:01 PM, waseem sabjee waseemsab...@gmail.comwrote: var list_items = $(.liRow); $(#btSave).click(function() { alert(list_items).eq(0).attr(class)); } }); On Tue, Jun 16, 2009 at 2:57 PM, Dave messedupp...@gmail.com wrote: Hi How do you get the first element when the element got multiple classes? ul id=ulList li class=liRow1/li li class=liRow liEven2/li li class=liRow3/li li class=liRow liEven4/li /ul input id=btSave type=button value=Save / $(#btSave).click(function(event) { alert($(#ulList .liRow:first).attr(class));/* Success */ alert($(#ulList .liRow .liEven:first).attr(class));/* Hmm */ }); Cheers- Hide quoted text - - Show quoted text -
[jQuery] Re: Get first element when there are multiple classes
I am not sure on what are you trying to do, but alert($(#ulList .liEven:first).attr(class)); /* Returns Success*/ Maurício -Mensagem Original- De: Dave Para: jQuery (English) Enviada em: terça-feira, 16 de junho de 2009 09:57 Assunto: [jQuery] Get first element when there are multiple classes Hi How do you get the first element when the element got multiple classes? ul id=ulList li class=liRow1/li li class=liRow liEven2/li li class=liRow3/li li class=liRow liEven4/li /ul input id=btSave type=button value=Save / $(#btSave).click(function(event) { alert($(#ulList .liRow:first).attr(class));/* Success */ alert($(#ulList .liRow .liEven:first).attr(class));/* Hmm */ }); Cheers
[jQuery] Re: get email and send email?
Any help here, people? If this can't be done with jQuery, would somebody tell me that?
[jQuery] Re: get email and send email?
Understand that jQuery is running on your user's browser so no, it cannot natively send/receive email On Jun 16, 9:47 am, inkexit createmod...@gmail.com wrote: Any help here, people? If this can't be done with jQuery, would somebody tell me that?
[jQuery] Change page on selected combo value
Hi all, I have an .ascx page with a populated combobox: select id=Users name=Users option value=New User---New User---/option option value=TedWilsonTed Wilson/option option value=KatyBruceKaty Bruce/option /select I need that when the user select New User he will be redirected to another page where he can insert the new user's value. Ho can I accomplish this? Thanks in advance. Luis --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups jQuery (English) group. To post to this group, send email to jquery-en@googlegroups.com To unsubscribe from this group, send email to jquery-en+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/jquery-en?hl=en -~--~~~~--~~--~--~---
[jQuery] Re: Change page on selected combo value
$(#Users).change(function() { var url = $(this).val(); top.location = url; }); On Tue, Jun 16, 2009 at 3:53 PM, ciupaz luigi.zambe...@gmail.com wrote: Hi all, I have an .ascx page with a populated combobox: select id=Users name=Users option value=New User---New User---/option option value=TedWilsonTed Wilson/option option value=KatyBruceKaty Bruce/option /select I need that when the user select New User he will be redirected to another page where he can insert the new user's value. Ho can I accomplish this? Thanks in advance. Luis
[jQuery] Re: get email and send email?
Thanks MorningZ. What would you reccommend to get something like this working? What language, or languages, etc? On Jun 16, 8:51 am, MorningZ morni...@gmail.com wrote: Understand that jQuery is running on your user's browser so no, it cannot natively send/receive email On Jun 16, 9:47 am, inkexit createmod...@gmail.com wrote: Any help here, people? If this can't be done with jQuery, would somebody tell me that?
[jQuery] Re: Change page on selected combo value
So putting value=NewUser.ascx in the option tag? Luis
[jQuery] Re: Get jQuery object from collection
i guess that is .eq(i) :)
[jQuery] Re: Change page on selected combo value
Well first off.. you can't redirect to a user control (ascx) because that's not a page per se Secondly, your original post gives no indication *where* to send the user On Jun 16, 10:05 am, ciupaz luigi.zambe...@gmail.com wrote: So putting value=NewUser.ascx in the option tag? Luis
[jQuery] Re: jQuery Conference for 2009?
So... is there no interest in a jQuery conference up in Boston this year? Incidentally, this entire post doesn't show up when searching through the group posts. I searched on conference, on Boston and on Guinness without pulling up this topic. Weird.
[jQuery] Re: Change page on selected combo value
You're right, by the way, the pages are .ascx pages, ma they lived alone, like .aspx pages (they're not embedded in .aspx pages). And the second page where redirect the user in NewUser.ascx (or .aspx, it all the same). Thanks for precisation. Luis
[jQuery] Problem with $.get() and array in json data
I am provided a json object that looks something like this: {pager_offset:50,types:[1,2,4]} If I feed that json object in to the jQuery $.get() function as the data the request it makes is like this: ?pager_offset=50types=1types=2types=4 Note that it really should be this in order for the server to be able to handle it correctly ?pager_offset=50types[]=1types[]=2types[]=4 Do I need to go and modify the json object before feeding it in to the $.get() function? or is there something else I can do?
[jQuery] Re: get date / days
Thx for sharing ... could you explain please ? On May 29, 2:49 pm, weidc mueller.juli...@googlemail.com wrote: found a way. On 29 Mai, 11:44, weidc mueller.juli...@googlemail.com wrote: hi, i need to know all days of a month / year. for example today is friday 29. and the month got 31 days. ( at the moment i just know that today is the 29. and every month got 31 days.) 2. 3. 9. 10. 16. 17. 23. 24. 30. 31. are weekend. i need to know the name of each day. i'd be happy about any help.
[jQuery] [autocomplete] List second word in a match
Well, at first, sorry about my english. The question i have is: How can i have a match in the results list when the letters maching only are in the second or third word? Is it possible? I'm going to tell you an example. In the demo page (http:// jquery.bassistance.de/autocomplete/demo/) at first example, if you type a you can find at the end of the list Avon Lake i'd like type L or Lake and get Avon Lake as result. Are there any way to do this?? Thanks a lot for yout help.
[jQuery] [autocomplete] Obtaining the *key* on selecting rather than the *display name*
Hi, I was able to obtain the key or display name from autocomplete list using your example of email. The problem is this a. Search should take place on the display field (in the name field - row.name) b. Display item in the textbox should be the display field again (the name field - row.name) c. The value in the results div should be the key field (the email field - row.to). While this looks like a trivial problem - I am unable to get this behavior from your example. Can you please help?
[jQuery] Dynamic sorting
Hi, I'm trying to figure out how to set up dynamic sorting and was wondering the best way to approach it (and maybe an example). Any suggestions? I've also tried adjust scrolling sensitivity, but no luck with: var myScroll = $('.selector') sortable('option', 'myScroll'); Thank you.
[jQuery] $.getJSON() Special Chars
Hi, I'am having a bit of a problem with special chars in a getJSON response which is the result from php and smarty the file called by the getJSON is something like this: ?php $callback = $_REQUEST[callback]; {...} Getting data from a wsdl using nusoap. {...} $smarty = new Smarty; $smarty-compile_check = true; $smarty-debugging = false; $smarty-template_dir = $CFG-smartydirs . /templates; $smarty-compile_dir = $CFG-smartydirs . /templates_c; $smarty-config_dir = $CFG-smartydirs . /configs; {...} assigning vars etc... {...} $html = $smarty-fetch(alojamentos/resultadoPesquisa.tpl); $resposta = array( html=utf8_encode($html) ); echo $callback . '('. json_encode($resposta) . ')'; ? some of the vars and text used in the smarty output as accents, ceddils, etc the problem is when i replace a div's innerHTML for the one on json.html those special chars appear like squares or chinese chars. how can this be fixed?
[jQuery] Json post with mozilla
Hi all, I'm newbie to Jquery so excuse me for dummy question. I'm facing with the issue of making a call to another domain with mozilla firefox. When I need a GET request, I use JQuery.getJson and it works fine. The problem is when I need to do a POST request, I tried with: jQuery.post( url , dati , function(data){ alert(data); }, json ); but it gives me following error: Errore: uncaught exception: [Exception... Access to restricted URI denied code: 1012 nsresult: 0x805303f4 (NS_ERROR_DOM_BAD_URI) location: http://localhost:8081/html/js/barebone.jsp? browserId=firefoxthemeId=classiccolorSchemeId=01minifierType=jsminifierBundleId=javascript.barebone.filesminifierBundleDir= %2Fhtml%2Fjst=1233649818000 Line: 1] The same error I get making a not json GET request. In this case I solved using json...but in POST case I don't know how proceed. Any hint will be appreciated, it's very urgent for me. If you need more info let me know. Greetings.
[jQuery] Re: jQuery Conference for 2009?
There wasn't much chatter on the jQuery day here on the group last year either (yet it was packed!) So i wouldn't gauge interest in it by this mailing list :-) On Jun 16, 10:41 am, ak732 ask...@gmail.com wrote: So... is there no interest in a jQuery conference up in Boston this year? Incidentally, this entire post doesn't show up when searching through the group posts. I searched on conference, on Boston and on Guinness without pulling up this topic. Weird.
[jQuery] jqModal position loading gif
$(#modal).jqm({ ajax:'@href', ajaxText: 'img alt=Loadinganimation id=loadingModal src=/ images/loading.gif /' }) I'm trying to get the loading gif to be centered in the window, but it's always in the top right corner of where the modal window shows up. here's the CSS: .jqmWindow, .jqmID1, .jqmID2{ display: none; position: fixed; top: 17%; left: 50%; margin-left:-350px; z-index:3001; } .jqmWindow #loadingModal{ position:relative; left:50%; top:200px; } the above css doesn't seem to affect the image at all. Can anyone tell me if there's a specific class applied to this image and how I might manipulate where it's placed while the content is being loaded via ajax?
[jQuery] Re: dynamically add link after certain hrefs
Maybe something like this: $('a').each(function() { var self = this; var btn_link = $('a href=#'+$(self).text()+'/a'); var href = $(self).attr('href'); // to be used in modal code $(btn_link).click(function() { // set up your modal code here }); $(self).after(btn_link); }); Or, depending on your needs, you could forego the 2nd link and make the original link open the modal window. $('#').click(function() { var href = $(this).attr('href'); /* set up your modal code here, potentially creating a link to * the original file */ return false; }); On Mon, Jun 15, 2009 at 6:59 PM, keith2734keithkee...@gmail.com wrote: I work on a portal website that has approximately 700 pages and several thousand links. Some of these links are to various documents (.doc, .pdf, .xls). I would like to use Jquery to dynamically find these links on a page when the pages load and add another link directly after it that can invoke a modal window. When the modal window opens I need to hold onto the values of the original link as it will be stored in a DB. So I think I will need the second link to contain the first links name and URL pattern as some sort of property that I can store. I am not sure the best way to accomplish this. For example: The original links would look like: a href=testlink.docDocument/href a href=testlink2.pdfPDF/href a href=www.something.comWebSite/href After the JS dynamically updates the link it would look like: a href=testlink.docDocument/hrefa href=/modalwindow.html property1=testlink.doc property2=Documentimg src=button.jpg// a a href=testlink2.pdfPDFNAME/hrefa href=/modalwindow.html property1=testlink2.pdf property2=PDFNAMEimg src=button.jpg// a a href=www.something.comWebSite/href
[jQuery] Re: Obtaining the *key* on selecting rather than the *display name*
I suppose you can switch key and value On Jun 16, 8:02 am, Sanjay Khandkar sanjaykhand...@gmail.com wrote: Hi, I was able to obtain the key or display name from autocomplete list using your example of email. The problem is this a. Search should take place on the display field (in the name field - row.name) b. Display item in the textbox should be the display field again (the name field - row.name) c. The value in the results div should be the key field (the email field - row.to). While this looks like a trivial problem - I am unable to get this behavior from your example. Can you please help?
[jQuery] Re: How to post HTML data in jQuery using $.ajax() method?
Define not working. That's a bit vague. Also, where are you calling your function from? Can you confirm that it is being called? Something like this might work for you: function PostHTMLContentTOServer() { $.ajax({ url: MyData.aspx, type: POST, data: escape($(MainDiv).html()), dataType: html, success: function(returnData) { alert(Success post); } }); } On Tue, Jun 16, 2009 at 4:29 AM, Sansandeep.ra...@gmail.com wrote: I want to post some HTML (contained in a div on the page) data using jQuery using $.ajax() method. But it is not working. script language=javascript type=text/javascript function PostHTMLContentTOServer() { var pageData = document.getElementById (MainDiv).innerHTML; $.ajax({ url: MyData.aspx, type: POST, data: pageData, dataType: html, success: function(returnData) { alert(Success post); } }); } /script -- Kindly suggest what should I do.
[jQuery] Loading image before operation starts not working
Hey guys, i have following problem: When the user on my website presses a image link, I prevent the default behaviour, and toggle some table rows (show or hide them, depending on the the image src (closed.gif / opened.gif)). Since I got a lot of rows I run over and toggle, the function takes some time to process and the browser hangs in the meanwhile. Due to this I want to show the user that the operation is still in progress and want to change the image of the link to a load spinner until it is finished. So I thought that I just have to change the src URL of the image in advance and then start the function, but jQuery is ignoring the line and I don't know why?!? Here is the code I am using: $(a[name='changeDisplayModeAll']).click(function(e) { e.preventDefault(); var newStatus; var imageSrc = $(img[name='imageChange']).attr('src'); $(img[name='imageChange']).attr('src', 'load.gif'); // Here I want to change to the load image var rep = ; // check if table rows should be hided or shown if(imageSrc.match(closed)) { newStatus = opened; rep = imageSrc.replace(closed, opened); } else { newStatus = closed rep = imageSrc.replace(opened, closed); } // now the long-lasting function // remark: i get the ids for the table row from a select box where all projects (which i want to // show /hide) are listed with id which i need to identify the table rows $(#editProject *).each(function() { var projectId = $(this).val(); if(projectId projectId != '-1') { var image = $(img[name='image_ + projectId + ']).attr('src'); var statusChanged = false; if(image) { if(image.match(closed) newStatus == opened) { statusChanged = true; rep = image.replace(closed, opened); $(img[name='image_ + projectId + ']).attr('src', rep); $.cookies.set('tree' + projectId, 'on'); } if(image.match(opened) newStatus == closed) { statusChanged = true; rep = image.replace(opened, closed); $(img[name='image_ + projectId + ']).attr('src', rep); $.cookies.set('tree' + projectId, 'off'); } if(statusChanged) { $(tr[title='projectScenarios_ + projectId + ']).each(function (i) { $(this).toggle(); }); $(tr[title='scenariosCases_ + projectId + ']).each(function (i) { $(this).toggle(); }); } } } }); // now return to the old image $(img[name='imageChange']).attr('src', rep); }); Hope someone could help me with this issue. Thanks in advance, Jens
[jQuery] Disable question
I have a div which loads a form. On that page I have other buttons that get i need to disable until the form is submitted preventing the user from doing anything other than submit or cancel. If they submit the form i then need to enable all the buttons but that's not working. I have: function formLoad() { var url_id = $(this).attr('href'); var e = $(this).attr('class'); var x = $(this).attr('id').split('_'); var y = x[0]; var z = x[1]; //alert(e); $('a[class^=edit_]').addClass('disabled'); $('a[class^=edit_]').fadeTo('slow' , 0.25 , function() { $('#resume_'+z).slideUp( 500 , function(){ $('#loading_'+z).show('fast', function() { $('#resume_'+z).load( url_id , function(){ $('#loading_'+z).hide(function(){ $('#resume_'+z).slideDown(500).fadeTo('fast', 1.0).fadeIn('slow'); }); }); }); return false; }); }); } the form gets submitted qith jquery.form helper but cant get the buttons back to clickable. Ideas? Thanks. Dave --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups jQuery (English) group. To post to this group, send email to jquery-en@googlegroups.com To unsubscribe from this group, send email to jquery-en+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/jquery-en?hl=en -~--~~~~--~~--~--~---
[jQuery] Re: Need help cuz I don't get 'this'
I'm using the jqery cycle plugin with an onAfter OnBefore function. These functions process the current div as 'this' - what I sent was the code in my div that is getting passed as 'this'. I can see that using children is the way to get the attribute I want, but I don't quite understand how to use it or how to extend the example to get what I need. Another example might help or if you know a link that explains it more detail that would be great also. Thanks
[jQuery] AJAX history management / hijaxing for JQuery 1.3.2
Can anyone clue me in on situation with the AJAX history management for JQuery 1.3.2? All the plugins I could find are outdated in terms of browser support and flexibility. This one: http://stilbuero.de/jquery/history/ looks like the most polished but does not seem to work with 1.3.2 at all. Woks sort of OK with 1.2.6 though. Any ideas? Honestly, I am puzzled why such important functionality is not a part of the core. Thanks
[jQuery] Dynamic selectors with AutoComplete
This is a complete noob question for which I apologize in advance. I have a form that creates multiple instances of a contact text box that I want to use the same Autocomplete function. The ids on the fields are dynamic. The code as I have it works but rather than creating a function for each field, it would surely be better to create one function that handles the field ids with variables. My script code in the header looks like this... $().ready(function() { $(#contacts1).autocomplete('getContacts.cfm', { minChars: 2, // The absolute chars we want is at least 1 character. delay:100, width: 600, // The width of the auto complete display max: 25, formatItem: function(row){ return row[0]; // Formatting of the autocomplete dropdown. } }); $(#contacts1).result( function(event, data, formatted) { // Make sure there's data if (data) $('#cpid1').val(data[1]); }); $(#contacts2).autocomplete('getContacts.cfm', { minChars: 2, // The absolute chars we want is at least 1 character. delay:100, width: 600, // The width of the auto complete display max: 25, formatItem: function(row){ return row[0]; // Formatting of the autocomplete dropdown. } }); $(#contacts2).result( function(event, data, formatted) { // Make sure there's data if (data) $('#cpid2').val(data[1]); }); }); Now the fields down in the form... input name=EnvContactID_1 type=hidden id=cpid1 / input type=text name=EnvContactName_1 id=contacts1 size=65 / input name=EnvContactID_2 type=hidden id=cpid2 / input type=text name=EnvContactName_2 id=contacts2 size=65 / Since the textbox fields are dynamic, these can grow very large in number. Thank you for the help and again, I'm sorry to ask such a beginner's question Jeff
[jQuery] plugin site usability
Does anyone else find the plugin site (http://plugins.jquery.com/) difficult to use? It's great that there are so many plugins to choose from, but it sure makes it hard to find what you need. I only use jQuery and the plugins occasionally, so I'm not always up to date on the best of breed plugins. When I have a need for some js functionality that I think might exist in a jQuery plugin, I go to the site and search. Seems like a lot of steps to drill down on each plugin to see the functionality and find a link for a demo. Maybe I'm just being lazy... Is there any better way to find a plugin? Any suggestions for navigating the plugin site or any other alternatives? Thanks, DR
[jQuery] Re: How to post HTML data in jQuery using $.ajax() method?
brian ha scritto: Define not working. That's a bit vague. Also, where are you calling your function from? Can you confirm that it is being called? Something like this might work for you: function PostHTMLContentTOServer() { $.ajax({ url: MyData.aspx, type: POST, data: escape($(MainDiv).html()), dataType: html, success: function(returnData) { alert(Success post); } }); } On Tue, Jun 16, 2009 at 4:29 AM, Sansandeep.ra...@gmail.com wrote: I want to post some HTML (contained in a div on the page) data using jQuery using $.ajax() method. But it is not working. script language=javascript type=text/javascript function PostHTMLContentTOServer() { var pageData = document.getElementById (MainDiv).innerHTML; $.ajax({ url: MyData.aspx, type: POST, data: pageData, dataType: html, success: function(returnData) { alert(Success post); } }); } /script -- Kindly suggest what should I do. Does it work in mozilla, too? Thanks
[jQuery] upload file from jquery dialog modal form
Does anyone know if it is possible to upload a file from a jquery modal form (http://jqueryui.com/demos/dialog/#modal-form) ? I just need some help with the ajax call. The back-end will be asp with AspUpload that will handle the file upload.
[jQuery] Finding items in an UL by their LI's Attributes
Hello, I've been trying to work this out for a bit now but seem to have come a bit unstuck. I'd like to be able to use .find to search an UL element and find out if there are any items with two attributes the same as a search choice. i.e. : My UL looks like this : ul li id=1 typeref=E typeid=1Element 1/li li id=2 typeref=E typeid=2Element 2/li /ul I would like to do a search of the above UL and get back the id of the first LI element you can see in the list there by doing a search for typeref=E typeid=1. Is that possible using Jquery? Any help would be very very gratefully recieved! Regards, Paul Hutson
[jQuery] How to tell if an item is open
I have 5 divs which can load content into them. I have added an on click add class open. When the page loads initially none are open, click on one link and the open class gets added but if another link is clicked i need to closed the open tag. How can tell jquery to look for an open tag if it finds on close it? (An accordion style layout is not what I am looking for) Dave
[jQuery] fun with check boxes.
I'm tasked with created a series of filters with checkboxes. for example lets say i have 3 categories, customers, groups, acccount customers contains groups and groups contain accounts. i want to be able all records as checkboxes in 3 different sliding panels on the same page. Then as any checkbox is checked, it automatically filters everything else. for example if i check a customer it will filter out the groups and accounts. or if i check an account it will filter out the customers and groups etc. im using php/mysql and i assume jquery is the best tool for this... problem is im a relative newbie. Can anyone point me in the right direction to get started. ?
[jQuery] Anyone else start receiving every post here via email yesterday?
It's weird. My groups settings are still set to No Email but they keep coming! Mike
[jQuery] selector, second to last row of table
I've been trying for a while to alter the second to last row of a table. I've tried several ways. The number of rows is dynamic so I can't hard code a number into nth-child. I used $rowNeeded = $thisRow.parents('table:first').children().children().length - 1 to get the second to last row, but it doesn't seem like I can pass this variable into nth-child either. How can I select the second to last row of a table? Thanks
[jQuery] Re: How to tell if an item is open
$('.open').each(function() { $(this).removeClass('open'); }); On Tue, Jun 16, 2009 at 1:17 PM, Dave Maharaj :: WidePixels.comd...@widepixels.com wrote: I have 5 divs which can load content into them. I have added an on click add class open. When the page loads initially none are open, click on one link and the open class gets added but if another link is clicked i need to closed the open tag. How can tell jquery to look for an open tag if it finds on close it? (An accordion style layout is not what I am looking for) Dave
[jQuery] jQuery syntax
Hi, I've been working on a project that uses xml. But for some reason, it does not work in internet explorer. And after hours and hours of debugging, I cannot figure out why. I would deeply appreciate it if you could help me. I hope this isn't asking too much, but what is wrong from the code below? (I'm hoping I'm just blind and someone sees it right away) $(function() { $.ajax({ type: GET, url: videos.xml, dataType: xml, success: function(xml) { $(xml).find('item').each(function(){ var thumb = $(this).children (description).text(); var title = $ (this).children(title).text(); var text = $ (this).children(content).text(); var link = $ (this).children(link).text(); $('div class=panel-preview/div') .html( thumb + 'h1' + title + '/ h1p' + text + '/pa class=articlelink title=Click here to watch the video hereWatch/abra href=' + link + ' class=articlelink title=Click here to read moreView Article/a') .appendTo('.accordion-padding'); }); //close each( } }); //close $.ajax( }); //close $( Thankyou very much, Connor
[jQuery] Re: selector, second to last row of table
A couple quick examples that might help (there're many more ways): console.log( $('table tr:last').prev() ); var trow = $('table tr'); console.log( $(trow[trow.length-2]) ); console.log( trow.eq(trow.length-2) ); Modify the selectors as needed for multiple/nested tables. HTH On Jun 16, 10:46 am, theprodigy tigerseyet...@gmail.com wrote: I've been trying for a while to alter the second to last row of a table. I've tried several ways. The number of rows is dynamic so I can't hard code a number into nth-child. I used $rowNeeded = $thisRow.parents('table:first').children().children().length - 1 to get the second to last row, but it doesn't seem like I can pass this variable into nth-child either. How can I select the second to last row of a table? Thanks
[jQuery] Re: Finding items in an UL by their LI's Attributes
$('ul').find('li[typeref=E][typeid=1]') NB: an id attribute that starts with a number isn't valid markup. On Jun 16, 10:05 am, Paul Hutson hutsonphu...@googlemail.com wrote: Hello, I've been trying to work this out for a bit now but seem to have come a bit unstuck. I'd like to be able to use .find to search an UL element and find out if there are any items with two attributes the same as a search choice. i.e. : My UL looks like this : ul li id=1 typeref=E typeid=1Element 1/li li id=2 typeref=E typeid=2Element 2/li /ul I would like to do a search of the above UL and get back the id of the first LI element you can see in the list there by doing a search for typeref=E typeid=1. Is that possible using Jquery? Any help would be very very gratefully recieved! Regards, Paul Hutson
[jQuery] Re: jQuery syntax
IE seems to have a problem with returning the correct header for the XML content-type. You'd have to either have the server force the content-type text/xml for .xml files, or if generated through a script (e.g. PHP) have the script set the header content-type when serving the XML. I've came upon a Javascript function that can take the returned XML and make it XML parse-able, but I can't find it. If you do a search on the jQuery groups, you'll come across a lot of posts regarding this IE and XML issue. On Jun 16, 8:03 am, cz231 cz2...@gmail.com wrote: Hi, I've been working on a project that uses xml. But for some reason, it does not work in internet explorer. And after hours and hours of debugging, I cannot figure out why. I would deeply appreciate it if you could help me. I hope this isn't asking too much, but what is wrong from the code below? (I'm hoping I'm just blind and someone sees it right away) $(function() { $.ajax({ type: GET, url: videos.xml, dataType: xml, success: function(xml) { $(xml).find('item').each(function(){ var thumb = $(this).children (description).text(); var title = $ (this).children(title).text(); var text = $ (this).children(content).text(); var link = $ (this).children(link).text(); $('div class=panel-preview/div') .html( thumb + 'h1' + title + '/ h1p' + text + '/pa class=articlelink title=Click here to watch the video hereWatch/abra href=' + link + ' class=articlelink title=Click here to read moreView Article/a') .appendTo('.accordion-padding'); }); //close each( } }); //close $.ajax( }); //close $( Thankyou very much, Connor
[jQuery] Re: How to post HTML data in jQuery using $.ajax() method?
Yes, please define not working. The problem most likely lies in what is returned here: var pageData = document.getElementById(MainDiv).innerHTML; to be used in the $.ajax() call. On Jun 16, 6:44 am, Rosa Spina spina.r...@gmail.com wrote: brian ha scritto: Define not working. That's a bit vague. Also, where are you calling your function from? Can you confirm that it is being called? Something like this might work for you: function PostHTMLContentTOServer() { $.ajax({ url: MyData.aspx, type: POST, data: escape($(MainDiv).html()), dataType: html, success: function(returnData) { alert(Success post); } }); } On Tue, Jun 16, 2009 at 4:29 AM, Sansandeep.ra...@gmail.com wrote: I want to post some HTML (contained in a div on the page) data using jQuery using $.ajax() method. But it is not working. script language=javascript type=text/javascript function PostHTMLContentTOServer() { var pageData = document.getElementById (MainDiv).innerHTML; $.ajax({ url: MyData.aspx, type: POST, data: pageData, dataType: html, success: function(returnData) { alert(Success post); } }); } /script -- Kindly suggest what should I do. Does it work in mozilla, too? Thanks
[jQuery] Re: $.getJSON() Special Chars
Make sure the page your Javascript is on is also also uses utf-8 content-type (e.g. in meta tags). Same for your PHP script. On Jun 16, 1:45 am, Obi1 gurreiro_fa...@yahoo.com.br wrote: Hi, I'am having a bit of a problem with special chars in a getJSON response which is the result from php and smarty the file called by the getJSON is something like this: ?php $callback = $_REQUEST[callback]; {...} Getting data from a wsdl using nusoap. {...} $smarty = new Smarty; $smarty-compile_check = true; $smarty-debugging = false; $smarty-template_dir = $CFG-smartydirs . /templates; $smarty-compile_dir = $CFG-smartydirs . /templates_c; $smarty-config_dir = $CFG-smartydirs . /configs; {...} assigning vars etc... {...} $html = $smarty-fetch(alojamentos/resultadoPesquisa.tpl); $resposta = array( html=utf8_encode($html) ); echo $callback . '('. json_encode($resposta) . ')'; ? some of the vars and text used in the smarty output as accents, ceddils, etc the problem is when i replace a div's innerHTML for the one on json.html those special chars appear like squares or chinese chars. how can this be fixed?
[jQuery] Re: Anyone else start receiving every post here via email yesterday?
I didn't have this mail issue, but there was this weird thing that happened yesterday where when you log into jQuery groups, you were asked whether the content is spam or not. The jQuery group, all your posts and favorites from the jQuery group all disappeared from your profile and favorites. But things went back to normal after an hour or so. This didn't happen to the other groups I'm it, so it was really strange. On Jun 16, 6:55 am, MikeyJ m.en...@gmail.com wrote: It's weird. My groups settings are still set to No Email but they keep coming! Mike
[jQuery] Re: dynamically add link after certain hrefs
You can simplify your approach; it's not necessary to copy the properties to the new link as you can just get them at runtime when the link is clicked (you also don't need to iterate over all the anchors): $('a href=/modalwindow.htmlimg src=/images/button.jpg// a').click(function(){ var props = $(this).prev(); //do your modal stuff here using the above 'props' object console.log( props.attr('href') + ', ' + props.text() ); return false; }).insertAfter('a'); This will hit every anchor. If you want to target specific anchors you'll have to make the selector more specific, e.g.: .insertAfter('a:contains(Document),a:contains(PDF),a:contains (WebSite)'); or you could use the href attribute with [href$=.doc], etc. On Jun 15, 3:59 pm, keith2734 keithkee...@gmail.com wrote: I work on a portal website that has approximately 700 pages and several thousand links. Some of these links are to various documents (.doc, .pdf, .xls). I would like to use Jquery to dynamically find these links on a page when the pages load and add another link directly after it that can invoke a modal window. When the modal window opens I need to hold onto the values of the original link as it will be stored in a DB. So I think I will need the second link to contain the first links name and URL pattern as some sort of property that I can store. I am not sure the best way to accomplish this. For example: The original links would look like: a href=testlink.docDocument/href a href=testlink2.pdfPDF/href a href=www.something.comWebSite/href After the JS dynamically updates the link it would look like: a href=testlink.docDocument/hrefa href=/modalwindow.html property1=testlink.doc property2=Documentimg src=button.jpg// a a href=testlink2.pdfPDFNAME/hrefa href=/modalwindow.html property1=testlink2.pdf property2=PDFNAMEimg src=button.jpg// a a href=www.something.comWebSite/href
[jQuery] Re: Json post with mozilla
The error means you're trying to access a resource that located on another domain. You can only use AJAX POST or GET on a resource that is located on the same domain as the page that is calling it. If that is the case in your scenario, could you provide more code for us to locate the issue? On Jun 16, 4:44 am, Nowhere spina.r...@gmail.com wrote: Hi all, I'm newbie to Jquery so excuse me for dummy question. I'm facing with the issue of making a call to another domain with mozilla firefox. When I need a GET request, I use JQuery.getJson and it works fine. The problem is when I need to do a POST request, I tried with: jQuery.post( url , dati , function(data){ alert(data); }, json ); but it gives me following error: Errore: uncaught exception: [Exception... Access to restricted URI denied code: 1012 nsresult: 0x805303f4 (NS_ERROR_DOM_BAD_URI) location: http://localhost:8081/html/js/barebone.jsp? browserId=firefoxthemeId=classiccolorSchemeId=01minifierType=jsminifierBundleId=javascript.barebone.filesminifierBundleDir= %2Fhtml%2Fjst=1233649818000 Line: 1] The same error I get making a not json GET request. In this case I solved using json...but in POST case I don't know how proceed. Any hint will be appreciated, it's very urgent for me. If you need more info let me know. Greetings.
[jQuery] [autocomplete] Manual request
Hello, Here is my situation. I have an autocomplete control on my page that is working perfectly. I wanted to mimic a drop down menu by placing an image just to the right of the text box. When a user clicks that drop down arrow image, I want the whole list to display below the textbox. So far, I have been unable to manually force the request and display of the items in my list. Any ideas how to? Thank you, Bryan
[jQuery] Re: Json post with mozilla
Thanks for answer. Yes, It's a post request for a page located on a different domain: from http://localhost:8080 to http://localhost:8081 (two tomcat istances). I know it's not allowed by cross domain rules, in fact I use Json for get requests, but I don't know how to do with post requests because never json type works. I realized there isn't way :-( 2009/6/16 James james.gp@gmail.com The error means you're trying to access a resource that located on another domain. You can only use AJAX POST or GET on a resource that is located on the same domain as the page that is calling it. If that is the case in your scenario, could you provide more code for us to locate the issue? On Jun 16, 4:44 am, Nowhere spina.r...@gmail.com wrote: Hi all, I'm newbie to Jquery so excuse me for dummy question. I'm facing with the issue of making a call to another domain with mozilla firefox. When I need a GET request, I use JQuery.getJson and it works fine. The problem is when I need to do a POST request, I tried with: jQuery.post( url , dati , function(data){ alert(data); }, json ); but it gives me following error: Errore: uncaught exception: [Exception... Access to restricted URI denied code: 1012 nsresult: 0x805303f4 (NS_ERROR_DOM_BAD_URI) location: http://localhost:8081/html/js/barebone.jsp? browserId=firefoxthemeId=classiccolorSchemeId=01minifierType=jsminifierBundleId=javascript.barebone.filesminifierBundleDir= %2Fhtml%2Fjst=1233649818000 Line: 1] The same error I get making a not json GET request. In this case I solved using json...but in POST case I don't know how proceed. Any hint will be appreciated, it's very urgent for me. If you need more info let me know. Greetings.
[jQuery] Re: cycle plugin pagerAnchorBuilder
OK, there were no takers on this. In the unlikely event that anyone's interested, here's the work-around that I arrived at. It's simple enough that I think it will not cause me any problems, but I sure would like to know what the right solution might be. In the HTML, an image collection like this: div id=cycleport img class=cimg src=images/1.jpg alt = / img class=cimg src=images/2.jpg alt = / img class=cimg src=images/3.jpg alt = / img class=cimg src=images/4.jpg alt = / img class=cimg src=images/5.jpg alt = / img class=cimg src=images/6.jpg alt = / /div using cycle, I navigate this collection with prev/next links, but I also wanted to provide a drop-down list allowing the user to jump straight to specific images and then go prev/next from there. ul id=clientList lia href=#Foo text/a/li lia href=#Bar text/a/li lia href=#Baz text/a/li /ul My solution (a very unsatisfying kluge) was to simply add empty, dummy lines to the list thus: ul id=clientList li class=noshow/li lia href=#Foo text/a/li li class=noshow/li li class=noshow/li lia href=#Bar text/a/li lia href=#Baz text/a/li /ul to allow the user to go directly to 2.jpg, 5.jpg, and 6.jpg by choosing from the list and using a cycle call like this: $('#cycleport').cycle({ prev: '#prev', next: '#next', timeout: 0, before: swapText, pager: '#clientList', pagerAnchorBuilder: function(idx, slide) { return '#clientList li:eq(' + (idx) + ') a'; } }); If anybody has a cleaner solution, I'd sure love to know about it. Jon
[jQuery] Palm Pre and jQuery? Is it possible?
I watched a slidedeck today which talked about developing for WebOS, which is all based around JavaScript. Does anyone know if it's possible to use jQuery for WebOS development? andy
[jQuery] Re: Need help cuz I don't get 'this'
From a different forum I got this which works: $(this).find('img').attr('src'); On Jun 16, 11:18 am, Logictrap dlyck...@gmail.com wrote: I'm using the jqery cycle plugin with an onAfter OnBefore function. These functions process the current div as 'this' - what I sent was the code in my div that is getting passed as 'this'. I can see that using children is the way to get the attribute I want, but I don't quite understand how to use it or how to extend the example to get what I need. Another example might help or if you know a link that explains it more detail that would be great also. Thanks
[jQuery] Re: Get first element when there are multiple classes
Standard CSS selector for multiple classes. liEven is not a descendant of .liRow, just put them together: $(#ulList .liRow.liEven:first) On Jun 16, 9:57 am, Dave messedupp...@gmail.com wrote: Hi How do you get the first element when the element got multiple classes? ul id=ulList li class=liRow1/li li class=liRow liEven2/li li class=liRow3/li li class=liRow liEven4/li /ul input id=btSave type=button value=Save / $(#btSave).click(function(event) { alert($(#ulList .liRow:first).attr(class));/* Success */ alert($(#ulList .liRow .liEven:first).attr(class));/* Hmm */ }); Cheers
[jQuery] How to simulate a human-triggered event?
Hi, I'm trying to change the value of an input field (target) which depends on another input (source). It works well when I manually change the source value. But if I changed the source value with another button, the target value remains the same. Here's the code... $(document).ready(function() { $('input#change').click(function() { $('input#source').attr('value', 'This is the value changed by a button'); }); $('input#source').change(function() { $('input#target').attr('value', $('input#source').attr('value')); }); }); pSource: input type=text name=target id=source size=60 value= / input type=button id=change value=change source value //p pTarget: input type=text name=target id=target size=60 value=This is the original value, type something in source to change //p So how could the target input detect if there's a change within the source input without manually changing it's value? Thanks
[jQuery] Re: Need help cuz I don't get 'this'
$(this).find('img').attr('src'); jQuery selectors accept a 2nd argument for context, which makes this a bit more readable, imo: var src = $('img',this).attr('src');
[jQuery] Re: How to simulate a human-triggered event?
Assuming the second input field is triggered by a user instigated event, then you could just trigger that event. $('input#change').click(function() { $('input#source').attr('value', 'This is the value changed by a button'); $('something').trigger('blur',fn); }); -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Jay Sent: Tuesday, June 16, 2009 3:46 PM To: jQuery (English) Subject: [jQuery] How to simulate a human-triggered event? Hi, I'm trying to change the value of an input field (target) which depends on another input (source). It works well when I manually change the source value. But if I changed the source value with another button, the target value remains the same. Here's the code... $(document).ready(function() { $('input#change').click(function() { $('input#source').attr('value', 'This is the value changed by a button'); }); $('input#source').change(function() { $('input#target').attr('value', $('input#source').attr('value')); }); }); pSource: input type=text name=target id=source size=60 value= / input type=button id=change value=change source value //p pTarget: input type=text name=target id=target size=60 value=This is the original value, type something in source to change //p So how could the target input detect if there's a change within the source input without manually changing it's value? Thanks
[jQuery] Re: Get first element when there are multiple classes
Ahh, great. Thanks. On Jun 16, 11:05 pm, Ricardo ricardob...@gmail.com wrote: Standard CSS selector for multiple classes. liEven is not a descendant of .liRow, just put them together: $(#ulList .liRow.liEven:first) On Jun 16, 9:57 am, Dave messedupp...@gmail.com wrote: Hi How do you get the first element when the element got multiple classes? ul id=ulList li class=liRow1/li li class=liRow liEven2/li li class=liRow3/li li class=liRow liEven4/li /ul input id=btSave type=button value=Save / $(#btSave).click(function(event) { alert($(#ulList .liRow:first).attr(class));/* Success */ alert($(#ulList .liRow .liEven:first).attr(class));/* Hmm */ }); Cheers- Hide quoted text - - Show quoted text -
[jQuery] Re: selector, second to last row of table
ok, I'm having a really tough time with this. here's a part of my code (most of this Thanks to Karl, part thanks to mkmanning, very little thanks to me, lol): $('a.moveup').click(function(event) { var $thisRow = $(this).parents('tr:first'); var $thisTable = $('#main_table'); var $rows = $('#main_table tr'); var $lastRow = $rows[$rows.length-1]; $thisRow.next().insertBefore($thisRow.prev().prev()); $thisRow.insertBefore( $thisRow.prev().prev().prev()); if ($thisRow.is(':nth-child(2)')) { $thisRow.find('.moveup').hide(); $thisRow.next().next().find('.moveup').show(); } if($thisRow.next().next().is($($lastRow))){ $thisRow.next().next().find('.movedown').hide(); $thisRow.find('.movedown').show(); } return false; }); I am trying to do this: Move Up link: switch two table rows, if one of them becomes the top row, the Move Up link needs to hide. If one of the becomes the bottom row, the Move Down link needs to hide. The table is setup with a table row of data, followed by a table row of horizontal rule. So, when a table row is moved up, I need to switch it with the row that is 2 above it. The table data row is actually the second from the bottom due to the horizontal rule table row that is beneath it. If any of this doesn't make sense, I apologize. I can try to explain it better. Thanks, Paul On Jun 16, 2:14 pm, mkmanning michaell...@gmail.com wrote: A couple quick examples that might help (there're many more ways): console.log( $('table tr:last').prev() ); var trow = $('table tr'); console.log( $(trow[trow.length-2]) ); console.log( trow.eq(trow.length-2) ); Modify the selectors as needed for multiple/nested tables. HTH On Jun 16, 10:46 am, theprodigy tigerseyet...@gmail.com wrote: I've been trying for a while to alter the second to last row of a table. I've tried several ways. The number of rows is dynamic so I can't hard code a number into nth-child. I used $rowNeeded = $thisRow.parents('table:first').children().children().length - 1 to get the second to last row, but it doesn't seem like I can pass this variable into nth-child either. How can I select the second to last row of a table? Thanks
[jQuery] Animating background color
I use jQuery 1.3.2 and tried to use: $('.applied').each(function(){ $(this).css('background-color', '#ff').animate ({backgroundColor: #000 }, slow); }); For some reason, the background doesn't change and my firefox debugs the error of NaNpx a few times. What is wrong?
[jQuery] Re: cycle plugin pagerAnchorBuilder
ul id=clientList lia href=#Foo text/a/li lia href=#Bar text/a/li lia href=#Baz text/a/li /ul If anybody has a cleaner solution, I'd sure love to know about it. This is what I'd do: ul id=clientList lia href=# data-slide=2Foo text/a/li lia href=# data-slide=5Bar text/a/li lia href=# data-slide=6Baz text/a/li /ul $(function() { $('#cycleport').cycle({ prev: '#prev', next: '#next', timeout: 0, before: swapText }); $('#clientList li a').click(function() { var slide = $(this).attr('data-slide'); slide = parseInt(slide); $('#cycleport').cycle(slide); return false; }); });
[jQuery] [validate] Validating a formatted number failed
Hi all, I am using validate (1.5.4) plugin to validate numeric input field with max:5000.00. When the numeric value is formatted as 2,999.00, the max validation failed. After some investigation, it turns out the max function compare the value 2,999.00 as string with 5000.00 instead of 2999.00 with 5000.00. To fix this, I modified the existing value variable with parseFloat(value.replace(,,) in min:, max:, and range:. Note: Only works in countries that use , as thousand separator. For Jörn, could this fix be included on your future release? Thanks.
[jQuery] Re: selector, second to last row of table
On Jun 17, 3:46 am, theprodigy tigerseyet...@gmail.com wrote: I've been trying for a while to alter the second to last row of a table. I've tried several ways. The number of rows is dynamic so I can't hard code a number into nth-child. I used $rowNeeded = $thisRow.parents('table:first').children().children().length - 1 to get the second to last row, but it doesn't seem like I can pass this variable into nth-child either. How can I select the second to last row of a table? In browsers compliant with the W3C DOM 2 HTML specification, table elements have a rows collection that contains all the rows in the table. That collection has a length attribute, so, where - table - is a reference to a table element: var rows = table.rows; var secondLastRow = rows[rows.length - 2]; Since rows is a live collection, you can get a reference once and keep it, it will dynamically updated regardless of how many rows are added or removed from the table. Note that the above will error if there are less than two rows in the table, use with care. -- Rob
[jQuery] Converting objects to strings
Hi All, I have the following code, which I am trying to pass in 5 variables. script type=text/javascript $(function(){ $('#DrainStackDiameter').change(function(){ var params = { TotalApartmentsServed: $('#TotalApartmentsServed'), TotalWashroomsPerApartment:$('#TotalWashroomsPerApartment'), TotalPowerPipeUnits: $('#TotalPowerPipeUnits'), DrainStackLength: $('#DrainStackLength'), DrainStackDiameter: $('#DrainStackDiameter') }; $('#RecommendedPowerPipeModel').load('recommend.php',params); }) .change(); }); /script However, the Post in Firebug is giving me the following: DrainStackDiameter [object Object] DrainStackLength[object Object] TotalApartmentsServed [object Object] TotalPowerPipeUnits [object Object] TotalWashroomsPerApartment [object Object] How can I convert to string? Thanks in advance for any help. Greg
[jQuery] Re: Converting objects to strings
I think what you want i something likevar params = { TotalApartmentsServed: $('#TotalApartmentsServed').val(), TotalWashroomsPerApartment:$('#TotalWashroomsPerApartment').val(), TotalPowerPipeUnits: $('#TotalPowerPipeUnits').val(), DrainStackLength: $('#DrainStackLength').val(), DrainStackDiameter: $('#DrainStackDiameter').val() }; i think you only want to submit the value of the fields back to server right? not the entire elements
[jQuery] Re: get email and send email?
Um, java?
[jQuery] Re: cycle plugin pagerAnchorBuilder
Mike Alsup, Thanks so much for pointing out the obvious; no really, I mean it sincerely. I so often overlook the obvious, to my cost. I didn't realize that I could simply pass a bare integer to the cycle call. Admiration and gratitude for a wonderfully well thought out and effective tool! Jon This is what I'd do: ul id=clientList lia href=# data-slide=2Foo text/a/li lia href=# data-slide=5Bar text/a/li lia href=# data-slide=6Baz text/a/li /ul $(function() { $('#cycleport').cycle({ prev: '#prev', next: '#next', timeout: 0, before: swapText }); $('#clientList li a').click(function() { var slide = $(this).attr('data-slide'); slide = parseInt(slide); $('#cycleport').cycle(slide); return false; }); });
[jQuery] Ghost data using jQuery.data
Hi I am using jQuery data store and wished to make deep copy of elements, including all the data stored with jQuery. So I'm using the allData plugin provided here : http://stackoverflow.com/questions/999535/how-to-get-from-an-element-all-the-data-set-using-the-data-method also I made a quick'n dirty setData plugin : jQuery.fn.setData = function(allData) { return $(this).each(function(){ $.each(allData, function(k, v){ $(this).data(k, v); }); }); }; After several manipulations, I get ghost data mixing up with the data it did set : It is key / values looking like : jQuery1245205292826 / 1552 I am trying to figure out what is happening exactly, and when this ghost data is being added, but firebug is quite unstable on this and I cant trust its results. Any help / hint appreciated !
[jQuery] Re: How to tell if an item is open
Or simply $('.open').removeClass('open'), iteration is built-in :) On Jun 16, 3:02 pm, brian bally.z...@gmail.com wrote: $('.open').each(function() { $(this).removeClass('open'); }); On Tue, Jun 16, 2009 at 1:17 PM, Dave Maharaj :: WidePixels.comd...@widepixels.com wrote: I have 5 divs which can load content into them. I have added an on click add class open. When the page loads initially none are open, click on one link and the open class gets added but if another link is clicked i need to closed the open tag. How can tell jquery to look for an open tag if it finds on close it? (An accordion style layout is not what I am looking for) Dave
[jQuery] Re: Json post with mozilla
You can do a normal post in an iframe, with URL encoded JSON (decode server-side), just watch the max string length for a URL. On Jun 16, 4:43 pm, Rosa Spina spina.r...@gmail.com wrote: Thanks for answer. Yes, It's a post request for a page located on a different domain: fromhttp://localhost:8080tohttp://localhost:8081(two tomcat istances). I know it's not allowed by cross domain rules, in fact I use Json for get requests, but I don't know how to do with post requests because never json type works. I realized there isn't way :-( 2009/6/16 James james.gp@gmail.com The error means you're trying to access a resource that located on another domain. You can only use AJAX POST or GET on a resource that is located on the same domain as the page that is calling it. If that is the case in your scenario, could you provide more code for us to locate the issue? On Jun 16, 4:44 am, Nowhere spina.r...@gmail.com wrote: Hi all, I'm newbie to Jquery so excuse me for dummy question. I'm facing with the issue of making a call to another domain with mozilla firefox. When I need a GET request, I use JQuery.getJson and it works fine. The problem is when I need to do a POST request, I tried with: jQuery.post( url , dati , function(data){ alert(data); }, json ); but it gives me following error: Errore: uncaught exception: [Exception... Access to restricted URI denied code: 1012 nsresult: 0x805303f4 (NS_ERROR_DOM_BAD_URI) location: http://localhost:8081/html/js/barebone.jsp? browserId=firefoxthemeId=classiccolorSchemeId=01minifierType=jsminifierBundleId=javascript.barebone.filesminifierBundleDir= %2Fhtml%2Fjst=1233649818000 Line: 1] The same error I get making a not json GET request. In this case I solved using json...but in POST case I don't know how proceed. Any hint will be appreciated, it's very urgent for me. If you need more info let me know. Greetings.
[jQuery] Re: Need help cuz I don't get 'this'
Thanks for the tip and also the cycle plugin - It works great! -- Forwarded message -- From: Mike Alsup mal...@gmail.com Date: Jun 16, 4:17 pm Subject: Need help cuz I don't get 'this' To: jQuery (English) $(this).find('img').attr('src'); jQuery selectors accept a 2nd argument for context, which makes this a bit more readable, imo: var src = $('img',this).attr('src');
[jQuery] [Validate] tabs - validate per tab - disable moving forward if invalid
Working example: http://www.williamworley.com/jquery/createposting.php So I seemed to have figured out a way to get this to work correctly but its more code than I would like for using jquery. Basically what I've done is make it so you have form validation using Jorns Validation Plugin per tab when using the jquery tabs. There are a few issues though Issues: A lot of code to do something this simple All tabs to the right of the current tab have to be disabled due to me not being able to get the first invalid element focus to work (switch to the tab with the invalid element). Please let me know if anyone has a cleaner (less code) way to validate per tab or get the focus first invalid element working.
[jQuery] Cluetip - Fixed position using dimensions of parent element NOT calling element
Hi all. I am using cluetip successfully on a multiple-tip, dynamic site to show a preview of a customer testimonial with a link inside the tip to go to the full testimonial. The cluetip is attached to the A tag surrounding the icon (of the customer's company logo). All testimonials are inside a single div. I am using positionBy: Fixed as I need to control the position of the tip so that it appears in the same place relative to each icon. However, all 6 tooltips are appearing in the same place - Cluetip is populating the content correctly (from the hidden local spans) but the tips appear in the same place at the end of the parent div not the calling A-tag. The testimonials appear about halfway down the right hand column of a 2-column site (CSS columns - not table markup). Cluetip settings: $('a.tip').cluetip({ local: true, hideLocal: true, arrows: false, dropShadow: false, hoverIntent: false, sticky: true, mouseOutClose: true, closePosition: 'top', closeText: '', positionBy: 'fixed' }); The markup for the relevant location is: div id=testmonials a class=tip href=#testimonial-0 rel=#testimonial-0 id=test- tip-0 img (blah blah) / /a a class=tip href=#testimonial-1 rel=#testimonial-1 id=test- tip-1 img (blah blah) / /a . . . a class=tip href=#testimonial-5 rel=#testimonial-5 id=test- tip-5 img (blah blah) / /a /div The site is not live yet - only on my local dev server or I would be able to link to the site for a demo. Any help would be greatly appreciated. Kind regards James.