[jQuery] Re: How to pass in data
I guess this is the answer to my question -- bind( type, [data], fn ) If I use bind, I can pass in data to event handlers. ~PK On Mon, Jan 18, 2010 at 12:48 AM, Patrick wrote: > What is the best way to get data into jQuery? Obviously, jQuery > separates data and presentation. How can I pass in a parameter? > Below, you can see how I called a method with a hardcoded value, but > I want to dynamically pass in a value from web page. > > $(document).ready(function() > { > > /* tweet status id number */ > getTwitter('7833519704'); > > }); > > What is the recommended strategy when using jQuery? Should I use a > different event? It may mean that I should employ a hybrid method or > technique. > > Any ideas or recommendations are appreciated. > > Thanks. Pat >
[jQuery] How to pass in data
What is the best way to get data into jQuery? Obviously, jQuery separates data and presentation. How can I pass in a parameter? Below, you can see how I called a method with a hardcoded value, but I want to dynamically pass in a value from web page. $(document).ready(function() { /* tweet status id number */ getTwitter('7833519704'); }); What is the recommended strategy when using jQuery? Should I use a different event? It may mean that I should employ a hybrid method or technique. Any ideas or recommendations are appreciated. Thanks. Pat
[jQuery] Passing in a parameter
Hi all, I have a newbie question. You know how you can pass a variable to a JavaScript function like this: onload="getStuff(data)" Which is done via the BODY tag. Now, jQuery uses $(document).ready (function() }); My problem is simple: I want to pass in a variable to the ready (function(). When the page is first loaded, how can I pass in a variable to this function, or what strategy should I imploy to do such? Thanks for the pointers. Pat
Re: [jQuery] Re: help combine LightBox & jMyCarousel effect?
Basically, at the bottom of the .ready(function(), I pass a tweet status id number, so that I can only pull tweets via Ajaxx with a status_id greater than (newer than) the current - $(document).ready(function() { $.ajaxSetup({ error:function(x,e){ if(x.status==0){ alert('You are offline!!\n Please Check Your Network.'); }else if(x.status==404){ alert('Requested URL not found.'); }else if(x.status==500){ alert('Internel Server Error.'); }else if(e=='parsererror'){ alert('Error.\nParsing JSON Request failed.'); }else if(e=='timeout'){ alert('Request Time out.'); }else { alert('Unknow Error.\n'+x.responseText); } } }); /* status id number */ getTwitter('7833519704'); }); I hardcoded a number and perfect my PHP code, but now I need a way to pass it in dynamically. What is the recommended strategy? It may mean that I need to imploy a different way of calling it, but that's fine. Perhaps cookies or some database idea may be a workaround, but I am trying to find what jQuery supports here - that is, how can I best pass in parameters when .ready() is called, and how to do so subsequently to that. ~Patrick On Sun, Jan 17, 2010 at 12:03 PM, JamaicaMan wrote: > Is this what you are trying to do? http://www.rouse.ws/jCarouselDemo.php > > If so send a link to the web page that does not work and let me take a > look at it. > J M > > On Jan 16, 1:37 pm, bhupal wrote: >> I want the combine effect of these two plugins.. >> >> LightBoxhttp://leandrovieira.com/projects/jquery/lightbox/&; >> jMyCarouselhttp://www.enova-tech.net/eng/lab/jMyCarousel >> >> but when i tried to combine these plugins.. the resulting page looks >> good in my localhost but don't work well when uploaded to real server. >> please help me get the horizontal scroll with lightbox effects for >> thumbnails. >> >> regards. >
[jQuery] Re: what's up with zoho jquery forum???
Thanks!!! On Jan 14, 9:52 pm, Dave Methvin wrote: > The official forum will athttp://forum.jquery.com/so you might want > to head over there and look around. This Google group will be around > for a long time and you're free to post here, but at some point we'll > turn moderation off and within a few weeks it will most likely be > overrun by spammers. > > http://ejohn.org/blog/google-groups-is-dead/ > > On Jan 14, 1:22 pm, Patrick wrote: > > > > > I tried to get to this forum and ended up at some zoho forum for > > jquery. Is this the official forum for jquery?
[jQuery] Re: .load() not functioning correctly on IE
gib, i've spent most of the day working on my problem, which I believe is similar to yours. What i've found with IE versus other browsers, is that if one quote is wrong... added or missing... IE won't load the results. This may be a place for you to look next. On Jan 14, 4:03 am, gib wrote: > $("#datatable").load("includes/Remotes.asp",{funcType: "getData"}, > function (responseText, textStatus, XMLHttpRequest) { > alert(responseText); // dom element > alert(textStatus); > > }); > > This code works fine in firefox, and the alerted responseText is > correct, but it is not displayed in the targeted div, any idea whats > could be going on? > > thanks in advance > > gib
[jQuery] Re: .load() not functioning correctly on IE
gib, do you happen to have a style in the html you are loading? e.g. . Patrick On Jan 14, 4:03 am, gib wrote: > $("#datatable").load("includes/Remotes.asp",{funcType: "getData"}, > function (responseText, textStatus, XMLHttpRequest) { > alert(responseText); // dom element > alert(textStatus); > > }); > > This code works fine in firefox, and the alerted responseText is > correct, but it is not displayed in the targeted div, any idea whats > could be going on? > > thanks in advance > > gib
[jQuery] jQuery/Ajax client storage
I apologize if this is already answered somewhere, as I could not find it... If the client is constantly calling ajax objects and those objects are bringing with them additional jQuery scripts, how does jQuery handle the removal and handling of objects that go away, because they are replace by a new object with a new script. Does one have to use a destroy/unbind to prevent memory/storage from growing? For example: 1) Client page loads 2) Page loads an edit (ObjA edit) via ajax, and the object is loaded with it's own set of validation and jquery functions. 3) ObjA edit is completed, so a new edit is loaded for ObjB (an entirely different object, not just a new instance of ObjA). Before load the div storing the edit is cleared. The newly loaded edit (ObjB edit) has it's own unique logic and validation. Will jQuery still contain the bound events and created functions for ObjA, eventhough the div was cleared? Thanks! Patrick
[jQuery] html title attribute displaying incorrectly
Hi, I've implemented a mouse over enlarge function using Jquery. I have added on title attribute but which works fine when the Jquery isn't working. Once "switched on" it iplements the colours stipulated by the CSS style sheet. I'm confused as to how I can tell it to do what it normally does. The on page jQuery code is below. As you can see I have set the labels to false (the function is only used once on the page). Setting them to true does not display the labels either. Can you help me display the title attribute in it's standard format? jQuery(function($){ $('div.demo').each(function(i){ var opts = { align:[ 'center', 'center', 'center' , 'center', 'center', 'center' ][i] || 'center' //default , size: [ 85 , 60, 60 , 36 , 24 , 45 ][i] || 24 //default , distance: [ 50 , 50, 50 , 60 , 48 , 80 ][i] || 54 //default , coefficient : [ 1, 1 , 1 , 1 , 1.5 , 1.5 ][i] || 1.5 //default , labels: [ false , 'bc' , 'bc' , 'br' , true , false ][i] || false//default , duration: 400 , source: (i==0 || i==6) ? function(i) { return (this.alt) ? false : this.src.replace(/(jpg|gif) $/,'png'); } : false }; $(this).jqDock(opts); }); $('div.demo a>img').not($('#menu1 a>img')).bind('click', function() { var Href = $(this).parent().get(0).href; if(Href && !/^javascript:/i.test(Href)){ location.href = Href; }else{ $(this).parent().trigger('click'); } return false; }); });
[jQuery] Re: Dynamic values
That sounds like a good option. I didn't know the plugin existed. Thanks!!! On Oct 7, 9:44 pm, "Richard D. Worth" wrote: > You can use the metadata plugin (http://plugins.jquery.com/project/metadata) > to store and retreive the > values like so: > http://some/url/to/open/in/dialog"; class="DialogEdit > {width:500,height:250}">link text > > Then something like this should do: > > $('.DialogEdit').click(function() { > var options = $(this).metadata("DialogEdit"); > $('').load(this.href, function() { > $(this).dialog(options); > }); > return false; > > }); > > - Richard > > > > On Wed, Oct 7, 2009 at 7:59 PM, Patrick wrote: > > > I'd like to be able to set the size of a jQuery dialog dynamically > > when I call it based on the target to be shown. I was considering > > adding invalid attributes like the following... where edit_width and > > edit_height are parsed and passed right before opening the dialog. > > > > edit_height=250> > > > But it's probably not be the best way. The dialog call is done from a > > base page, while the actual content to call is determine from the link > > clicked on the widget. When setting the link, I would know the size > > needed for the HTMLToOpenInDialog... Any ideas that don't use non- > > standard markup or hidden fields? > > > Thanks, > > Patrick
[jQuery] Dynamic values
I'd like to be able to set the size of a jQuery dialog dynamically when I call it based on the target to be shown. I was considering adding invalid attributes like the following... where edit_width and edit_height are parsed and passed right before opening the dialog. But it's probably not be the best way. The dialog call is done from a base page, while the actual content to call is determine from the link clicked on the widget. When setting the link, I would know the size needed for the HTMLToOpenInDialog... Any ideas that don't use non- standard markup or hidden fields? Thanks, Patrick
[jQuery] Re: Superfish resize issue
Gernot, It's probably not what you want to hear, but I would suggest trimming the main menu down by creating some groupings. I think you will find the usability and appearance improves, moreover, your issue will be resolved. Best of luck, Patrick On Oct 6, 9:06 am, Hetsch wrote: > Hi, > > first thing to say is, thanks for the wonderful menu. > I have a small issue in Internetexplorer 7 and below. I have allready > read something about the z-index bug, but it seems to be another > issue. > > Have a look at:www.skyrunning.at. The menu looks nicely if it's a > really wide sreen resolution, but if you size the window to it's half > or below, the menu gets shrunk and floats into a second line. That's > all good. > > But i hover over the first mainmenu point "Seven Summit Speed Project" > the first submenu point "Aconcagua" is not visible ( it's behind the > main-menu entry in the second line ). I don't know how to adjust the > correct z-index for all the submenu points that they are shown on top > of the mainmenu points. > > I hope you get the idea what i mean & any help is appreciated > > Thanks a lot > Gernot
[jQuery] Re: Clickable autocomplete, like google
Ladksak, try to set the option matchContains to true. Regards Patrick On Sep 3, 5:59 pm, ladksak wrote: > the problem is that i need it to work with the script i posted the > link > > thats because the UIAutocompleteis not as good... > if i type "ODE" in the ui he doesn't show CODE > > i need it to "ODE" show CODE and ODESSA, like he could find the string > in any part of the keywords and highlight that > thats what the dyve script does > thanks anyway man!
[jQuery] Re: Autocomplete -- Autofill & Comma Seperator Issues
Hi, have you tried to set the option selectFirst to false? Regards Patrick On Sep 3, 8:15 am, Mil wrote: > Does anyone have any ideas for this issue? > > On Sep 1, 4:49 am, Mil wrote: > > > > > Hi, > > > I am trying to use this > > autocompletehttp://docs.jquery.com/Plugins/Autocomplete > > but I'm having some issues with it. I'm trying to create a simple tag > > autocomplete feature. > > > This is what I want to type (Example 1) > > TextArea: Cake, Ca, Caldren, Calimari, > > > This is what I get (Example 2) > > TextArea: Cake, Cake, Caldren, Calimari, > > > In Javascript, my var data = ["Cake", "Caldren", "Calimari"]; > > > As you can see, I cannot type "Ca" because the information will > >autofillto "Cake" every time I type acomma. The only way I can > > avoid this is to do something very un-user friendly. That is to type > > "Ca" then press space and then type mycomma. That's the only way I > > can do it to make Example 1 work. > > > This is my code: > > jQuery("#TagBox").autocomplete(data, { > > multiple: true, > > highlight: false, > > multipleSeparator: ", " > > }); > > > What am I doing wrong?
[jQuery] Re: Know which form was submitted in a page with multiple forms
I have not used it yet, but there is a plugin called dirtyform that would most likely do what you are wanting to do. It looks very nice. p On Sep 5, 5:23 am, Chamila wrote: > I have a page which displays a list of resources in the database. For > each of these resources I have a comment form. I am using jQuery form > plugin to submit the form through ajax. > > After submitting I want to display the comment which was just > submitted w/o reloading the page. But how do I know which form was > submitted? I attach the resource ID as a GET variable to the action > url of the form. If I can get the action url then I think I'm saved.
[jQuery] Re: Code inside click() event not firing.
James, yes. Dead on and I have it working now. The event delegation/event bubbling proved difficult as the event.target.id of the freshly loaded anchor tags didn't seem to be available to me (needed for show()ing the corresponding div). What did work was rebinding the event at the end of the ajax call (within the function just after the return). Luckily for me, unbinding and binding didn't appear to be necessary. At least if I run into problems with it, I'll know where to look. The help was much appreciated. Thank you! On Aug 13, 8:36 pm, James wrote: > Are the tags that you're binding the click event to introduced > into the DOM from the showHint AJAX request? > If so, read this: > Why do my events stop working after an AJAX > request?http://docs.jquery.com/Frequently_Asked_Questions#Why_do_my_events_st... > > On Aug 13, 8:16 am, Patrick wrote: > > > New to jQuery, I did many searches before posting. > > > This is happening in both IE6 and Firefox 3.0.13. I've gotten the > > following script to work under strange circumstances (explained below > > first snippet). > > > jQuery(document).ready(function(){ > > showHint(""); // ajax that fires onload, with no problem (but did > > try taking it out with same results) > > $("a").click(function () { > > alert("hi onclick"); // stuck this in there but doesn't fire > > either. > > var avid; > > avid = "#div" + $(this).attr("id"); > > alert(avid); // this won't work either. > > $(avid).fadeIn("slow"); > > $(avid).css({display: block}); // added this extra when fadeIn > > didn't work. > > }); > > > }); > > > When I'm able to successfully get both the alert and the rest of the > > script to work is when I add another alert in the ready() section. > > Then, the code works for the rest of the browser session (even after > > the 'ready ()' alert is removed). > > > jQuery(document).ready(function(){ > > showHint(""); // ajax/json > > alert("hi on load"); // after inserting this, the below all works > > ** > > $("a").click(function () { > > alert("hi onclick"); // stuck this in there but doesn't fire. > > var avid; > > avid = $(this).attr("id"); > > avid = "#div" + avid; > > alert(avid); > > $(avid).fadeIn("slow"); > > $(avid).css({display: block}); // added this extra when fadeIn > > didn't work. > > }); > > > }); > > > Any clue why this would be happening? > > > Thanks, > > Pat.
[jQuery] Re: cross-domain ajax question
Have you tried an iframe? On Aug 13, 11:27 am, adam wrote: > I'm working in a large corporate intranet and used jQuery to build a > simple javascript include that developers can throw into their source > (HTML, ASP classic, ASP.NET, etc). > > Everything worked fine until I started to deploy out to the servers. > My "logging" app is on one server in the company and the other apps > are spread amongst many. For example, a web-app is running on a server > like "http://server1/AppName/"; and my javascript include is running on > "http://server2/etc/"; and calling a web service on its own server. > > What I didn't realize is that this seems to cause a security issue. IE > gives me the "The page is accessing information that is not under its > control. This poses a security risk. Do you want to continue?" > > Totally bummed out because what I had was such a simple and > lightweight solution. > > Any ideas on how to get around this? Are there any other approaches to > calling a web-service on a different server without causing this > error? > > Thanks everyone.
[jQuery] Code inside click() event not firing.
New to jQuery, I did many searches before posting. This is happening in both IE6 and Firefox 3.0.13. I've gotten the following script to work under strange circumstances (explained below first snippet). jQuery(document).ready(function(){ showHint(""); // ajax that fires onload, with no problem (but did try taking it out with same results) $("a").click(function () { alert("hi onclick"); // stuck this in there but doesn't fire either. var avid; avid = "#div" + $(this).attr("id"); alert(avid); // this won't work either. $(avid).fadeIn("slow"); $(avid).css({display: block}); // added this extra when fadeIn didn't work. }); }); When I'm able to successfully get both the alert and the rest of the script to work is when I add another alert in the ready() section. Then, the code works for the rest of the browser session (even after the 'ready ()' alert is removed). jQuery(document).ready(function(){ showHint(""); // ajax/json alert("hi on load"); // after inserting this, the below all works ** $("a").click(function () { alert("hi onclick"); // stuck this in there but doesn't fire. var avid; avid = $(this).attr("id"); avid = "#div" + avid; alert(avid); $(avid).fadeIn("slow"); $(avid).css({display: block}); // added this extra when fadeIn didn't work. }); }); Any clue why this would be happening? Thanks, Pat.
[jQuery] Animate children of element?
What I have is a simple series of divs, and in the divs I have a few items of content, here's an example: Corporate Responsibility Lorem ipsum dolor sit amet. Sit amo mortus amorte. Now I have CSS tied to the container CSS. So the h3, p, and img all look slightly different if the "in-focus" is present or not. If I run a standard: $(".in-focus").removeClass("in-focus",500); I can see it resize the container, but the contents don't change until the animate completes. Is there some way to tie the interior elements to the animation or do I need to do multiple animates to create that effect? Thanks -- Patrick
[jQuery] jQuery Ajax XML not working in IE6(most people)
Hello, I have been looking at this for a few days now and I am not having any luck. I am using jQuery 3.1.1. I don't think I have any character encoding issues, all files are in UTF-8 format. Is it possible that I left a header out when creating the XML file - like the doctype=text/xml? If so how do I make sure this is added? Well thanks for taking a look. :D MY HTML + JS --- New Products New Products Feed Hello World Target Output DIV --- MY XML --- 1N4148WS Small Signal Diode Small Signal Diode /pf/1N/1N4148WS.html /ds/1N/1N4148WS.pdf /ShoppingExperience/action/displayItems? gpn=1N4148WS&itemType=BUY /ShoppingExperience/action/displayItems? gpn=1N4148WS&itemType=SAMPLE 1N4148WS SOD-323F S Y 04/14/2008 2 1N4148WT Small Signal Diode Small Signal Diode /pf/1N/1N4148WT.html /ds/1N/1N4148WT.pdf /ShoppingExperience/action/displayItems? gpn=1N4148WT&itemType=BUY /ShoppingExperience/action/displayItems? gpn=1N4148WT&itemType=SAMPLE 1N4148WT SOD523F S Y 03/06/2008 1N4448WS Small Signal Diode Small Signal Diode /pf/1N/1N4448WS.html /ds/1N/1N4448WS.pdf /ShoppingExperience/action/displayItems? gpn=1N4448WS&itemType=BUY /ShoppingExperience/action/displayItems? gpn=1N4448WS&itemType=SAMPLE 1N4448WS SOD-323F S Y 04/14/2008 2 ---
[jQuery] Re: case insensitive :contains()
thanks a lot
[jQuery] case insensitive :contains()
Hey all, I tried various solutions to have a case insensitive :contains() on google but couldn't find one that works with jquery 1.3: http://dev.jquery.com/ticket/278 http://mkhairul.com/2008/11/26/making-jquery-selectorcontains-case-insensitive/ any suggestion? also it would be good to include this selector in the official jquery =) Thanks in advance, Pat
[jQuery] Re: Dealing with Date Comparison
There's also a jQuery plugin which already does this. Check out: http://timeago.yarp.com/ On Thu, Feb 5, 2009 at 11:36 AM, Bob O wrote: > > Thank you everyone for the responses > bjorsq your solution worked out great. Thank you for the help. > > > On Feb 4, 5:39 pm, bjorsq wrote: >> To do this in JavaScript, you need to extract the text representation of the >> date you have in the div, parse it, and set up a new JavaScript Date object >> to compare against the current date/time. If your dates are formatted like >> [day]/[month]/[year] (I'm in the UK), then this should work (but will need >> some error checking in it to cope with blank or malformed dates): >> >> $(document).ready(function() { >> var now = new Date(); >> $('td.yui-dt0-col-LastActivity div').each(function() { >> var divdate = new Date(); >> /* split the text date in the div */ >> var dateparts = $(this).text().split('/'); >> /* set the properties of the Date object >> *for US format dates [month]/[day]/[year] the array indexes for months >> and days need switching >> */ >> divdate.setDate(parseInt(dateparts[0])); >> /* months are zero indexed! */ >> divdate.setMonth((parseInt(dateparts[1])-1)); >> divdate.setYear(parseInt(dateparts[2])); >> /* compare dates - 14 days = (14*24*60*60*1000) milliseconds */ >> if (divdate.getTime() > (now.getTime() - (14*24*60*60*1000))) { >> $(this).addClass('highlight'); >> } >> }); >> >> >> >> }); >> Bob O-2 wrote: >> >> > Can any one point me in the right direction for my issue. >> >> > I have a div with a text value pulled in from a database 01/01/2009 >> >> > Im trying to write a javascript that can take that value and compare >> > it against new Date(); >> >> > $(document).ready(function() { >> > now = new Date(); >> > lastActivityDivs = $('td.yui-dt0-col-LastActivity div'); >> > lastActivityDivs.each(function() { >> >if ($(this).val() == (now < 14)) { >> >$(this).addClass('.highlight'); >> > } >> > }); >> > }); >> >> > i know this isnt correct, but it gives you an idea of what im trying >> > to accomplish.. >> >> > Any help would be great. >> >> > Thank you >> >> -- >> View this message in >> context:http://www.nabble.com/Dealing-with-Date-Comparison-tp21841297s27240p2... >> Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: having a problem with ' and strings
There is nothing wrong with it, but it's far from perfect. By making the switch you're no longer at risk from 's but now if the string contains any "s you'll have the same problem all over again. Ideally you'd first run a replace on the string you fetch from the other site, replacing all 's with \'s. The \ here escapes the ' and makes javascript read it as a part of the string rather than the end of it. -- Patrick On Wed, Feb 4, 2009 at 10:19 AM, Liam Potter wrote: > > Glad to of helped. > My system has worked for me so far, but I'm sure there are people who would > argue another way of doing things. > > dirk w wrote: >> >> hello liam, >> thanks for the tip, i will try using them the same way. >> you actually forgot one " in your code but now it works fine, thanks! >> >> $("#searchResultList").append(''); >> >> On 4 Feb., 15:51, Liam Potter wrote: >> >>> >>> you need to switch it around, >>> >>> replace all " to be ' and all ' to be " >>> >>> Personally, all my selectors use " >>> then functions use ' >>> >>> $("#searchResultList").append(''); >>> >>> that's how I would do this. >>> >>> dirk w wrote: >>> >>>> >>>> hello jquery community, >>>> i am getting some strings from a page i don't have influence on. i >>>> just append those to elements (thanks to jquery this works like a >>>> charm!): >>>> $("#searchResultList").append(""); >>>> my problem is: >>>> sometimes the variable "title" contains a ' in the string, like >>>> "doesn't that look funny..." in this case my output get's completely >>>> messed up. >>>> is there a more reliable way to use ' and " ? any ideas how i could >>>> prevent ' to crack this up? >>>> thanks in advance >>>> dirk >>>> >
[jQuery] Re: jqGrid 3.3 version
Hi Tony, Very nicely done - will definitely take a look at it. Is there a plan to add filtering too? For example, I do a search which returns 3000 records (say split over GroupA,GroupB,GroupC etc). Now, if I want to filter on just GroupA (say 500 records) and then return just that info in the grid is that possible? Obviously it would require some sneaky server side Ajax to do too - but it would require filtering drop downs on each column in the grid too? Great work! Thanks, Patrick On Oct 15, 11:13 am, Rey Bango <[EMAIL PROTECTED]> wrote: > Wow Tony! Just WOW! :D > > Rey... > > Tony wrote: > > Hello all, > > A new version of jqGrid is available. > > All the new features and bug fixes can be found here > >http://www.secondpersonplural.ca/jqgriddocs/index.htm > > > Be a sure to visit the demo page for the new features. > >http://trirand.com/jqgrid/jqgrid.html > > > The jqGrid home page is here > >http://trirand.com/blog/ > > > Enjoy > > Tony
[jQuery] Re: Append Node to XmlDocument
Of course, this works just fine using the built-in methods of XmlDocument (appendChild, createElement). I am just mildly surprised this does not work with the JQuery methods. On Fri, Aug 29, 2008 at 8:37 PM, Patrick Burrows <[EMAIL PROTECTED]> wrote: > At this point I've tried every combination of .after I could think of. I > think, at this point, this is simply not possible using JQuery. > > On Fri, Aug 29, 2008 at 7:50 PM, Patrick <[EMAIL PROTECTED]> wrote: > >> >> Is anyone aware of a simple example which appends a node to an >> existing XmlDocument? >> >> I am successfully able to update an XmlDocument using the attr() >> method. So: >> >> $(xmlElement).attr("Name","new name"); >> >> I am even able to create new attributes using this method. >> >> What I would like to be able to do now is create a new child element >> of that same xmlElement. I have tried using the after() and >> insertAfter() methods: >> >> $(xmlElement).after(""); >> >> but this does not update the main XmlDocument. I can tell this by >> using FireBug's dirxml() output display. So if I do: >> >> console.dirxml(myXmlDoc); >> $(xmlElement).after(""); >> console.dirxml(myXmlDoc); >> >> the outputs are exactly the same. >> >> Can anyone shed some light on this issue? Thanks. >> > > > > -- > -- > Patrick Burrows > http://www.CleverHumans.com > -- -- Patrick Burrows http://www.CleverHumans.com
[jQuery] Re: Append Node to XmlDocument
At this point I've tried every combination of .after I could think of. I think, at this point, this is simply not possible using JQuery. On Fri, Aug 29, 2008 at 7:50 PM, Patrick <[EMAIL PROTECTED]> wrote: > > Is anyone aware of a simple example which appends a node to an > existing XmlDocument? > > I am successfully able to update an XmlDocument using the attr() > method. So: > > $(xmlElement).attr("Name","new name"); > > I am even able to create new attributes using this method. > > What I would like to be able to do now is create a new child element > of that same xmlElement. I have tried using the after() and > insertAfter() methods: > > $(xmlElement).after(""); > > but this does not update the main XmlDocument. I can tell this by > using FireBug's dirxml() output display. So if I do: > > console.dirxml(myXmlDoc); > $(xmlElement).after(""); > console.dirxml(myXmlDoc); > > the outputs are exactly the same. > > Can anyone shed some light on this issue? Thanks. > -- -- Patrick Burrows http://www.CleverHumans.com
[jQuery] Re: ajax?
It looks to me like you forgot to write any JavaScript to do all the actions you described below. On Fri, Aug 29, 2008 at 7:21 PM, fear and wonder <[EMAIL PROTECTED]>wrote: > > what i'm trying to do is have a login form on my site, it looks like > this right now... > > Email: > > Password: > > > > > then when you click submit it uses ajax to load the login page that > checks if you entered the right email and password. if you didn't, it > would show the login form again. but if you try to login again, > nothing happens. why is this not working?? > -- -- Patrick Burrows http://www.CleverHumans.com
[jQuery] Append Node to XmlDocument
Is anyone aware of a simple example which appends a node to an existing XmlDocument? I am successfully able to update an XmlDocument using the attr() method. So: $(xmlElement).attr("Name","new name"); I am even able to create new attributes using this method. What I would like to be able to do now is create a new child element of that same xmlElement. I have tried using the after() and insertAfter() methods: $(xmlElement).after(""); but this does not update the main XmlDocument. I can tell this by using FireBug's dirxml() output display. So if I do: console.dirxml(myXmlDoc); $(xmlElement).after(""); console.dirxml(myXmlDoc); the outputs are exactly the same. Can anyone shed some light on this issue? Thanks.
[jQuery] Re: AJAX Difference between IIS and Apache?
Hi Bill, Ah I think I have it now? In both examples above the Type of the $.ajax is set to POST... so it is *not* a GET request... however, in the string above I didn't have spaces - so it failed - when the Object in the second example was sent (which worked correctly) - obviously the spaces were correctly encoded... So when you pass params to a $.ajax and you don't URLEncode them into the QueryString then the spaces will be stripped... Better to pass as an object (which I now am!) But it's still strange that when the data is passed as a String with spaces that it works on APACHE & PHP.. very odd. On Jun 24, 3:18 pm, Bil Corry <[EMAIL PROTECTED]> wrote: > patrick davey wrote on 6/23/2008 5:52 PM: > > > data: 'requestID=350&elementID=' + > > 'ajax' + '&update_value=1 2 3 4 5', > > Spaces are not valid in a GET request. The above should be: > > data: 'requestID=350&elementID=' + > 'ajax' + '&update_value=1%202%203%204%205', > > - Bil
[jQuery] AJAX Difference between IIS and Apache?
Ok... this makes *no sense* (to me!) but then hopefully someone out there will have an answer. I have been using the Edit In Place from http://davehauenstein.com/blog/ to update some form fields using AJAX. All was going well until I noticed that spaces were being removed (e.g. 'Bob Jones' would become 'BobJones') The strange thing is that I ran this on an XAMPP server and it worked fine (spaces were retained) but when I ran it on my IIS server - the spaces were removed. The difference is in the data line: snippit which doesn't work $.ajax({ url: "results.asp", type: "POST", data: 'requestID=350&elementID=' + 'ajax' + '&update_value=1 2 3 4 5', end of snippit --does work (on both IIS and APACHE ) -- $.ajax({ url: "results.php", type: "POST", data: { requestID: "350", element_id: "firstname",update_value:" 1 2 3 4 5 " }, --- end of snippet--- Seems like the top one must be URL Encoded - but not done in a way IIS can interpret? Anyway - looks like I will be passing a map or using a new Edit In Place (any suggestions). You can see the code working on APACHE at http://www.snowpool.org.nz/test/test.htm - I cannot link to the ASP code... however the HTML file is basically identical - and both results pages just print out the contents of the form.. Any ideas? :) Thanks! Patrick
[jQuery] Re: .get(0) fails in 1.2.5
On Wed, May 21, 2008 at 1:53 PM, jstrebel <[EMAIL PROTECTED]> wrote: > When using jquery 1.2.1 ... Have you tried 1.2.3? Does it to work if you replace that line with a direct DOM call? var task = document.getElementById("task_"+checklist_id+"_"+task_id) Patrick -- Patrick McElhaney 704.560.9117
[jQuery] Re: TableSorter + Filtering + Ajax
Hi Kevin, That looks like a really excellent plugin - might have to give it a try. The one thing it doesn't do that I need it to - is *filtering*. That is, say I am returning rows and one of the columns is a city - and there may be multiple rows with the same city data. I want to be able to choose 'Dublin' and then only have rows which have dublin as a city returned. And then... I want to be able to continue sorting and paging through my ajax'd data! Fun eh ;) When I get something working I'll try to post it up somewhere... as long as I can make it readable etc! Thanks, Patrick On May 6, 9:47 pm, Kevin Kietel <[EMAIL PROTECTED]> wrote: > Try Flexigrid! > > http://webplicity.net/flexigrid/ > > This jQuery plugin is a Lightweight but rich data grid with resizable > columns and a scrolling data to match the headers, plus an ability to > connect to an json/xml based data source using Ajax to load the > content. > > If you need any help implementing it, just contact me or take a look > at the Flexigrid discussion on CodeIgniter > forums:http://codeigniter.com/forums/viewthread/75326/ > There are several examples that you can use. > > Let me know if this is what you're looking for! > > Bye, > > Kevin > > On May 6, 2:18 am, patrick davey <[EMAIL PROTECTED]> wrote: > > > Hi, > > > I am using the tablesorter pluginghttp://tablesorter.com/andit > > works fine for smallish tables. However, I need to page through large > > result sets (and filter them) - so I am going to use AJAX to > > repopulate the table once the options have been selected. > > > Now, if through filtering / whetever - less than 100 rows are > > returned, then I want tablesorter to just sort the table (without > > having to make an AJAX call) > > > To do this I want to edit the tablesorter plugin to call a function > > which returns true/false depending on how many records there are to > > sort. > > > So my question (there is one!) is how do I do that with tablesorter. > > I have tried using 'sortStart' and returning false but no joy. I can > > edit the source of course - but if there is a simple way I'd love to > > know it. > > > Better still, does anyone have an example of doing filtering&sorting& > > paging of large datasets using JSON/AJAX and Jquery? :) > > > Thanks, > > Patrick
[jQuery] TableSorter + Filtering + Ajax
Hi, I am using the tablesorter pluging http://tablesorter.com/ and it works fine for smallish tables. However, I need to page through large result sets (and filter them) - so I am going to use AJAX to repopulate the table once the options have been selected. Now, if through filtering / whetever - less than 100 rows are returned, then I want tablesorter to just sort the table (without having to make an AJAX call) To do this I want to edit the tablesorter plugin to call a function which returns true/false depending on how many records there are to sort. So my question (there is one!) is how do I do that with tablesorter. I have tried using 'sortStart' and returning false but no joy. I can edit the source of course - but if there is a simple way I'd love to know it. Better still, does anyone have an example of doing filtering&sorting& paging of large datasets using JSON/AJAX and Jquery? :) Thanks, Patrick
[jQuery] Remote JSON Ajax call - error function not called
Hi, I am trying to retrieve JSON Data from a remote server and manipulate teh returned data. That all works fine - the callback is executed and it all works as expected. The issue I am running into is that I want to use timeouts and error messages also - and they are not working. I tried the following code (just demo code - not the one I am using) $.ajax({ type:"GET", url: "http://www.thisSite.com/badurl.asp";, data:"jsoncallback=?", dataType: "json", timeout: 1000, error: function(){ alert('Error loading document'); }, success: function(data){ alert(data); } }); If I run the above function I would expect the error function to be called as it would get a 404 error for the bad URL... but that *does not happen*. No function is called. If, however, you change the URL to be a local address (but still incorrect) then the error function *is* called. I'm sure I'm missing something fundamental!! But is there a way to call error functions for remote urls? And if so how! Thanks, Patrick
[jQuery] Remote JSON Ajax call - error function not called
Hi, I am trying to retrieve JSON Data from a remote server and manipulate teh returned data. That all works fine - the callback is executed and it all works as expected. The issue I am running into is that I want to use timeouts and error messages also - and they are not working. I tried the following code (just demo code - not the one I am using) $.ajax({ type:"GET", url: "http://www.thisSite.com/badurl.asp";, data:"jsoncallback=?", dataType: "json", timeout: 1000, error: function(){ alert('Error loading document'); }, success: function(data){ alert(data); } }); If I run the above function I would expect the error function to be called as it would get a 404 error for the bad URL... but that *does not happen*. No function is called. If, however, you change the URL to be a local address (but still incorrect) then the error function *is* called. I'm sure I'm missing something fundamental!! But is there a way to call error functions for remote urls? And if so how! Thanks, Patrick
[jQuery] Checkbox click event fires more than once
Hey All, I'm trying to dynamically add a list of check boxes (and an associated click event handler) to my page. Problem is, when I click on a box, the event is fired multiple times (once per checkbox on the page). I don't really understand this behaviour - the event should only fire once. I would graciously appreciate any suggestions you may have. Regards Patrick Code snippit : $(function() { $.ajax({ type: "GET", url: "./?get=Lignes", dataType: "xml", cache: false, success: function(xml){ $(xml).find("Lignes").each(function() { var line = $(this); $("#filters") .append("<input type='checkbox' value=" + line.attr("ID") + ">") .click(function() { $("#map").append("wtf??").append("<br/>"); return false; }) .append(line.attr("Nom")).append("<br/>"); }); } }); });
[jQuery] Re: Featured Content or Cnet Carousel
*bump* Here's an interesting carousel-style widget, implemented with Prototype: http://www.missingmethod.com/projects/glider.html I'm with Alex, the widget linked in the OP doesn't really seem "carouselish" to me -- the missingmethod example does. Most importantly, imho, it allows arbitrary HTML. I can't think of a way to get that "wipe" effect in jQuery, where two elements move together. Anyone done something like that?
[jQuery] .keyup + .html
Helloes, I have a little thingie that clones text from an input into a div: http://ruphus.com/code/jquery/clonetype/clonetype.html Seems to work fine, except when I try to backspace away the entire text in the input -- the final letter refuses to vanish from the div, even though it's not in the input. Any ideas what's going on here? jQuery(document).ready(function(){ //jQuery('#source').attr('value', 'x')); //jQuery('#clone span').html(jQuery('#source').attr('value')); jQuery('#source').keyup(function(){ var current = jQuery('#source').attr('value'); if (current){ jQuery('#clone').html('' + current + ''); } }) }); -p@
[jQuery] Re: Jquery: New app and this article
Hi John and folks, On the topic of spreading the word, what about some sort of job board on the jQuery site? Seems to me that it might be a good thing for the community -- especially if there was some option for clients to allow code that they sponsor to be released under a reusable license. Just a thought. -p@
[jQuery] Re: vertical fisheye menu? OSX dock or tsunami
On Apr 24, 1:25 pm, "Ⓙⓐⓚⓔ" <[EMAIL PROTECTED]> wrote: > you are resizing the tag. > and that ain't good. use twice as many prev's to jump over the br's Thanks Jake. I tried it without the s and it does what's expected: http://ruphus.com/code/jquery/fisheye/fishimg.html I'm glad I dug into this, because I see now that I had misunderstood .next() and .prev(). I figured that in a snippet like this: $('img').mouseover(function(){ $(this).next() } That $(this).next() would mean "the next image after the current one." But I take it it really means "the next thing in the dom after the current image, even if that next thing is not an image." Live & learn. > Ⓙⓐⓚⓔ - יעקב ʝǡǩȩ ᎫᎪᏦᎬ By the way, I love your gmail address -- Unicode++ ☺ -p@
[jQuery] Re: vertical fisheye menu? OSX dock or tsunami
On Apr 23, 7:21 pm, Sapphire <[EMAIL PROTECTED]> wrote: > Very nice. Will it work for images? Thanks =] http://ruphus.com/code/jquery/fishimg.html I'm not sure why it doesn't work the same way there; only $(this) seems to be getting resized. Paging brainiacs! Cleanup on aisle 12! -p@
[jQuery] Re: vertical fisheye menu? OSX dock or tsunami
Here's my crummy attempt: http://ruphus.com/code/jquery/fisheye.html -p@