[jQuery] Re: simple JSON parse problem!!!
uploadPicture{errors:[This file was already uploaded]} isn't valid JSON or JSONP if uploadPicture is a callback function then it needs ( ) : uploadPicture( {errors:[This file was already uploaded]} ); On Jul 1, 9:25 pm, Ricardo ricardob...@gmail.com wrote: No. JSONP provides a way to pass the JSON response directly to a callback function without the need for eval(), independent of what you're doing with it. It was conceived to allow cross-domain use of JSON, 'cause you don't get the response from XHR but from an appended script tag. Think of it like this: // in your .JS file script function shake(data){ alert( data.stuff );}; /script // now you callwww.jsonp.com/get?format=jsoncallback=shake, and you get this string back: shake({ stuff: [1,2,3] }); What happens here, is that there is *no* ajax involved. It all happens as if you simply put this into your document: script type=text/javascript src=http://www.jsonp.com/get? format=jsoncallback=shake/script The response text is a new script that contains the data in the function (which must be defined before that) call. Well, this is already far off from your question, it depends on what's running server-side etc. Maybe if you could mention which plugin you're using or provide a test page this could be solved easily. cheers -- ricardo On Jul 1, 4:12 pm, Rick Faircloth r...@whitestonemedia.com wrote: So...am I to understand that jsonp provides a method by which an image can be uploaded after submission of a form as part of a callback function? I've done some research on jsonp, but still am not clear about it. Rick On Wed, Jul 1, 2009 at 1:03 PM, Ricardo ricardob...@gmail.com wrote: that is called jsonp. You need to define a function named uploadPicture that will get called when the response arrives. jQuery handles that for you if you use the proper method (assuming the callback name can be set in the request): $.getJSON('uploadpicture.php?callback=?, {some:'data'}, function(data) { alert(data.errors[0]); }); http://docs.jquery.com/Ajax/jQuery.getJSON#urldatacallback On Jul 1, 10:16 am, theozmanbo b.k.osbo...@hotmail.com wrote: Is it because of the uploadPicture part? Why isn't it valid? Sorry for all these stupid questions. -- View this message in context: http://www.nabble.com/simple-JSON-parse-problem%21%21%21-tp24283450s2... Sent from the jQuery General Discussion mailing list archive at Nabble.com. -- --- --- Ninety percent of the politicians give the other ten percent a bad reputation. Henry Kissinger
[jQuery] Re: Validate first and the carry on
Take a look at the ajaxSubmit demo: http://jquery.bassistance.de/validate/demo/ajaxSubmit-intergration-demo.html Instead of binding your own submit handler (which the plugin already does), use the submitHandler-option. Jörn On Thu, Jul 2, 2009 at 3:54 AM, James Wproje...@jingsoftware.com wrote: I am using some jquery code to validate a form and then post the results of the form via an ajax request to a script. I am struggling with the code as when I click submit the form validates but then also makes the ajax request. What I would like to be able to do is validate the form and then if the form checks out ok then I would like the other code to run. I am using the plug in http://dev.jquery.com/view/trunk/plugins/validate/jquery.validate.js I am new to jquery, I understand the validation how how to validate a form using the plug in, and I am comfortable with the ajax request and how to show and hide layers. I am in the tricky place where I cant get the two to work together! script language=javascript $(document).ready(function() { $(#login_form).validate({ rules: { namea: required, town: required, emaila: { required: true, email: true } } }); $(#login_form).submit(function() { $.post(login.php,{ name:$('#namea').val(),password:$ ('#password').val(),rand:Math.random() } ,function(data) { if(data=='OK') { $('#loginbox').hide(); $('#ajax_failed').hide(); $('#ajax_show').show(); $('#RegisterForm').show(); } else { $('#name').val(); $('#ajax_failed').show(); } }); return false; }); $(#password).blur(function() { $(#login_form).trigger('submit'); }); }); /script If anyone could point me in the right direction or show me how to achieve this I would be most grateful. JW
[jQuery] Superfish menu: IE 7 problem
Please have a look a main menu at this demo. http://www.okadadesign.no/vitaveritas/ Om oss and Medieomtale have sub menus. The submenu works fine with FF, IE8 etc. But it fails with IE7. I have to use sprites background images and the second level sub menu have to be positioned at a certian place. When I hover top of sub menu, it is ok. But the below of that sub menu, such as Radio, Artikler, Hvem er vi?, I am not able to select in IE7. Can anyone help me please? Thanks in advance.
[jQuery] unsubscribe
unsubscribe
[jQuery] Re: ui.jquery.com down?
Sorry that you found it down for a time. I would highly recommend pointing your sites at google's CDN instead: http://code.google.com/apis/ajaxlibs/documentation/index.html#jqueryUI http://rdworth.org/blog/2008/08/jquery-ui-now-in-googles-ajax-libraries-api/ - Richard On Wed, Jul 1, 2009 at 9:44 AM, Vorge s...@kinocreative.co.uk wrote: Is the UI section of the site down? I have a few websites that link to it and they're all taking forever to load, seemingly hanging when waiting for ui.jquery.com... This is the first time I've seen this and am wondering if anyone else is aware of the problem. Thanks, Vorge
[jQuery] Re: ui.jquery.com down?
Vorge wrote: Is the UI section of the site down? I have a few websites that link to it and they're all taking forever to load, seemingly hanging when waiting for ui.jquery.com... This is the first time I've seen this and am wondering if anyone else is aware of the problem. Thanks, Vorge This is on of the reasons why loading scripts from an external server is usually a bad idea. Jonathan -- Jonathan Vanherpe - Tallieu Tallieu NV - jonat...@tnt.be
[jQuery] Re: reload an SWF object from jquery
Hi again I have created a demo of the described problem. Please find it here : http://msc2svg.googlepages.com/index.html The source code can be downloaded as zip form here :http:// msc2svg.googlepages.com/demo.zip The demo javascript code is written in index.html On Jul 1, 6:11 pm, Liam Byrne l...@onsight.ie wrote: Any chance that there are 2 items with id / name reportChart ? L pacodelucia wrote: Hi The code I have written in my post was some how pseuodo code. That is the reason why it contains so much typing errors. Sorry for that Here is the code directly copied from my js file: document.getElementById('reportChart').reload(charts/ pie_chart.php); //works $(#reportChart).reload(charts/ pie_chart.php); // does not work I am using firefox 3.5 On Jul 1, 5:03 pm, Liam Byrne l...@onsight.ie wrote: Is there an error / typo in the URL being requested ? Should it be charts/gen_*e*_rate_chart.php ? L pacodelucia wrote: sorry for the type error. I meant really that $(#reportChart).reload(charts/genrate_chart.php); does not work with the # selector. On Jul 1, 3:51 pm, Olaf Bosch olaf.bo...@t-online.de wrote: pacodelucia schrieb: Apparently $(reportChart) is not returning really an SWF object. Anyone has an idea if this possible with jquery? This is not a correct Selectot for ID, try so: //access via jquery $(#reportChart).reload(charts/genrate_chart.php); // does not work # for ID, . for CLASS -- Viele Grüße, Olaf --- olaf.bo...@t-online.dehttp://olaf-bosch.de/http://ohorn.info/http://www.akitafreund.de/ --- No virus found in this incoming message. Checked by AVG -www.avg.com Version: 8.5.375 / Virus Database: 270.13.1/2212 - Release Date: 07/01/09 05:53:00 No virus found in this incoming message. Checked by AVG -www.avg.com Version: 8.5.375 / Virus Database: 270.13.1/2212 - Release Date: 07/01/09 05:53:00
[jQuery] Re: unsubscribe
unsubscribe On Thu, Jul 2, 2009 at 1:16 PM, Johan jo...@sjoland.com wrote:
[jQuery] Add / Remove Element dynamically
Hi all, How i Add/Remove element dynamically using jquery , i want to Add/remove not more then 8 element (ie Textbox) Thanks bharanikumar
[jQuery] Newbie question
Hello. I am trying to do something like this $(element1 || element2).click(function(){}) unfortunately this does not work, both element1 and element2 work independently but not together and i have no clue how to get them to work together. Basically what i need that either when element1 is clicked, OR element2 is clicked, do identical thing. I know this is a very simple issue, but i havent learned Javascript at all, i've started with jQuery. Thank you
[jQuery] Bubble Issue with the browser
Hi I am having problem with the coda bubble window.. please check the urls: InternetExplorer view: http://img133.imageshack.us/img133/7538/83905753.jpg Mozilla View: http://img29.imageshack.us/img29/1955/mozillan.jpg *Code:* !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd; html xmlns=http://www.w3.org/1999/xhtml; xml:lang=en lang=en head meta http-equiv=Content-type content=text/html; charset=utf-8 / titleCoda Bubble Example/title style type=text/css media=screen !-- * { margin: 0; padding: 0; } a*{ font-size: 12px; line-height: 1.2em; background-color: #fff; color: #666; font-family: Arial; } body { padding: 10px; } h1 { margin: 14px 0; font-family: 'Trebuchet MS', Helvetica; } p { margin: 14px 0; font-family: 'Trebuchet MS', Helvetica; } .bubbleInfo { position: relative; top: 50px; left: 50px; width: 500px; } .trigger { position: relative; } /*.selectedRow { border: 1px solid #FF; background-color: #F0F0F0; cursor: pointer; } */ /* Bubble pop-up */ .popup { background-color: #CC; position: absolute; display: none; z-index: 250; border-collapse: collapse; } .popup td.corner { height: 15px; width: 19px; } .popup td#topleft { background-image: url(bubble-1.png); } .popup td.top { background-image: url(bubble-2.png); } .popup td#topright { background-image: url(bubble-3.png); } .popup td.left { background-image: url(bubble-4.png); } .popup td.right { background-image: url(bubble-5.png); } .popup td#bottomleft { background-image: url(bubble-6.png); } .popup td.bottom { background-image: url(bubble-7.png); text-align: center;} .popup td.bottom img { display: block; margin: 0 auto; } .popup td#bottomright { background-image: url(bubble-8.png); } .popup table.popup-contents { font-size: 12px; line-height: 1.2em; background-color: #CC; color: #666; font-family: Arial; } table.popup-contents th { text-align: right; text-transform: lowercase; } table.popup-contents td { text-align: left; } tr#release-notes th { text-align: left; text-indent: -px; background: url(starburst.gif) no-repeat top right; height: 50px; } tr#release-notes td a { color: #333; } -- /style script src=javascript/jquery.js type=text/javascript/script script type=text/javascript src=javascript/thickbox.js/script link rel=stylesheet href=thickbox.css type=text/css media=screen / script type=text/javascript !-- /*$(function() { $('div').mouseover(function() { $(this).addClass('selectedRow'); }).mouseout(function() { $(this).removeClass('selectedRow'); }); });*/ $(function () { $('.bubbleInfo').each(function () { var distance = 10; var time = 250; var hideDelay = 100; var hideDelayTimer = null; var beingShown = false; var shown = false; var trigger = $('.trigger', this); var info = $('.popup', this).css('opacity', 0); $([trigger.get(0), info.get(0)]).mouseover(function () { if (hideDelayTimer) clearTimeout(hideDelayTimer); if (beingShown || shown) { // don't trigger the animation again return; } else { // reset position of info box beingShown = true; info.css({ top: 150, left: 140, display: 'block' }).animate({ top: '-=' + distance + 'px', opacity: 1 }, time, 'swing', function() { beingShown = false; shown = true; }); } return false; }).mouseout(function () { if (hideDelayTimer) clearTimeout(hideDelayTimer); hideDelayTimer = setTimeout(function () {
[jQuery] Re: getScript does not always work for me
Thanks for the help. Turns out my problem is completely unrelated - some of the code I was executing in response to the request was hanging the browser! So I wasn't seeing any of my log output. I'm starting a new thread on it, as it is to do with quoting inside jquery selectors. On 29 June, 04:02, e.a. ger.bot...@gmail.com wrote: BTW, it is working. Here is the output ofhttp://jsbin.com/umuwi: Hello from JS Bin www.trumphurst.com ready sent request got reply href received On Jun 26, 1:45 pm,NikkiLockeni...@trumphurst.com wrote: Further to this, my real application is hanging the browser, and I don't know how to find out what is wrong :-( I have tried it with IE8, Firefox, Safari and Chrome - the browser always hangs at some point. Any suggestions what to try next would be very gratefully received. On 25 June, 20:57,NikkiLockeni...@trumphurst.com wrote: I am building a web app that is controlled from a server. I want the server to send objects to the app, which the app then processes. I am using getScript for this, but it doesn't seem to be working for me. I have example code at //jsbin.com/umuwi This code calls getScript on the url ://jsbin.com/utake - this returns the following text: _jq_action={type:href}; I call getScript as follows: var _jq_action; $(document).ready(function(){ _jq_getaction(); }); function _jq_getaction() { try { _jq_action = null; $.getScript(http://jsbin.com/utake;, _jq_processaction); _jq_log(sent request); } catch(e) { alert(e); } } function _jq_processaction() { try { _jq_log(got reply); if(_jq_action) { _jq_log(_jq_action.type + received); } else { _jq_log(no action); } } catch(e) { alert(e); } } _jq_log is a function which merely outputs messages to the screen, so I can see what is going on. The request gets sent, but _jq_action is always null. NikkiLocke- Hide quoted text - - Show quoted text -
[jQuery] Re: simple JSON parse problem!!!
missed that! On Jul 2, 4:48 am, mkmanning michaell...@gmail.com wrote: uploadPicture{errors:[This file was already uploaded]} isn't valid JSON or JSONP if uploadPicture is a callback function then it needs ( ) : uploadPicture( {errors:[This file was already uploaded]} ); On Jul 1, 9:25 pm, Ricardo ricardob...@gmail.com wrote: No. JSONP provides a way to pass the JSON response directly to a callback function without the need for eval(), independent of what you're doing with it. It was conceived to allow cross-domain use of JSON, 'cause you don't get the response from XHR but from an appended script tag. Think of it like this: // in your .JS file script function shake(data){ alert( data.stuff );}; /script // now you callwww.jsonp.com/get?format=jsoncallback=shake, and you get this string back: shake({ stuff: [1,2,3] }); What happens here, is that there is *no* ajax involved. It all happens as if you simply put this into your document: script type=text/javascript src=http://www.jsonp.com/get? format=jsoncallback=shake/script The response text is a new script that contains the data in the function (which must be defined before that) call. Well, this is already far off from your question, it depends on what's running server-side etc. Maybe if you could mention which plugin you're using or provide a test page this could be solved easily. cheers -- ricardo On Jul 1, 4:12 pm, Rick Faircloth r...@whitestonemedia.com wrote: So...am I to understand that jsonp provides a method by which an image can be uploaded after submission of a form as part of a callback function? I've done some research on jsonp, but still am not clear about it. Rick On Wed, Jul 1, 2009 at 1:03 PM, Ricardo ricardob...@gmail.com wrote: that is called jsonp. You need to define a function named uploadPicture that will get called when the response arrives. jQuery handles that for you if you use the proper method (assuming the callback name can be set in the request): $.getJSON('uploadpicture.php?callback=?, {some:'data'}, function(data) { alert(data.errors[0]); }); http://docs.jquery.com/Ajax/jQuery.getJSON#urldatacallback On Jul 1, 10:16 am, theozmanbo b.k.osbo...@hotmail.com wrote: Is it because of the uploadPicture part? Why isn't it valid? Sorry for all these stupid questions. -- View this message in context: http://www.nabble.com/simple-JSON-parse-problem%21%21%21-tp24283450s2... Sent from the jQuery General Discussion mailing list archive at Nabble.com. -- --- --- Ninety percent of the politicians give the other ten percent a bad reputation. Henry Kissinger
[jQuery] Re: Superfish menu: IE 7 problem
this is unusual situation where your design forces sub menu to appear in same position of top menu level the problem is definitely a z-index situation whereby in IE7 your main is higher than subs, that's why you can hover the first sub element but 2nd , 3rd etc the next main element is taking over try working with z-index to give sub menu a higher index than main . also good idea to validate page http://validator.w3.org/check?verbose=1uri=http%3A%2F%2Fwww.okadadesign.no%2Fvitaveritas%2F shinokada wrote: Please have a look a main menu at this demo. http://www.okadadesign.no/vitaveritas/ Om oss and Medieomtale have sub menus. The submenu works fine with FF, IE8 etc. But it fails with IE7. I have to use sprites background images and the second level sub menu have to be positioned at a certian place. When I hover top of sub menu, it is ok. But the below of that sub menu, such as Radio, Artikler, Hvem er vi?, I am not able to select in IE7. Can anyone help me please? Thanks in advance.
[jQuery] Re: Add / Remove Element dynamically
remove() append() bharani kumar wrote: Hi all, How i Add/Remove element dynamically using jquery , i want to Add/remove not more then 8 element (ie Textbox) Thanks bharanikumar
[jQuery] Finding/selecting items identified by an attribute whose value contains quote characters
I am writing a test harness for a web app using jquery. When recording a test, I add handlers for user interaction events (e.g. click on an A tag), and record details of the tag clicked. When playing back, I need to find the tag (so I can emulate a click on it). The A tags do not have id elements - the only unique way to identify then is to use the href. However, I have hrefs containing quote characters [typical hrefs include javascript:Go('fred') and even javascript:Go(\jimmy's \)]. How do I construct a jquery selector to match these? My first attempt (before I noticed the presence of the quotes) was $(A[href=' + href + ']) Interestingly, this hung the browser completely for many minutes!
[jQuery] Re: Newbie question
http://docs.jquery.com/Selectors look at the last item in "Basics" , "Selector1,Selector2" and click on it to see the example getting familiar with the jquery website categories of "selectors, traversing, manipulation etc " is probably the #1 best tool for learning jquery. Alexandru Adrian Dinulescu wrote: Hello. I am trying to do something like this $(element1 || element2).click(function(){}) unfortunately this does not work, both element1 and element2 work independently but not together and i have no clue how to get them to work together. Basically what i need that either when element1 is clicked, OR element2 is clicked, do identical thing. I know this is a very simple issue, but i havent learned _javascript_ at all, i've started with jQuery. Thank you
[jQuery] Re: ui.jquery.com down?
Hi chaps, Thanks for pointing out the Google alterntaive - we switched to a local URL after this, but it's the first time in months that I've seen the UI site drop. On Jul 2, 9:40 am, Jonathan Vanherpe (T T NV) jonat...@tnt.be wrote: Vorge wrote: Is the UI section of the site down? I have a few websites that link to it and they're all taking forever to load, seemingly hanging when waiting for ui.jquery.com... This is the first time I've seen this and am wondering if anyone else is aware of the problem. Thanks, Vorge This is on of the reasons why loading scripts from an external server is usually a bad idea. Jonathan -- Jonathan Vanherpe - Tallieu Tallieu NV - jonat...@tnt.be
[jQuery] JCarousel - how toenable / disable next button manually
I've got a major wall with this plug-in. You have to specify a size that is than the # of images that are currently viewable to get the next button to be enabled. That mucks up my entire logic when trying to look up in a javascript array and paint a new set of pictures every time you move next in the caoursel. http://sorgalla.com/projects/jcarousel/ So I figured hey, maybe I can specify x images that does not go over what is shown. So if I pass 3 images, it will show 3 and not have to specify a size of 4 just to get the next button to be enabled. The only way I can see to do this (possibly, but I'm not sure yet if this will work) is to use the buttonNextCallback and somehow I guess in my buttonNextCallback method that I assign it to, to do some logic and enable or disable it. Problem is I have not a clue how to use it! There is absolutely no documentation on how to set it and then what the syntax would be to enable or disable the button. And to make matters worse, the author has dropped off the face of the earth. So if anyone can shed some light on how I can control this next button, you will save me from probably days more of work and I've already spent a week on this! I am about to go luda. Also, can someone tell me how the heck he's getting the next button to show enabled? because in mine, if I specify a length over what's shown and I click next, I get either empty frames or I get one picture or two pictures in the next set when you click next. His doesn't do that. He gets a nice new set of 3 each time and his next button is enabled: http://sorgalla.com/projects/jcarousel/examples/dynamic_flickr_api.html
[jQuery] Re: Superfish menu: IE 7 problem
I added z-index in different ways, but I am not able to find solution. I checked the validation, but nothing related to the issue. Help please??
[jQuery] Re: Newbie question
Hello. Damn i'm so silly, i looked over the website and i totally didnt see that. Thanks a lot for pointing it Best Regards On Thu, Jul 2, 2009 at 2:17 PM, Charlie charlie...@gmail.com wrote: http://docs.jquery.com/Selectors look at the last item in Basics , Selector1,Selector2 and click on it to see the example getting familiar with the jquery website categories of selectors, traversing, manipulation etc is probably the #1 best tool for learning jquery. Alexandru Adrian Dinulescu wrote: Hello. I am trying to do something like this $(element1 || element2).click(function(){}) unfortunately this does not work, both element1 and element2 work independently but not together and i have no clue how to get them to work together. Basically what i need that either when element1 is clicked, OR element2 is clicked, do identical thing. I know this is a very simple issue, but i havent learned Javascript at all, i've started with jQuery. Thank you
[jQuery] jQuery ajaxSubmit(), how to send the form in a json format?
Hi guys, i just leanerd the existence of the ajaxSubmit jQuery plugin, im wondering if there is a way to use the JSON both to send and retrieve the requests. I mean, no the plugin have the option 'dataType', that is used to specify the format that the server will send back, but i need to send the form as jquery to the server. For example, if my form looks like: form name=mytest action=mypage.php method=get input type=text name=firstone id=firstone value=here some text! / input type=text name=secondone id=secondone value=text in here too / /form i'll love that the plugin will send a request like: mypage.php?mytest=[{'firstone':'here some text!','secondone':'text in here too'}] Is it possible?
[jQuery] Re: simple JSON parse problem!!!
Thanks everyone. as it turns out it was that stupid uploadPictures thing. That happened because in the php script I was echo'ing it to test something and forgot to remove it. Once it was there and I was testing JSON I guess it looked natural to me and I didn't notice that it was wrong? I simply removed it. Thanks -- View this message in context: http://www.nabble.com/simple-JSON-parse-problem%21%21%21-tp24283450s27240p24305981.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: Add / Remove Element dynamically
what about that count calculation , Thanks On Thu, Jul 2, 2009 at 4:36 PM, Charlie charlie...@gmail.com wrote: remove() append() bharani kumar wrote: Hi all, How i Add/Remove element dynamically using jquery , i want to Add/remove not more then 8 element (ie Textbox) Thanks bharanikumar -- Regards B.S.Bharanikumar http://php-mysql-jquery.blogspot.com/
[jQuery] jQuery selector performance / jQuery Tester
Hi, I just tested all my jQuery selectors using the jQuery Tester (http:// jquery.nodnod.net), and the results seem to contradict one thing I read in a performance article: that you should descend from the closest parent ID when using classes in your selector (the article says April 09, so the latest jQuery version was already available). In my tests, using just the class selector (like span.myClass) was always fastest (sometimes twice as fast as #myDiv span.myClass), and this in all browsers I tested, not just the ones supporting getElementsByClassName. Maybe descending from the closest parent ID becomes a factor when you have a lot of elements on you page? Any experiences? Thanks
[jQuery] Re: Superfish menu: IE 7 problem
i am not an expert at sorting out z-index but would try something like .sf-menu {z-index :10} .sf-menu li:hover ul,.sf-menu li.sfHover ul {z-index :100} As far as validation, smart thing in my mind is to make the page valid, not to pick and choose what you think might or might not help shinokada wrote: I added z-index in different ways, but I am not able to find solution. I checked the validation, but nothing related to the issue. Help please??
[jQuery] Re: jQuery with HTML radio button forms
Can you try the change event instead of click? Bharat
[jQuery] Unique url and browser back button in an ajaxified page.
Hi, Does jQuery provides any feature or plugin to handle unique url and browser back button in an ajaxified page. thanks in advance. -- Regards, Amit Kr. Sharma
[jQuery] Re: Add / Remove Element dynamically
How is anyone supposed to understand what it is you are wanting to do with a 5 word question. Try going to jquery.com and type in C-O-U-N-T in search box. Constantly asking for help several times a week, and expecting others to spend far more time creating their replies than you put into your questions is completely unfair on your part! So far in this thread there are snippets of a concept "dynamic"-"add/remove"-"count"-"textbox" Mountains of code could be written from that snippet, chances are most of it wouldn't apply to what you want. You need to help others help you. bharani kumar wrote: what about that count calculation , Thanks On Thu, Jul 2, 2009 at 4:36 PM, Charlie charlie...@gmail.com wrote: remove() append() bharani kumar wrote: Hi all, How i Add/Remove element dynamically using jquery , i want to Add/remove not more then 8 element (ie Textbox) Thanks bharanikumar -- Regards B.S.Bharanikumar http://php-mysql-jquery.blogspot.com/
[jQuery] Re: Unique url and browser back button in an ajaxified page.
Hi, try these: http://stilbuero.de/jquery/history/ http://www.asual.com/jquery/address/ http://www.overset.com/2008/06/18/jquery-history-plugin/ http://www.mikage.to/jquery/jquery_history.html http://www.c-sharpcorner.com/Blogs/BlogDetail.aspx?BlogId=1210 Cheers On 2 Jul., 15:19, Amit amit.mca...@gmail.com wrote: Hi, Does jQuery provides any feature or plugin to handle unique url and browser back button in an ajaxified page. thanks in advance.-- Regards, Amit Kr. Sharma
[jQuery] Re: Add / Remove Element dynamically
ok ok ..sure On Thu, Jul 2, 2009 at 6:48 PM, Charlie charlie...@gmail.com wrote: How is anyone supposed to understand what it is you are wanting to do with a 5 word question. Try going to jquery.com and type in C-O-U-N-T in search box. Constantly asking for help *several times a week*, and expecting others to spend far more time creating their replies than you put into your questions is completely unfair on your part! So far in this thread there are snippets of a concept * dynamic-add/remove-count-textbox *Mountains of code could be written from that snippet, chances are most of it wouldn't apply to what you want. You need to help others help you. bharani kumar wrote: what about that count calculation , Thanks On Thu, Jul 2, 2009 at 4:36 PM, Charlie charlie...@gmail.com wrote: remove() append() bharani kumar wrote: Hi all, How i Add/Remove element dynamically using jquery , i want to Add/remove not more then 8 element (ie Textbox) Thanks bharanikumar -- Regards B.S.Bharanikumar http://php-mysql-jquery.blogspot.com/ -- Regards B.S.Bharanikumar http://php-mysql-jquery.blogspot.com/
[jQuery] Replace div with another div
I'm trying to figure out how I'd explicitely change out a div. Lets say this div is in the page. I guess first I'd have to verify if it's in the page: div class=jcarousel-prev jcarousel-prev-horizontal jcarousel-prev- disabled jcarousel-prev-disabled-horizontal style=display: block; disabled=true/ And if it is, I want to remove it and add this in the same place: div class=jcarousel-prev jcarousel-prev-horizontal style=display: block; disabled=false/ I have not a clue how to do this.
[jQuery] Firefox, Opera.. GOOOD!.... IE... Chrome... BAAD. Initiating a download from a listbox.
hi I have a php script that initiates a download. This occurs when I file is selected from a drop down box and the js/jquery redirects them. Is there a reason this works perfectly in FF and Opera and has no response in Chrome/IE ? I tested the download code to execute when the page is loaded rather than when its selected from the box and it works fine, so I;m guessing its a problem with the js. Suggestions?
[jQuery] Re: JCarousel - how toenable / disable next button manually
so I tried this and added this to my mycarousel_itemLoadCallback function (I looked at the JCarousel source code and thought maybe this would work): this.buttonNext[0].jcarouselstate = 'enabled'; it seemed to enable it, but then my fing pictures did not render! I'm about to lose it. Anyone have any time to maybe try to help me out here. I'm looking at this documentation and wondering how the hell people are even manipulating this plug-in at all. For example look at these guys, they manipulated the hell out of the Carousel and I have no idea how the heck they even figure out how to use the functions or where they are getting all these nifty functions. I assume half of it is just using the jQuery library selectors on an object but still: http://usejquery.com/sites/296 On Jul 2, 6:31 am, expresso dschin...@gmail.com wrote: I've got a major wall with this plug-in. You have to specify a size that is than the # of images that are currently viewable to get the next button to be enabled. That mucks up my entire logic when trying to look up in a javascript array and paint a new set of pictures every time you move next in the caoursel. http://sorgalla.com/projects/jcarousel/ So I figured hey, maybe I can specify x images that does not go over what is shown. So if I pass 3 images, it will show 3 and not have to specify a size of 4 just to get the next button to be enabled. The only way I can see to do this (possibly, but I'm not sure yet if this will work) is to use the buttonNextCallback and somehow I guess in my buttonNextCallback method that I assign it to, to do some logic and enable or disable it. Problem is I have not a clue how to use it! There is absolutely no documentation on how to set it and then what the syntax would be to enable or disable the button. And to make matters worse, the author has dropped off the face of the earth. So if anyone can shed some light on how I can control this next button, you will save me from probably days more of work and I've already spent a week on this! I am about to go luda. Also, can someone tell me how the heck he's getting the next button to show enabled? because in mine, if I specify a length over what's shown and I click next, I get either empty frames or I get one picture or two pictures in the next set when you click next. His doesn't do that. He gets a nice new set of 3 each time and his next button is enabled: http://sorgalla.com/projects/jcarousel/examples/dynamic_flickr_api.html
[jQuery] Re: Replace div with another div
expresso ha scritto: I'm trying to figure out how I'd explicitely change out a div. Lets say this div is in the page. I guess first I'd have to verify if it's in the page: div class=jcarousel-prev jcarousel-prev-horizontal jcarousel-prev- disabled jcarousel-prev-disabled-horizontal style=display: block; disabled=true/ And if it is, I want to remove it and add this in the same place: div class=jcarousel-prev jcarousel-prev-horizontal style=display: block; disabled=false/ I have not a clue how to do this. If give a unique id to the div (or you have a rule to get it, for example $('#mycontainer div')); You can do: $('#id').replaceWith('divmy newmarkup!/div'); If the selector doesn't return nothing then nothing will be replaced. Bye -- gianiaz.net - web solutions via piedo, 58 - 23020 tresivio (so) - italy +39 347 7196482
[jQuery] Re: Replace div with another div
one problem you'll likely run into completely replacing that div even though the html and classes will fit in with the carousel you could have problems due to no events attached to new div from document ready Giovanni Battista Lenoci wrote: expresso ha scritto: I'm trying to figure out how I'd explicitely change out a div. Lets say this div is in the page. I guess first I'd have to verify if it's in the page: div class="jcarousel-prev jcarousel-prev-horizontal jcarousel-prev- disabled jcarousel-prev-disabled-horizontal" style="display: block;" disabled="true"/ And if it is, I want to remove it and add this in the same place: div class="jcarousel-prev jcarousel-prev-horizontal" style="display: block;" disabled="false"/ I have not a clue how to do this. If give a unique id to the div (or you have a rule to get it, for example $('#mycontainer div')); You can do: $('#id').replaceWith('divmy newmarkup!/div'); If the selector doesn't return nothing then nothing will be replaced. Bye
[jQuery] Re: TreeView Cookie Persistence Problem
Can anyone point me in the right direction with this problem? TIA On Jun 30, 1:38 pm, Keith keithhen...@gmail.com wrote: Hello, I'm having some issues using the cookie persistence, it appears that as long as the link is in the jsp directory the menu renders properly, however if the link is not in the jsp directory the cookie is set to null and when the page loads all of the trees are expanded. Any help would be greatly appreciated. Here is the abridged version of the file that I'm using, this is included on all pages of my application. div id=maina href=.Main Demo/a div id=sidetree div class=treeheadernbsp;/div div id=sidetreecontrola href=?#Collapse All/a | a href=? #Expand All/a/div ul id=tree lispanCustomer Accounts/span ul li a href=/jsp/viewflightcalcrit.jsp Flight Search/a /li %if (request.getRemoteUser() != null){% li a href=/jsp/accountselection.jspCustomer Selection/a /li %}% %if (session.getValue(customer) != null) { % li a href=/jsp/cards.jspOwner Profile/a /li li a href=/jsp/communicationnotes.jspOwner Communication/a /li %}% %if (session.getValue(customer) != null session.getValue (jetcard) != null) {% li a href=/jsp/viewflightactivity.jspView Flight Activity/a /li %}% %if ((request.isUserInRole(OwnerServices) || request.isUserInRole(Finance))) { % li a href=/jsp/ownerprofile.jsp?new=%=userRegion%Add New Customer/a /li %if (session.getValue(customer) != null userRegion == custRegion){ % li a href=/jsp/clientcardentry.jspAdd New Card/a /li %}% %}% %if (request.isUserInRole(OwnerServices) || request.isUserInRole (Finance)) {% %if (request.isUserInRole(Finance)) { % li a href=/jsp/jetcardexpired.jspExpired Cards/a /li %}% %}% %if(session.getValue(customer) != null (request.isUserInRole (Finance) || request.isUserInRole(Administrator) || request.isUserInRole(Sales) || request.isUserInRole(OSManager) || request.isUserInRole(OwnerServices))){ % li a href=/jsp/welcomecall.jspWelcome Call/a /li %}% %if(request.isUserInRole(Sales) || request.isUserInRole (Administrator)){% li a href=/jsp/index.jsp?viewdash=1Dashboard/a /li %}% /ul /li %if (userRegion == 0 request.isUserInRole(Finance)) { //begin Accounts Block % lispanAccounts/span ul %if (request.getRemoteUser() != null) { % li a href=/jsp/njaccountsummary.jspAccount Summary/a /li %}% %if(session.getValue(njcontract) != null){% li a href=/jsp/viewnjflightactivity.jspView Activity/a /li %}% %if(request.isUserInRole(Finance) || request.isUserInRole (Administrator)) { % li a href=/mars/jsp/brioreader.jspLoad Brio File/a /li
[jQuery] Syntax Explanation
jQuery right now is still like a foreign language to me. I have books, etc. but can someone tell me what's going on here: // Create shortcut for internal use var $jc = $.jcarousel; $jc.fn = $jc.prototype = { jcarousel: '0.2.3' }; what is prototype, and what is jcarousel: '0.2.3', is that just setting some other variable's value?
[jQuery] Re: ajax post not sending header
Nop, it is the same... On 2 יולי, 00:17, James james.gp@gmail.com wrote: Hmm... What happens if you add: type: POST in your AJAX options? On Jul 1, 10:36 am, hadaraz hada...@gmail.com wrote: I have used firebug, and there is no sign of AJAX request. On the server side I use python, and yes, I'm checking for 'HTTP_X_REQUESTED_WITH'. Maybe there is a problem with the jquery 1.3.2 (which is what I use, linked from google ajax libs)? On Jul 1, 9:21 pm, James james.gp@gmail.com wrote: Have you tried using Firebug for Firefox to examine the headers of the AJAX request to be sure that it wasn't sent? Check that first. You might be reading the headers incorrectly on the PHP side. Are you using: $_SERVER['HTTP_X_REQUESTED_WITH'] The beginning HTTP_ part is the tricky part. Make sure you have that. On Jun 30, 9:52 pm, hadaraz hada...@gmail.com wrote: Posting data from a form using this function: $(function() { $('#emailform').submit(function() { $.ajax({ url: '/post/url/', dataType: 'json', data: $('#emailform').serialize(), success: function(rdata) { $('#emailformmessage').text(rdata.message).show ('slow'); } }); }); return false; }); the server doesn't detect an ajax call ('X-Requested-With' header is not sent). I tried forcing it with beforeSubmit and also with ajaxSetup, but no go. Any solutions to this problem? hadaraz-הסתר טקסט מצוטט- -הראה טקסט מצוטט-
[jQuery] select option not catching mousedown event in IE and Chrome
This is the code I am using to test this. In FF and Op. When I click on an option in the select box, the alert pops up. In IE and Chrome, it doesn't seem to catch it at all. $('.clickopt').mousedown(function(){ alert(test); });
[jQuery] Re: JCarousel - how toenable / disable next button manually
For example is carousel.has a jQuery function or a carousel function. I can't distinguish between what is carousel exposed and what's just being called from the jQuery library when looking at the source or other people's examples such as http://usejquery.com/sites/296 so back to my original question. Anyone have a clue how to disable or enable the next button manually here? On Jul 2, 8:45 am, expresso dschin...@gmail.com wrote: so I tried this and added this to my mycarousel_itemLoadCallback function (I looked at the JCarousel source code and thought maybe this would work): this.buttonNext[0].jcarouselstate = 'enabled'; it seemed to enable it, but then my fing pictures did not render! I'm about to lose it. Anyone have any time to maybe try to help me out here. I'm looking at this documentation and wondering how the hell people are even manipulating this plug-in at all. For example look at these guys, they manipulated the hell out of the Carousel and I have no idea how the heck they even figure out how to use the functions or where they are getting all these nifty functions. I assume half of it is just using the jQuery library selectors on an object but still: http://usejquery.com/sites/296 On Jul 2, 6:31 am, expresso dschin...@gmail.com wrote: I've got a major wall with this plug-in. You have to specify a size that is than the # of images that are currently viewable to get the next button to be enabled. That mucks up my entire logic when trying to look up in a javascript array and paint a new set of pictures every time you move next in the caoursel. http://sorgalla.com/projects/jcarousel/ So I figured hey, maybe I can specify x images that does not go over what is shown. So if I pass 3 images, it will show 3 and not have to specify a size of 4 just to get the next button to be enabled. The only way I can see to do this (possibly, but I'm not sure yet if this will work) is to use the buttonNextCallback and somehow I guess in my buttonNextCallback method that I assign it to, to do some logic and enable or disable it. Problem is I have not a clue how to use it! There is absolutely no documentation on how to set it and then what the syntax would be to enable or disable the button. And to make matters worse, the author has dropped off the face of the earth. So if anyone can shed some light on how I can control this next button, you will save me from probably days more of work and I've already spent a week on this! I am about to go luda. Also, can someone tell me how the heck he's getting the next button to show enabled? because in mine, if I specify a length over what's shown and I click next, I get either empty frames or I get one picture or two pictures in the next set when you click next. His doesn't do that. He gets a nice new set of 3 each time and his next button is enabled: http://sorgalla.com/projects/jcarousel/examples/dynamic_flickr_api.html
[jQuery] Re: Firefox, Opera.. GOOOD!.... IE... Chrome... BAAD. Initiating a download from a listbox.
DELETE this please, its not the issue. I'll repost. Thanks!! On Jul 2, 9:44 am, sso strongsilent...@gmail.com wrote: hi I have a php script that initiates a download. This occurs when I file is selected from a drop down box and the js/jquery redirects them. Is there a reason this works perfectly in FF and Opera and has no response in Chrome/IE ? I tested the download code to execute when the page is loaded rather than when its selected from the box and it works fine, so I;m guessing its a problem with the js. Suggestions?
[jQuery] Re: Replace div with another div
Charlie, I just plan on using an ID or class that's already in that div to reference it. For example: div class=jcarousel-prev jcarousel-prev-horizontal jcarousel-prev- disabled jcarousel-prev-disabled-horizontal style=display: block; disabled=true/ why couldn't I do something like $(.jcarousel-prev jcarousel-prev- horizontal jcarousel-prev- disabled jcarousel-prev-disabled-horizontal).replaceWith('div class=jcarousel-prev jcarousel-prev-horizontal style=display: block; disabled=false/'); On Jul 2, 9:04 am, Charlie charlie...@gmail.com wrote: one problem you'll likely run into completely replacing that div even though the html and classes will fit in with the carousel you could have problems due to no events attached to new div from document ready Giovanni Battista Lenoci wrote: expresso ha scritto:I'm trying to figure out how I'd explicitely change out a div. Lets say this div is in the page. I guess first I'd have to verify if it's in the page: div class=jcarousel-prev jcarousel-prev-horizontal jcarousel-prev- disabled jcarousel-prev-disabled-horizontal style=display: block; disabled=true/ And if it is, I want to remove it and add this in the same place: div class=jcarousel-prev jcarousel-prev-horizontal style=display: block; disabled=false/ I have not a clue how to do this. If give a unique id to the div (or you have a rule to get it, for example $('#mycontainer div')); You can do: $('#id').replaceWith('divmy newmarkup!/div'); If the selector doesn't return nothing then nothing will be replaced. Bye
[jQuery] Re: JCarousel - how toenable / disable next button manually
another example. Look at the source. Where the hell did he get this this.buttonNext[0].jcarouselstate jcourselstate and even buttonNext? where are these objects from? I see no creation of them in the rest of the source code. I just don't get it. On Jul 2, 8:45 am, expresso dschin...@gmail.com wrote: so I tried this and added this to my mycarousel_itemLoadCallback function (I looked at the JCarousel source code and thought maybe this would work): this.buttonNext[0].jcarouselstate = 'enabled'; it seemed to enable it, but then my fing pictures did not render! I'm about to lose it. Anyone have any time to maybe try to help me out here. I'm looking at this documentation and wondering how the hell people are even manipulating this plug-in at all. For example look at these guys, they manipulated the hell out of the Carousel and I have no idea how the heck they even figure out how to use the functions or where they are getting all these nifty functions. I assume half of it is just using the jQuery library selectors on an object but still: http://usejquery.com/sites/296 On Jul 2, 6:31 am, expresso dschin...@gmail.com wrote: I've got a major wall with this plug-in. You have to specify a size that is than the # of images that are currently viewable to get the next button to be enabled. That mucks up my entire logic when trying to look up in a javascript array and paint a new set of pictures every time you move next in the caoursel. http://sorgalla.com/projects/jcarousel/ So I figured hey, maybe I can specify x images that does not go over what is shown. So if I pass 3 images, it will show 3 and not have to specify a size of 4 just to get the next button to be enabled. The only way I can see to do this (possibly, but I'm not sure yet if this will work) is to use the buttonNextCallback and somehow I guess in my buttonNextCallback method that I assign it to, to do some logic and enable or disable it. Problem is I have not a clue how to use it! There is absolutely no documentation on how to set it and then what the syntax would be to enable or disable the button. And to make matters worse, the author has dropped off the face of the earth. So if anyone can shed some light on how I can control this next button, you will save me from probably days more of work and I've already spent a week on this! I am about to go luda. Also, can someone tell me how the heck he's getting the next button to show enabled? because in mine, if I specify a length over what's shown and I click next, I get either empty frames or I get one picture or two pictures in the next set when you click next. His doesn't do that. He gets a nice new set of 3 each time and his next button is enabled: http://sorgalla.com/projects/jcarousel/examples/dynamic_flickr_api.html
[jQuery] Re: Syntax Explanation
this notation $.jcarousel means you want to access that field, whether it be to set it to something else, or read the contents. this notation in javascript jcarousel: '0.2.3'is setting a key value pair where jcaraousel is the key and 0.2.3 is the value does that make sense? cheers Michael Lawson Development Lead, Global Solutions, ibm.com Phone: 1-276-206-8393 E-mail: mjlaw...@us.ibm.com 'Examine my teachings critically, as a gold assayer would test gold. If you find they make sense, conform to your experience, and don't harm yourself or others, only then should you accept them.' From: expresso dschin...@gmail.com To: jQuery (English) jquery-en@googlegroups.com Date: 07/02/2009 10:23 AM Subject:[jQuery] Syntax Explanation jQuery right now is still like a foreign language to me. I have books, etc. but can someone tell me what's going on here: // Create shortcut for internal use var $jc = $.jcarousel; $jc.fn = $jc.prototype = { jcarousel: '0.2.3' }; what is prototype, and what is jcarousel: '0.2.3', is that just setting some other variable's value? inline: graycol.gifinline: ecblank.gif
[jQuery] Re: Replace div with another div
even though the html and classes will fit in with the carousel you could have problems due to no events attached to new div from document ready I guess I don't understand. If I'm just replacing the code with code that would show up if the button was enabled, it still has valid structure for the carousel .js library to manipulate or reference. On Jul 2, 9:42 am, expresso dschin...@gmail.com wrote: Charlie, I just plan on using an ID or class that's already in that div to reference it. For example: div class=jcarousel-prev jcarousel-prev-horizontal jcarousel-prev- disabled jcarousel-prev-disabled-horizontal style=display: block; disabled=true/ why couldn't I do something like $(.jcarousel-prev jcarousel-prev- horizontal jcarousel-prev- disabled jcarousel-prev-disabled-horizontal).replaceWith('div class=jcarousel-prev jcarousel-prev-horizontal style=display: block; disabled=false/'); On Jul 2, 9:04 am, Charlie charlie...@gmail.com wrote: one problem you'll likely run into completely replacing that div even though the html and classes will fit in with the carousel you could have problems due to no events attached to new div from document ready Giovanni Battista Lenoci wrote: expresso ha scritto:I'm trying to figure out how I'd explicitely change out a div. Lets say this div is in the page. I guess first I'd have to verify if it's in the page: div class=jcarousel-prev jcarousel-prev-horizontal jcarousel-prev- disabled jcarousel-prev-disabled-horizontal style=display: block; disabled=true/ And if it is, I want to remove it and add this in the same place: div class=jcarousel-prev jcarousel-prev-horizontal style=display: block; disabled=false/ I have not a clue how to do this. If give a unique id to the div (or you have a rule to get it, for example $('#mycontainer div')); You can do: $('#id').replaceWith('divmy newmarkup!/div'); If the selector doesn't return nothing then nothing will be replaced. Bye
[jQuery] Re: Replace div with another div
I want to replace it with div class=jcarousel-prev jcarousel-prev- horizontal style=display: block; disabled=false/ which is what the carousel code replaces it with anyway when the button IS enabled..I just viewed the source to see that. On Jul 2, 9:42 am, expresso dschin...@gmail.com wrote: Charlie, I just plan on using an ID or class that's already in that div to reference it. For example: div class=jcarousel-prev jcarousel-prev-horizontal jcarousel-prev- disabled jcarousel-prev-disabled-horizontal style=display: block; disabled=true/ why couldn't I do something like $(.jcarousel-prev jcarousel-prev- horizontal jcarousel-prev- disabled jcarousel-prev-disabled-horizontal).replaceWith('div class=jcarousel-prev jcarousel-prev-horizontal style=display: block; disabled=false/'); On Jul 2, 9:04 am, Charlie charlie...@gmail.com wrote: one problem you'll likely run into completely replacing that div even though the html and classes will fit in with the carousel you could have problems due to no events attached to new div from document ready Giovanni Battista Lenoci wrote: expresso ha scritto:I'm trying to figure out how I'd explicitely change out a div. Lets say this div is in the page. I guess first I'd have to verify if it's in the page: div class=jcarousel-prev jcarousel-prev-horizontal jcarousel-prev- disabled jcarousel-prev-disabled-horizontal style=display: block; disabled=true/ And if it is, I want to remove it and add this in the same place: div class=jcarousel-prev jcarousel-prev-horizontal style=display: block; disabled=false/ I have not a clue how to do this. If give a unique id to the div (or you have a rule to get it, for example $('#mycontainer div')); You can do: $('#id').replaceWith('divmy newmarkup!/div'); If the selector doesn't return nothing then nothing will be replaced. Bye
[jQuery] Re: jQuery ajaxSubmit(), how to send the form in a json format?
Hi, I'm not a 100% sure if that's want you want, but take a look at (especially the examples): http://docs.jquery.com/Ajax/jQuery.getJSON Cheers On 2 Jul., 14:35, DaNieL daniele.pigned...@gmail.com wrote: Hi guys, i just leanerd the existence of the ajaxSubmit jQuery plugin, im wondering if there is a way to use the JSON both to send and retrieve the requests. I mean, no the plugin have the option 'dataType', that is used to specify the format that the server will send back, but i need to send the form as jquery to the server. For example, if my form looks like: form name=mytest action=mypage.php method=get input type=text name=firstone id=firstone value=here some text! / input type=text name=secondone id=secondone value=text in here too / /form i'll love that the plugin will send a request like: mypage.php?mytest=[{'firstone':'here some text!','secondone':'text in here too'}] Is it possible?
[jQuery] Re: jQuery ajaxSubmit(), how to send the form in a json format?
DaNieL ha scritto: i'll love that the plugin will send a request like: mypage.php?mytest=[{'firstone':'here some text!','secondone':'text in here too'}] Is it possible? Don't know, but I'm curious, what's the motive behind this choice? If you pass a json object you have to convert in an array with json_decode to have an array similar to $_POST, right? -- gianiaz.net - web solutions via piedo, 58 - 23020 tresivio (so) - italy +39 347 7196482
[jQuery] Re: Syntax Explanation
Thanks. so $jc.fn = $jc.prototype $jc is just the entire object and .fn is just a variable/field that was created somewhere else in the code? On Jul 2, 9:44 am, Michael Lawson mjlaw...@us.ibm.com wrote: this notation $.jcarousel means you want to access that field, whether it be to set it to something else, or read the contents. this notation in javascript jcarousel: '0.2.3' is setting a key value pair where jcaraousel is the key and 0.2.3 is the value does that make sense? cheers Michael Lawson Development Lead, Global Solutions, ibm.com Phone: 1-276-206-8393 E-mail: mjlaw...@us.ibm.com 'Examine my teachings critically, as a gold assayer would test gold. If you find they make sense, conform to your experience, and don't harm yourself or others, only then should you accept them.' From: expresso dschin...@gmail.com To: jQuery (English) jquery-en@googlegroups.com Date: 07/02/2009 10:23 AM Subject: [jQuery] Syntax Explanation jQuery right now is still like a foreign language to me. I have books, etc. but can someone tell me what's going on here: // Create shortcut for internal use var $jc = $.jcarousel; $jc.fn = $jc.prototype = { jcarousel: '0.2.3' }; what is prototype, and what is jcarousel: '0.2.3', is that just setting some other variable's value? graycol.gif 1KViewDownload ecblank.gif 1KViewDownload
[jQuery] Re: Syntax Explanation
Thats correct! cheers Michael Lawson Development Lead, Global Solutions, ibm.com Phone: 1-276-206-8393 E-mail: mjlaw...@us.ibm.com 'Examine my teachings critically, as a gold assayer would test gold. If you find they make sense, conform to your experience, and don't harm yourself or others, only then should you accept them.' From: expresso dschin...@gmail.com To: jQuery (English) jquery-en@googlegroups.com Date: 07/02/2009 11:28 AM Subject:[jQuery] Re: Syntax Explanation Thanks. so $jc.fn = $jc.prototype $jc is just the entire object and .fn is just a variable/field that was created somewhere else in the code? On Jul 2, 9:44 am, Michael Lawson mjlaw...@us.ibm.com wrote: this notation $.jcarousel means you want to access that field, whether it be to set it to something else, or read the contents. this notation in javascript jcarousel: '0.2.3' is setting a key value pair where jcaraousel is the key and 0.2.3 is the value does that make sense? cheers Michael Lawson Development Lead, Global Solutions, ibm.com Phone: 1-276-206-8393 E-mail: mjlaw...@us.ibm.com 'Examine my teachings critically, as a gold assayer would test gold. If you find they make sense, conform to your experience, and don't harm yourself or others, only then should you accept them.' From: expresso dschin...@gmail.com To: jQuery (English) jquery-en@googlegroups.com Date: 07/02/2009 10:23 AM Subject: [jQuery] Syntax Explanation jQuery right now is still like a foreign language to me. I have books, etc. but can someone tell me what's going on here: // Create shortcut for internal use var $jc = $.jcarousel; $jc.fn = $jc.prototype = { jcarousel: '0.2.3' }; what is prototype, and what is jcarousel: '0.2.3', is that just setting some other variable's value? graycol.gif 1KViewDownload ecblank.gif 1KViewDownload inline: graycol.gifinline: ecblank.gif
[jQuery] Re: how to reset radio button ?
anyone help? appreciated in advance.
[jQuery] Re: jQuery Animation Loading
Does anyone know how to fix the problem with the portfolio section?
[jQuery] 2 different ways of doing the same thing?
Would this not be 2 different ways to do the same thing? $('input:not(:checkbox)); vs. $('input').not(:checkbox);
[jQuery] Selector :eq(x) issuing warning in FF
When calling this jQuery: $(#homepage-slides img:eq(0)).fadeOut(300, function() { $(#homepage-slides img:eq(1)).fadeIn(300, function() { $(#homepage- slides img:eq(0)).remove(); }); }); I'm getting this warning in the Web Developer toolbar in Firefox: Warning: Unknown pseudo-class or pseudo-element 'eq'. It seems to work, however the image preload function I'm calling just before it isn't functioning and I'm thinking it's because of this issue. I'm using jQuery 1.3.2. Is there a different syntax to do this now? If so, then the docs demo is incorrect.
[jQuery] Re: reload an SWF object from jquery
The issue is that your selector returns a jQuery object, not a raw DOMElement, which is what swfobject and/or ExternalInterface expect. Use this instead: var elem = $(#someId)[0]; elem.reload(); the difference is that by using array access to get the first element in the wrapped set, you can directly call methods defined in AS3. Hope that helps. On Jul 2, 4:23 am, pacodelucia aziz.hamm...@gmail.com wrote: Hi again I have created a demo of the described problem. Please find it here :http://msc2svg.googlepages.com/index.html The source code can be downloaded as zip form here :http:// msc2svg.googlepages.com/demo.zip The demo javascript code is written in index.html On Jul 1, 6:11 pm, Liam Byrne l...@onsight.ie wrote: Any chance that there are 2 items with id / name reportChart ? L pacodelucia wrote: Hi The code I have written in my post was some how pseuodo code. That is the reason why it contains so much typing errors. Sorry for that Here is the code directly copied from my js file: document.getElementById('reportChart').reload(charts/ pie_chart.php); //works $(#reportChart).reload(charts/ pie_chart.php); // does not work I am using firefox 3.5 On Jul 1, 5:03 pm, Liam Byrne l...@onsight.ie wrote: Is there an error / typo in the URL being requested ? Should it be charts/gen_*e*_rate_chart.php ? L pacodelucia wrote: sorry for the type error. I meant really that $(#reportChart).reload(charts/genrate_chart.php); does not work with the # selector. On Jul 1, 3:51 pm, Olaf Bosch olaf.bo...@t-online.de wrote: pacodelucia schrieb: Apparently $(reportChart) is not returning really an SWF object. Anyone has an idea if this possible with jquery? This is not a correct Selectot for ID, try so: //access via jquery $(#reportChart).reload(charts/genrate_chart.php); // does not work # for ID, . for CLASS -- Viele Grüße, Olaf --- olaf.bo...@t-online.dehttp://olaf-bosch.de/http://ohorn.info/http://www.akitafreund.de/ --- No virus found in this incoming message. Checked by AVG -www.avg.com Version: 8.5.375 / Virus Database:270.13.1/2212- Release Date:07/01/09 05:53:00 No virus found in this incoming message. Checked by AVG -www.avg.com Version: 8.5.375 / Virus Database:270.13.1/2212- Release Date:07/01/09 05:53:00
[jQuery] jQuery - Click function + Ajax
Hi there, I have a hyperlink ( a ) after i click on that hyperlink, the script sends some data to a .php page; That works fine, but for just one hyperlink , i want to be able to have 2 or more hyperlinks in the same page using the same script. Here goes the script: $(#button).click(function(){ var element = this; var productId = $(element).attr('product'); //$(element).attr(href, javascript: void(0);); $.ajax({ type: GET, url: index.php, data: product= + productId }); }); HTML: a id=button rel=nofollow product=10 href=#testProduct 10/a a id=button rel=nofollow product=20 href=#testProduct 20/a
[jQuery] Re: jQuery.extend(deep) not working?
+1 jQuery 1.3.2 I have endless circle in like this code: $(function () { $.getJSON(http://foo.com/json/?callback=?;, {ref: document.referrer, loc: window.location}); }); This code is second ready() callback. If i remove this code from my scripts, all works fine If i add, i have endless circle in browser (firefox 3.0.11) and i see a following errors not minimised jquery version: Error: [Exception... Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMLocation.host] nsresult: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) location: JS frame :: http://mysite-url-here.com/js/jquery-1.3.2.js :: anonymous :: line 604 data: no] Source File: http://mysite-url-here.com/js/jquery-1.3.2.js Line: 604 I think that this very bad bug because it causes endless circle of loading at serfer side ... On May 21, 10:20 pm, Adam Nelson a...@varud.com wrote: I'm trying out this need extension: http://binarykitten.jkrswebsolutions.co.uk/2009/01/21/jquery-plugin-a... which allows jQuery to do a HEAD request on an arbitrary URL in order to grab header values for a given page. Unfortunately, if that page is the page the script is currently running from, it goes into an infinite loop which results in: [Exception... Componentreturnedfailurecode:0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMLocation.host] nsresult: 0x80004001(NS_ERROR_NOT_IMPLEMENTED) location: JS frame ::http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js:: anonymous :: line 12 data: no] [Break on this error] (function(){var l=this,g,y=l.jQuery,p=l.each (function(){o.dequeue(this,E)})}}); If I add deep to jQuery.extend(), I get deep is not defined. Does anybody have any help for this? Should thecodebe refactored to not extend but to be a more simplistic?
[jQuery] (validate) no data submitted to remote: from IE6 - works fine in IE7+, FF, Safari, Chrome
Hi, We're using jquery.validate for a form with several fields. One of the rules uses the remote: method to send a field to the server, which replies with eithe true or false (as a string). This works in IE7+, Firefox 2-3.5, Safari and Chrome but not in IE6. The debug bar for IE6 lists no POST request at all - but it does list a 200 OK response! But the response has no length, (i.e. is empty) so the form won't validate. The entire header shown for IE6 is HTTP/1.1 200 OK X-Powered-By: PHP/5.2.8 Keep-Alive: timeout=10, max=84 Transfer-Encoding: chunked Content-Type: text/html Whereas for IE7 (etc) i have a post reqest with response HTTP/1.1 200 OK Date: Thu, 02 Jul 2009 13:45:24 GMT Server: Apache X-Powered-By: PHP/5.2.8 Content-Length: 4 Keep-Alive: timeout=10, max=90 Connection: Keep-Alive Content-Type: text/html We're using jquery.validate 1.5.5 with jquery 1.3.2 Before I go completely mad trying to figure this out, I wanted to check if there was any know incompatibilities between this version of validate and IE6. (I found some stuff from google which suggested the .min.js and/ or .pack.js versions didn't work with IE6 so i've changed to the uncompressed version but to no avail. Many thanks, Adam
[jQuery] superfish and Lokesh Dhakar's lightbox2 seem to conflict - please help
Hi, Firstly, really like Superfish! Also should mention I'm a complete noob when it comes to JavaScript code. Have successfully implemented the out-of-the-box Superfish nav-bar style within this website though - it's temporarily located here http://www.the2jays.com/index.php (note this site is still very much under construction, styling is still yet to be done (including the nav bar) and the site-wide build is only partially uploaded to the remote server). The site is a partial rebuild/ redesign and the old site used Lokesh Dhakar's lightbox2 on a number of pages (page contents on the new site are to remain the same as the old). On pages that reference the lightbox2 script (using 'Prototype JavaScript framework - version 1.4.0') a slight conflict with the desired rendering of the Superfish nav-bar seems to occur - example page http://www.the2jays.com/news/papua-new-guinea001.php Lightbox2 seems to still work fine and so does Superfish mostly, however the ‘PHP if statement’ generating the ‘current class tab’ on the top level 'News' button is lost/ missing and the second tier level button row has greater space between it and the top level than desired (while on this page mouse-over a different top level button to see what I mean). Hope the above makes sense. When I turn off script type=text/javascript src=../js/ prototype.js/script in the head section of the page Superfish appears perfect so I'm assuming it's got something to do with the ‘prototype’ framework ? I've looked at 'jQuery with Other Libraries' but as a noob this is over-my-head atm http://docs.jquery.com/Using_jQuery_with_Other_Libraries and to be honest I'm not sure if I'm on the right track. Did also try turning 'Lokesh Dhakar's lightbox2' off and used 'jQuery Lightbox 0.5' instead thinking the two jQuery scripts should work together. The same problem still occurred however. Anyway, thought at this point I should probably post here and see if someone can assist me. Thanks in advance. JayD
[jQuery] AutoComplete - Raising event when custom item is selected
Concerning Jörn Zaefferer autocomplete. In many cases the autocomplete list is being filled with Key Value pairs, such as a list of FooBars with their name and id. Using the result function one would get the id, and drop it into a hidden field. I want to allow users to either pick an existing FooBars from the list, or enter a new one if he cannot find a suitable one. But for that to work I need to know that the autocomplete box contains a custom item, with other words: an item that was not in the list. The result event is only triggered whenever an item was picked from the list. How would I go about implementing this. My starting point was to add code to the blur event of the autocomplete, yet I can't get enough information to see if the currentValue is from the list, or a custom entry. Thanks, Gidon
[jQuery] Autocomplete - finding out (on blur) if the user has picked an item from the list or not
Concerning Jörn Zaefferer autocomplete. In many cases the autocomplete list is being filled with Key Value pairs, such as a list of FooBars with their name and id. Using the result function one would get the id, and drop it into a hidden field. I want to allow users to either pick an existing FooBars from the list, or enter a new one if he cannot find a suitable one. But for that to work I need to know that the autocomplete box contains a custom item, with other words: an item that was not in the list. The result event is only triggered whenever an item was picked from the list. How would I go about implementing this. My starting point was to add code to the blur event of the autocomplete, yet I can't get enough information to see if the currentValue is from the list, or a custom entry. Thanks, Gidon
[jQuery] FadeOut issue
Hi, using your example $.blockUI({ message: $('div.growlUI'), fadeIn: 0, fadeOut: 0, timeout: 3000, ... )} It seems fadeout is happening even if fadeOut parameter is set to 0. Thanks, Florin
[jQuery] Jquery bind with parameters? replace inline onclick for server side generated lists td onclick=fn(${serverSide.parameters})
Hello, I've wondered if there is a way to do this for a while. Perhaps I am missing something or should use a different approach altogether. Say I have a dynamic page that generates some td elements. The syntax here is freemarker but you can easily envision your favorite serverside text generating language instead. table id=records theadthName/th/thead tbody [#list records as record] tr td class=trigger id=trigger_${record.ID} onclick=showDetails (${record.ID})${record.name}/td /tr [/#list] /tbody /table script type=text/javascript function showDetails(recordID) { // normally an ajax post but you get the idea window.location = '/record?recordID=' + recordID } /script Now I want to get that onclick out of there and bind it using jquery, but i haven't been able to figure out if there is a way to get the parameter there. Apart from putting it in some attribute and looking at it. Is there a cleaner way? script type=text/javascript $(document).ready(function() { $('#records td.trigger').click(function() { window.location = '/record?recordID=' + ??? how do i get that }); }); /script I know I could look at the elements attributes, something like this.attr(id).substring().etc().etc() .. but sometimes there are many parameters to the javascript fn to generate the post and that approach doesn't seem to viable. and there isn't really a standard attribute to use that makes sense for that anyway. So how do I do this? Thanks
[jQuery] removing submitHandler
I have 4 buttons in a form. Save, Back, Submit, Confirm. The submit does form validation and has a submitHandler and invalidHandler. If no errors, a modal Confirm screen is shown with another button of Confirm. This button does the actual post to the form to complete the process. The Save and Back buttons need to post the form, but does not have any validation. The problem is that if I hit Submit and my Confirm modal pops up and I cancel out the Save and Cancel button now inherit the submitHandler and invalidHandler of the Submit button. So if i click on save of back, the Confirm modal pops up. Ideally, I would like to remove the Handler's if the Save or Back button are clicked. I've tried unbinding the form and submitting it myself, but the Modal window still pops up. I have a working example I can give out individually if required. Here is my JS: [code] script type=text/javascript $(document).ready(function() { $(window).keydown(function(event){ document.getElementById('save').src = /bttn- save.jpg; }); var errorimage = img src=\error.png\ width=\19\ height=\19\ alt=\error\ title=\error\ style=\vertical- align:top;margin-top:5px;\ /; $('#submit').click(function(e) { $('#promoForm').validate({ submitHandler: function() { tb_show(, #TB_inline? height=400width=600inlineId=confirmblock, null); }, invalidHandler: function(e, validator) { var errors = validator.numberOfInvalids(); if (errors) { tb_show(, #TB_inline? height=150width=250inlineId=errorblock, null); } }, errorElement: span, rules: { additionalinfo: required }, messages: { additionalinfo: errorimage } }); document.getElementById('td_info').innerHTML = document.getElementById('additionalinfo').value; }); $('#back').click(function() { $(#promoForm).attr(action, step6/? action=backemail=%%=RequestParameter(email)=%%); }); $('#save').click(function() { $(#promoForm).attr(action, /step7/? action=saveemail=%%=RequestParameter(email)=%%); }); $('#confirm').click(function() { document.getElementById('promoForm').action = / thatsit/?email=%%=RequestParameter(email)=%% document.getElementById('promoForm').submit(); }); $('#attach').click(function() { tb_show(, #TB_inline? height=300width=336inlineId=uploadblock, null); }); }); /script [/code]
[jQuery] How to use jQuery with ImageMap
I. Aim: First click on imagemap area - select area(highlight). Second click- deselect area. II. Very similar example. The result should be like this: a) HTML code: p class=blueClick to toggle/p b) CSS: .blue { color:blue; } .highlight { background:yellow; background-color: #1a3654;} c) JS: $(document).ready(function(){ $(p).click(function () { $(this).toggleClass(highlight); }); }); III. I'd found jQuery plugin Map Hilight. It works great onOver, hovewer like I said - I need possibility to select/deselect area easily (onClick). IV. So how can I do this? P.S.: developers, thanks for great jQuery features!
[jQuery] Fire event
Hi there, i'am new to jquery so my question is maybe too easy for you? ;) I got the following: 3 Radiobuttons which each i added a click event that shows up a new div with some information about the value of this radio button. This works fine. Now when i load the page and passing a PHP variable to the script one radio button is checked by default. This also works but the div with the information doesn't appear. Is there a way to check which button is selected on $(document).ready and then fireing the event which is attached to this button? Here is a code snipped of my first jquery script: $(document).ready(function(){ $(.infotext).hide(); // onload hide the infofield // for each button hide the infofield and fade in just the one i need - this works :) $(#btn_1).click(function(){ $(.infotext).hide(); $(#info1).fadeIn(slow); }); $(#btn_2).click(function(){ $(.infotext).hide(); $(#info2).fadeIn(slow); }); $(#btn_3).click(function(){ $(.infotext).hide(); $(#info3).fadeIn(slow); }); }); Regards, qualle
[jQuery] $(#datepicker).datepicker is not a function
hi i am getting this error when i was trying to use the jquery datepicker widget.Can you please help me to solve this issue?
[jQuery] Jquery bind with parameters? Replace inline onclick for server side generated lists, onclick(x, y, z)
Hello First off if this is a double post I apoligize, I sent my first message an hour ago and it is not showing up. Anyway: I've wondered if there is a way to do this for a while. Perhaps I am missing something or should use a different approach altogether. Say I have a dynamic page that generates some td elements. The syntax here is freemarker but you can easily envision your favorite serverside text generating language instead. table id=records theadthName/th/thead tbody [#list records as record] tr td class=trigger id=trigger_${record.ID} onclick=showDetails (${record.ID})${record.name}/td /tr [/#list] /tbody /table script type=text/javascript function showDetails(recordID) { // normally an ajax post but you get the idea window.location = '/record?recordID=' + recordID } /script Now I want to get that onclick out of there and bind it using jquery, but i haven't been able to figure out if there is a way to get the parameter there. Apart from putting it in some attribute and looking at it. Is there a cleaner way? script type=text/javascript $(document).ready(function() { $('#records td.trigger').click(function() { window.location = '/record?recordID=' + ??? how do i get that }); }); /script I know I could look at the elements attributes, something like this.attr(id).substring().etc().etc() .. but sometimes there are many parameters to the javascript fn to generate the post and that approach doesn't seem to viable. and there isn't really a standard attribute to use that makes sense for that anyway. So how do I do this? Thanks
[jQuery] Selector Syntax, new to jQuery
Starting to use jQuery having read 'jQuery in Action'. Came across the following sysntax for sortable tables: $('table.sortable').each(function() { var $table = $(this); $('th', $table).each(function(column) . Clearly the $('th', $table).each syntax results in traversing 'th' elements that are descendants of each of the 'table.sortable' elements. I'm missing where this syntax is documented and explained.
[jQuery] Re: Newbie question
$(selector1, selector2).click(function(){}) http://docs.jquery.com/Selectors/multiple#selector1selector2selectorN e.g. $('td, th').click(function(){alert(clicked table cell);}); Colin On Jul 2, 6:09 am, Alexandru Adrian Dinulescu alex.d.a...@gmail.com wrote: Hello. I am trying to do something like this $(element1 || element2).click(function(){}) unfortunately this does not work, both element1 and element2 work independently but not together and i have no clue how to get them to work together. Basically what i need that either when element1 is clicked, OR element2 is clicked, do identical thing. I know this is a very simple issue, but i havent learned Javascript at all, i've started with jQuery. Thank you
[jQuery] Swapping attributes with attr
Hi, I am trying to swap two attributes around, I am trying to achieve something like this: $(trigger).find('input').attr({value: img_id, name: $(this).attr('id')}); As you can see, I am trying to swap the value of the name attribute with the value of the id attribute. The above code does not work, as $(this) is not input field object. Can anyone suggest a clean way in which I can do the above? -- View this message in context: http://www.nabble.com/%22Swapping%22-attributes-with-attr-tp24308061s27240p24308061.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] jqGrid - show editable column (hidden in grid)
Hi, I am trying to achieve fallowing functionality. Hide grid column (when grid view), but edit this field when inline editing popup shows. Currently when i hide a column in grid it is not visible in EditForm too. colModel: [ { name: 'Id', hidden:true, index: 'Id', width: 0,display:false, sorttype: int, search: false }, { name: 'Email', editable: true,index: 'Email', width: 170, search: false }, { name: 'Comment', editable: true,index: 'Comment' , hidden:true, editrules: { edithidden: false,display:true,hidden:false }, width: 170, search: false }, // - this one Any suggestions or help will be appreciated Cheers rzk
[jQuery] Re: Cleaning up javascript before ajax load
in your ajax all you can have the following : $.ajax({ url:b.html, cache:false, // cache or not async:true, // load asynchronously or not success:function(html) { // code here } }); On Thu, Jul 2, 2009 at 6:00 AM, Charlie charlie...@gmail.com wrote: one more thing you might look at and maybe get clarification on empty()Note that this function starting with 1.2.2 will also remove *all event handlers and internally cached data*. http://docs.jquery.com/Manipulation/empty Veeru wrote: Hi Charlie I have checked the links you gave me, found some interesting stuff like adding a .html() before updating the ajax content; but in the problem situation mentioned, they were only load html, but what if there is js as well - like if any element has an onClick() event in the html, and this content loads every now and then, does the event keep binding and binding till it hogs memory? I can try to remoev all js and include in an external file and load it before the ajax calls, but i am just afraid the js file might become too big and get more complicated to handle. Thanks Vru
[jQuery] Re: jQuery - Click function + Ajax
You can't have 2 elements with the same id on the same page. Instead do a class=button and change your selector to use $(a.button). I would also recommend using a href= I'm kind of doing the same thing (i have a thread about it), is it safe to put event parameters in arbitrary attribute names? i.e.: td class=trigger record=${record.ID} paramX=${paramX} paramY=$ {paramY} isn't that invalid html and rejected by some browsers? or is that normal and just fine to do? On Jul 2, 12:44 pm, Glazz brunofgas...@live.com.pt wrote: Hi there, I have a hyperlink ( a ) after i click on that hyperlink, the script sends some data to a .php page; That works fine, but for just one hyperlink , i want to be able to have 2 or more hyperlinks in the same page using the same script. Here goes the script: $(#button).click(function(){ var element = this; var productId = $(element).attr('product'); //$(element).attr(href, javascript: void(0);); $.ajax({ type: GET, url: index.php, data: product= + productId }); }); HTML: a id=button rel=nofollow product=10 href=#testProduct 10/a a id=button rel=nofollow product=20 href=#testProduct 20/a
[jQuery] Question on : syntax
I have yet another syntax question. I know that : can be used for specifying things like filters, but what does it do in this case: $jc.fn.extend({ setup: function() { this.first = null; this.last = null; this.prevFirst = null; this.prevLast = null; this.animating = false; this.timer = null; this.tail = null; this.inTail= false; if (this.locked) return; this.list.css(this.lt, this.pos(this.options.offset) + 'px'); ...rest of code here }, so what is the syntax setup:an attribute?
[jQuery] Re: how to reset radio button ?
Hi Davis First, you can't use twice the same id. That's a radio button then you must use the same name attribute in both fields. You can use $('input[name=vo_grantview][value=f]').attr('checked', true); Here you have the example of that code: http://jsbin.com/uceyi El 30/06/2009, a las 12:53, Davis escribió: Hello, i got 2 radio button and default selected p input type=radio value=p id=vo_grantview checked /p input type=radio value=f id=vo_grantview name=vo_grantview / f so how to use jquery to set f as selected one? something like $('#vo_grantview').val('f').checked? thanks/Davis.
[jQuery] Re: Selector Syntax, new to jQuery
I've been around jQuery for about 6 months and only learned that syntax recently. You won't find it documented very many places, perhaps it's an older style that got phased out for more aesthetic chaining. It is in jQuery core and it does work NauticalMac wrote: Starting to use jQuery having read 'jQuery in Action'. Came across the following sysntax for sortable tables: $('table.sortable').each(function() { var $table = $(this); $('th', $table).each(function(column) . Clearly the $('th', $table).each syntax results in traversing 'th' elements that are descendants of each of the 'table.sortable' elements. I'm missing where this syntax is documented and explained.
[jQuery] Re: Selector Syntax, new to jQuery
Answering my own question. Missed the optional 'context' parameter on the basic jQuery command. Works as advertised/expected. On Jul 2, 6:39 am, NauticalMac cmcnau...@gmail.com wrote: Starting to use jQuery having read 'jQuery in Action'. Came across the following sysntax for sortable tables: $('table.sortable').each(function() { var $table = $(this); $('th', $table).each(function(column) . Clearly the $('th', $table).each syntax results in traversing 'th' elements that are descendants of each of the 'table.sortable' elements. I'm missing where this syntax is documented and explained.
[jQuery] Re: jQuery selector performance / jQuery Tester
On Jul 2, 2009, at 8:45 AM, north wrote: Hi, I just tested all my jQuery selectors using the jQuery Tester (http:// jquery.nodnod.net), and the results seem to contradict one thing I read in a performance article: that you should descend from the closest parent ID when using classes in your selector (the article says April 09, so the latest jQuery version was already available). In my tests, using just the class selector (like span.myClass) was always fastest (sometimes twice as fast as #myDiv span.myClass), and this in all browsers I tested, not just the ones supporting getElementsByClassName. Maybe descending from the closest parent ID becomes a factor when you have a lot of elements on you page? Any experiences? Thanks If the selectors aren't causing a discernible bottleneck, I wouldn't worry too much about optimizing them. Just out of curiosity, though, what happens if you do this: $('#myDiv').find('span.myClass'); any faster? Also, which browser are you testing? --Karl
[jQuery] Re: select option not catching mousedown event in IE and Chrome
don't know about Chrome, but IE doesn't support onmousedown for option elements: from http://msdn.microsoft.com/en-us/library/ms536944%28VS.85%29.aspx (onmousedown Event): Applies To A, ADDRESS, APPLET, AREA, B, BDO, BIG, BLOCKQUOTE, BODY, BUTTON, CAPTION, CENTER, CITE, CODE, CUSTOM, DD, DFN, DIR, DIV, DL, document, DT, EM, EMBED, FIELDSET, FONT, FORM, hn, HR, I, IMG, INPUT type=button, INPUT type=checkbox, INPUT type=file, INPUT type=image, INPUT type=password, INPUT type=radio, INPUT type=reset, INPUT type=submit, INPUT type=text, KBD, LABEL, LEGEND, LI, LISTING, MAP, MARQUEE, MENU, nextID, NOBR, OL, P, PLAINTEXT, PRE, RT, RUBY, S, SAMP, SELECT, SMALL, SPAN, STRIKE, STRONG, SUB, SUP, TABLE, TBODY, TD, TEXTAREA, TFOOT, TH, THEAD, TR, TT, U, UL, VAR, XMP, Element Constructor, HTMLDocument Constructor No OPTION listed. --Karl Karl Swedberg www.englishrules.com www.learningjquery.com On Jul 2, 2009, at 9:59 AM, sso wrote: This is the code I am using to test this. In FF and Op. When I click on an option in the select box, the alert pops up. In IE and Chrome, it doesn't seem to catch it at all. $('.clickopt').mousedown(function(){ alert(test); });
[jQuery] Re: jQuery with HTML radio button forms
Hi, I changed it to the following: $(#flavors input[name=cakes]).change(function(){ if ($(#almond_cake).is(':checked')) { $(#wrapper_almond).show(); $(#pic_almond).show(); } else { $(#wrapper_almond).hide(); $(#pic_almond).hide(); }; There are more types of 'cakes' listed besides that the one there and this works perfectly fine in Mozilla firefox. However, the ever nasty Internet explorer gave me some problems. Clicking on almond cake radio button is supposed to show the wrapper_almond div, chocolate cake radio button shows wrapper_chocolate div, etc. But in IE, whenever I click on almond cake, nothing happens, and I click on chocolate cake, it shows almond cake instead! There seems to be a delay in clicks somehow. I either have to double click the radio button, or right click after selecting the radio button. Is there a way around this? Any help greatly appreciated! Sincerely, Westley On Jul 2, 6:00 am, Bharat bcrupa...@yahoo.com wrote: Can you try the change event instead of click? Bharat
[jQuery] Re: Question on : syntax
One thing to keep in mind, is that when you are using : to specify a filter, it will always be inside of a string. input:buttonfor example. The syntax you have here is the key value notation in javascript. It will almost always exist outside of a string. You are setting the setup key to the anonymous function you have there. cheers Michael Lawson Development Lead, Global Solutions, ibm.com Phone: 1-276-206-8393 E-mail: mjlaw...@us.ibm.com 'Examine my teachings critically, as a gold assayer would test gold. If you find they make sense, conform to your experience, and don't harm yourself or others, only then should you accept them.' From: expresso dschin...@gmail.com To: jQuery (English) jquery-en@googlegroups.com Date: 07/02/2009 01:09 PM Subject:[jQuery] Question on : syntax I have yet another syntax question. I know that : can be used for specifying things like filters, but what does it do in this case: $jc.fn.extend({ setup: function() { this.first = null; this.last = null; this.prevFirst = null; this.prevLast = null; this.animating = false; this.timer = null; this.tail = null; this.inTail= false; if (this.locked) return; this.list.css(this.lt, this.pos(this.options.offset) + 'px'); ...rest of code here }, so what is the syntax setup:an attribute? inline: graycol.gifinline: ecblank.gif
[jQuery] Re: Question on : syntax
lets go back to basic JavaScript. take this example var display = function() { // create namespace display return { hide : function(o) { // add function hide to namepsace var obj = document.getElementById(o); if(obj.style.display != 'none') { obj.style.display = 'none' } }, show : function(o) { // add function show to namespace var obj = document.getElementById(o); if(obj.style.display = 'none') { obj.style.display = 'block' } } }; }(); function init() { display.hide(mydiv); setTimeout(display.show('mydiv'), 1000); } window.onload = init; it is a more object orientated way of scripting as you can see i created my own namespace called display then i assigned two function to it display.hide and display.show so you can say your are creating your own namespae with it's own set of functions. the cool thing is if i create a namespace that controls sideshow behavior i can reuse my display namespace for the hide show transitions. On Thu, Jul 2, 2009 at 7:08 PM, expresso dschin...@gmail.com wrote: I have yet another syntax question. I know that : can be used for specifying things like filters, but what does it do in this case: $jc.fn.extend({ setup: function() { this.first = null; this.last = null; this.prevFirst = null; this.prevLast = null; this.animating = false; this.timer = null; this.tail = null; this.inTail= false; if (this.locked) return; this.list.css(this.lt, this.pos(this.options.offset) + 'px'); ...rest of code here }, so what is the syntax setup:an attribute?
[jQuery] Re: $(#datepicker).datepicker is not a function
if a jQuery function throws "is not a function" error it's because that function is not available when you call it. Available means browser hasn't loaded it, so either you don't have script files in correct order or a path to file problem jQueryUI site explains the order, path easy to check in browser. Priya wrote: hi i am getting this error when i was trying to use the jquery datepicker widget.Can you please help me to solve this issue?
[jQuery] Re: jQuery - Click function + Ajax
Off course, i forgot that hehe it is working great right now ;) About that, i really don't know, sometimes i need to use it this way, but you can try to validate using W3C tools On 2 Jul, 17:55, John Newman john.newma...@gmail.com wrote: You can't have 2 elements with the same id on the same page. Instead do a class=button and change your selector to use $(a.button). I would also recommend using a href= I'm kind of doing the same thing (i have a thread about it), is it safe to put event parameters in arbitrary attribute names? i.e.: td class=trigger record=${record.ID} paramX=${paramX} paramY=$ {paramY} isn't that invalid html and rejected by some browsers? or is that normal and just fine to do? On Jul 2, 12:44 pm, Glazz brunofgas...@live.com.pt wrote: Hi there, I have a hyperlink ( a ) after i click on that hyperlink, the script sends some data to a .php page; That works fine, but for just one hyperlink , i want to be able to have 2 or more hyperlinks in the same page using the same script. Here goes the script: $(#button).click(function(){ var element = this; var productId = $(element).attr('product'); //$(element).attr(href, javascript: void(0);); $.ajax({ type: GET, url: index.php, data: product= + productId }); }); HTML: a id=button rel=nofollow product=10 href=#testProduct 10/a a id=button rel=nofollow product=20 href=#testProduct 20/a
[jQuery] Re: Question on : syntax
Thanks a lot. The second response really helped me as I'm not so versed in hard core JavaScript. Obviously not being that well versed in it is hindering my ability to understand plug-in code, ability to distinguish between standard JavaScript notation/features vs. jQuery in the same file, and ability to understand jQuery a bit also. migrane every day until I get this stuff down, not as simply as everyone says. Yea jQuery is simple once you are a master at JavaScript and master of the jQuery language! I love that claim. On Jul 2, 1:00 pm, waseem sabjee waseemsab...@gmail.com wrote: lets go back to basic JavaScript. take this example var display = function() { // create namespace display return { hide : function(o) { // add function hide to namepsace var obj = document.getElementById(o); if(obj.style.display != 'none') { obj.style.display = 'none' } }, show : function(o) { // add function show to namespace var obj = document.getElementById(o); if(obj.style.display = 'none') { obj.style.display = 'block' } } }; }(); function init() { display.hide(mydiv); setTimeout(display.show('mydiv'), 1000);} window.onload = init; it is a more object orientated way of scripting as you can see i created my own namespace called display then i assigned two function to it display.hide and display.show so you can say your are creating your own namespae with it's own set of functions. the cool thing is if i create a namespace that controls sideshow behavior i can reuse my display namespace for the hide show transitions. On Thu, Jul 2, 2009 at 7:08 PM, expresso dschin...@gmail.com wrote: I have yet another syntax question. I know that : can be used for specifying things like filters, but what does it do in this case: $jc.fn.extend({ setup: function() { this.first = null; this.last = null; this.prevFirst = null; this.prevLast = null; this.animating = false; this.timer = null; this.tail = null; this.inTail = false; if (this.locked) return; this.list.css(this.lt, this.pos(this.options.offset) + 'px'); ...rest of code here }, so what is the syntax setup: an attribute?
[jQuery] Re: Swapping attributes with attr
assuming $(trigger) is a valid selector, this should work: var theValue = $(trigger).find('input').val(); $(trigger).find('input').attr('id',theValue'); Sceneshift wrote: Hi, I am trying to swap two attributes around, I am trying to achieve something like this: $(trigger).find('input').attr({value: img_id, name: $(this).attr('id')}); As you can see, I am trying to swap the value of the name attribute with the value of the id attribute. The above code does not work, as $(this) is not input field object. Can anyone suggest a clean way in which I can do the above?
[jQuery] Re: Question on : syntax
what is meant by a namespace. I view namespace as like in .NET classes, is this the same concept? On Jul 2, 1:10 pm, expresso dschin...@gmail.com wrote: Thanks a lot. The second response really helped me as I'm not so versed in hard core JavaScript. Obviously not being that well versed in it is hindering my ability to understand plug-in code, ability to distinguish between standard JavaScript notation/features vs. jQuery in the same file, and ability to understand jQuery a bit also. migrane every day until I get this stuff down, not as simply as everyone says. Yea jQuery is simple once you are a master at JavaScript and master of the jQuery language! I love that claim. On Jul 2, 1:00 pm, waseem sabjee waseemsab...@gmail.com wrote: lets go back to basic JavaScript. take this example var display = function() { // create namespace display return { hide : function(o) { // add function hide to namepsace var obj = document.getElementById(o); if(obj.style.display != 'none') { obj.style.display = 'none' } }, show : function(o) { // add function show to namespace var obj = document.getElementById(o); if(obj.style.display = 'none') { obj.style.display = 'block' } } }; }(); function init() { display.hide(mydiv); setTimeout(display.show('mydiv'), 1000);} window.onload = init; it is a more object orientated way of scripting as you can see i created my own namespace called display then i assigned two function to it display.hide and display.show so you can say your are creating your own namespae with it's own set of functions. the cool thing is if i create a namespace that controls sideshow behavior i can reuse my display namespace for the hide show transitions. On Thu, Jul 2, 2009 at 7:08 PM, expresso dschin...@gmail.com wrote: I have yet another syntax question. I know that : can be used for specifying things like filters, but what does it do in this case: $jc.fn.extend({ setup: function() { this.first = null; this.last = null; this.prevFirst = null; this.prevLast = null; this.animating = false; this.timer = null; this.tail = null; this.inTail = false; if (this.locked) return; this.list.css(this.lt, this.pos(this.options.offset) + 'px'); ...rest of code here }, so what is the syntax setup: an attribute?
[jQuery] var $varname
what's the difference between: var varname var $varname obviously I think 2nd is a jQuery variable? If that's the case why should I care and where is the docs on that?
[jQuery] Re: Question on : syntax
i will use simple terms when i say namespace lets call our namespace bmw this should be a little simpler. someone decides to create bmw as namespace or brand name now one of the functions or perks of this is that you can paint it a certain color. you could say it's like create your own brand name and adding functions and perks to it that will attract people to use your brand. var bmw = function() { return { paint: function(color, o); var obj = document.getElementById(o); o.style.color = color; } }; }(); On Thu, Jul 2, 2009 at 8:10 PM, expresso dschin...@gmail.com wrote: Thanks a lot. The second response really helped me as I'm not so versed in hard core JavaScript. Obviously not being that well versed in it is hindering my ability to understand plug-in code, ability to distinguish between standard JavaScript notation/features vs. jQuery in the same file, and ability to understand jQuery a bit also. migrane every day until I get this stuff down, not as simply as everyone says. Yea jQuery is simple once you are a master at JavaScript and master of the jQuery language! I love that claim. On Jul 2, 1:00 pm, waseem sabjee waseemsab...@gmail.com wrote: lets go back to basic JavaScript. take this example var display = function() { // create namespace display return { hide : function(o) { // add function hide to namepsace var obj = document.getElementById(o); if(obj.style.display != 'none') { obj.style.display = 'none' } }, show : function(o) { // add function show to namespace var obj = document.getElementById(o); if(obj.style.display = 'none') { obj.style.display = 'block' } } }; }(); function init() { display.hide(mydiv); setTimeout(display.show('mydiv'), 1000);} window.onload = init; it is a more object orientated way of scripting as you can see i created my own namespace called display then i assigned two function to it display.hide and display.show so you can say your are creating your own namespae with it's own set of functions. the cool thing is if i create a namespace that controls sideshow behavior i can reuse my display namespace for the hide show transitions. On Thu, Jul 2, 2009 at 7:08 PM, expresso dschin...@gmail.com wrote: I have yet another syntax question. I know that : can be used for specifying things like filters, but what does it do in this case: $jc.fn.extend({ setup: function() { this.first = null; this.last = null; this.prevFirst = null; this.prevLast = null; this.animating = false; this.timer = null; this.tail = null; this.inTail= false; if (this.locked) return; this.list.css(this.lt, this.pos(this.options.offset) + 'px'); ...rest of code here }, so what is the syntax setup:an attribute?
[jQuery] Re: Question on : syntax
it is similar do dotnet yes JS == var mynamespace = function() { return { hide : function(o) { var obj = document.getElementById(o); o.style.display = 'none' } } }(); dot net C# == namespace mynamespace { void hideElemen(string elementName)t { elementName.visibility = false; } } On Thu, Jul 2, 2009 at 8:15 PM, expresso dschin...@gmail.com wrote: what is meant by a namespace. I view namespace as like in .NET classes, is this the same concept? On Jul 2, 1:10 pm, expresso dschin...@gmail.com wrote: Thanks a lot. The second response really helped me as I'm not so versed in hard core JavaScript. Obviously not being that well versed in it is hindering my ability to understand plug-in code, ability to distinguish between standard JavaScript notation/features vs. jQuery in the same file, and ability to understand jQuery a bit also. migrane every day until I get this stuff down, not as simply as everyone says. Yea jQuery is simple once you are a master at JavaScript and master of the jQuery language! I love that claim. On Jul 2, 1:00 pm, waseem sabjee waseemsab...@gmail.com wrote: lets go back to basic JavaScript. take this example var display = function() { // create namespace display return { hide : function(o) { // add function hide to namepsace var obj = document.getElementById(o); if(obj.style.display != 'none') { obj.style.display = 'none' } }, show : function(o) { // add function show to namespace var obj = document.getElementById(o); if(obj.style.display = 'none') { obj.style.display = 'block' } } }; }(); function init() { display.hide(mydiv); setTimeout(display.show('mydiv'), 1000);} window.onload = init; it is a more object orientated way of scripting as you can see i created my own namespace called display then i assigned two function to it display.hide and display.show so you can say your are creating your own namespae with it's own set of functions. the cool thing is if i create a namespace that controls sideshow behavior i can reuse my display namespace for the hide show transitions. On Thu, Jul 2, 2009 at 7:08 PM, expresso dschin...@gmail.com wrote: I have yet another syntax question. I know that : can be used for specifying things like filters, but what does it do in this case: $jc.fn.extend({ setup: function() { this.first = null; this.last = null; this.prevFirst = null; this.prevLast = null; this.animating = false; this.timer = null; this.tail = null; this.inTail= false; if (this.locked) return; this.list.css(this.lt, this.pos(this.options.offset) + 'px'); ...rest of code here }, so what is the syntax setup:an attribute?
[jQuery] Re: Question on : syntax
correction to my dotnet cod namespace mynamespace { public class myclass{ void hideElemen(string elementName)t { elementName.visibility = false; } } } } On Thu, Jul 2, 2009 at 8:21 PM, waseem sabjee waseemsab...@gmail.comwrote: it is similar do dotnet yes JS == var mynamespace = function() { return { hide : function(o) { var obj = document.getElementById(o); o.style.display = 'none' } } }(); dot net C# == namespace mynamespace { void hideElemen(string elementName)t { elementName.visibility = false; } } On Thu, Jul 2, 2009 at 8:15 PM, expresso dschin...@gmail.com wrote: what is meant by a namespace. I view namespace as like in .NET classes, is this the same concept? On Jul 2, 1:10 pm, expresso dschin...@gmail.com wrote: Thanks a lot. The second response really helped me as I'm not so versed in hard core JavaScript. Obviously not being that well versed in it is hindering my ability to understand plug-in code, ability to distinguish between standard JavaScript notation/features vs. jQuery in the same file, and ability to understand jQuery a bit also. migrane every day until I get this stuff down, not as simply as everyone says. Yea jQuery is simple once you are a master at JavaScript and master of the jQuery language! I love that claim. On Jul 2, 1:00 pm, waseem sabjee waseemsab...@gmail.com wrote: lets go back to basic JavaScript. take this example var display = function() { // create namespace display return { hide : function(o) { // add function hide to namepsace var obj = document.getElementById(o); if(obj.style.display != 'none') { obj.style.display = 'none' } }, show : function(o) { // add function show to namespace var obj = document.getElementById(o); if(obj.style.display = 'none') { obj.style.display = 'block' } } }; }(); function init() { display.hide(mydiv); setTimeout(display.show('mydiv'), 1000);} window.onload = init; it is a more object orientated way of scripting as you can see i created my own namespace called display then i assigned two function to it display.hide and display.show so you can say your are creating your own namespae with it's own set of functions. the cool thing is if i create a namespace that controls sideshow behavior i can reuse my display namespace for the hide show transitions. On Thu, Jul 2, 2009 at 7:08 PM, expresso dschin...@gmail.com wrote: I have yet another syntax question. I know that : can be used for specifying things like filters, but what does it do in this case: $jc.fn.extend({ setup: function() { this.first = null; this.last = null; this.prevFirst = null; this.prevLast = null; this.animating = false; this.timer = null; this.tail = null; this.inTail= false; if (this.locked) return; this.list.css(this.lt, this.pos(this.options.offset) + 'px'); ...rest of code here }, so what is the syntax setup:an attribute?
[jQuery] Re: var $varname
its not really a jquery variable in standard js you can say var $myvar = hello; and var myvar = hello; both will work the same you can access jquery using either the $ or JQuery like $(#myid).hide(); JQuery(#myid).hide(); in a line of the JQuery library code you would see something like JQuery = window.JQuery = window.$ ... your could say its like short hand code instead of saying JQuery() al the time you can just say $() On Thu, Jul 2, 2009 at 8:18 PM, expresso dschin...@gmail.com wrote: what's the difference between: var varname var $varname obviously I think 2nd is a jQuery variable? If that's the case why should I care and where is the docs on that?
[jQuery] Re: var $varname
Just to addon to what Waseem here has said: When you are using the default jQuery library, the variable $ is set to the value of jQuery, which creates a shortcut for you so that you don't have to keep typing jQuery everytime you want to access it, you can just type $. cheers Michael Lawson Development Lead, Global Solutions, ibm.com Phone: 1-276-206-8393 E-mail: mjlaw...@us.ibm.com 'Examine my teachings critically, as a gold assayer would test gold. If you find they make sense, conform to your experience, and don't harm yourself or others, only then should you accept them.' From: waseem sabjee waseemsab...@gmail.com To: jquery-en@googlegroups.com Date: 07/02/2009 02:26 PM Subject:[jQuery] Re: var $varname its not really a jquery variable in standard js you can say var $myvar = hello; and var myvar = hello; both will work the same you can access jquery using either the $ or JQuery like $(#myid).hide(); JQuery(#myid).hide(); in a line of the JQuery library code you would see something like JQuery = window.JQuery = window.$ ... your could say its like short hand code instead of saying JQuery() al the time you can just say $() On Thu, Jul 2, 2009 at 8:18 PM, expresso dschin...@gmail.com wrote: what's the difference between: var varname var $varname obviously I think 2nd is a jQuery variable? If that's the case why should I care and where is the docs on that? inline: graycol.gifinline: ecblank.gif
[jQuery] Re: superfish and Lokesh Dhakar's lightbox2 seem to conflict - please help
was trying to look at the navbar and didn't see protoype script there one problem is you have 2 versions of jquery.js loading, one with each plugin. That can cause problems. Keep the top one, delete bottom one. See if that helps. If menu problem persists seeing a version with no other scripts running might help if you use prototye put the jQuery.noConflict() right at beginning of the script tag with $(document).ready and place it before $(document).ready, then you have to change all "$" used for jQuery functions to "jQuery". JayD wrote: Hi, Firstly, really like Superfish! Also should mention I'm a complete noob when it comes to _javascript_ code. Have successfully implemented the out-of-the-box Superfish nav-bar style within this website though - it's temporarily located here http://www.the2jays.com/index.php (note this site is still very much under construction, styling is still yet to be done (including the nav bar) and the site-wide build is only partially uploaded to the remote server). The site is a partial rebuild/ redesign and the old site used Lokesh Dhakar's lightbox2 on a number of pages (page contents on the new site are to remain the same as the old). On pages that reference the lightbox2 script (using 'Prototype _javascript_ framework - version 1.4.0') a slight conflict with the desired rendering of the Superfish nav-bar seems to occur - example page http://www.the2jays.com/news/papua-new-guinea001.php Lightbox2 seems to still work fine and so does Superfish mostly, however the PHP if statement generating the current class tab on the top level 'News' button is lost/ missing and the second tier level button row has greater space between it and the top level than desired (while on this page mouse-over a different top level button to see what I mean). Hope the above makes sense. When I turn off script type="text/_javascript_" src=""/script in the head section of the page Superfish appears perfect so I'm assuming it's got something to do with the prototype framework ? I've looked at 'jQuery with Other Libraries' but as a noob this is over-my-head atm http://docs.jquery.com/Using_jQuery_with_Other_Libraries and to be honest I'm not sure if I'm on the right track. Did also try turning 'Lokesh Dhakar's lightbox2' off and used 'jQuery Lightbox 0.5' instead thinking the two jQuery scripts should work together. The same problem still occurred however. Anyway, thought at this point I should probably post here and see if someone can assist me. Thanks in advance. JayD
[jQuery] input validation
is there a way to prevent user from adding more characters into a text input based on a validation rule(eg. you entered more than n words, you can't enter more, but you can delete or edit)? I think I'll have to programmatically delete the extra letter(s) that user just input somehow if the addition causes a violation of the rule, is this the best way? thanks
[jQuery] Re: var $varname
obviously I think 2nd is a jQuery variable? If that's the case why should I care and where is the docs on that? It just seems to be common practice by a lot of jQuery people smarter than us to signify it's a jQuery object stored in that variable, it has zero to do with jQuery itself per se On Jul 2, 2:29 pm, Michael Lawson mjlaw...@us.ibm.com wrote: Just to addon to what Waseem here has said: When you are using the default jQuery library, the variable $ is set to the value of jQuery, which creates a shortcut for you so that you don't have to keep typing jQuery everytime you want to access it, you can just type $. cheers Michael Lawson Development Lead, Global Solutions, ibm.com Phone: 1-276-206-8393 E-mail: mjlaw...@us.ibm.com 'Examine my teachings critically, as a gold assayer would test gold. If you find they make sense, conform to your experience, and don't harm yourself or others, only then should you accept them.' From: waseem sabjee waseemsab...@gmail.com To: jquery-en@googlegroups.com Date: 07/02/2009 02:26 PM Subject: [jQuery] Re: var $varname its not really a jquery variable in standard js you can say var $myvar = hello; and var myvar = hello; both will work the same you can access jquery using either the $ or JQuery like $(#myid).hide(); JQuery(#myid).hide(); in a line of the JQuery library code you would see something like JQuery = window.JQuery = window.$ ... your could say its like short hand code instead of saying JQuery() al the time you can just say $() On Thu, Jul 2, 2009 at 8:18 PM, expresso dschin...@gmail.com wrote: what's the difference between: var varname var $varname obviously I think 2nd is a jQuery variable? If that's the case why should I care and where is the docs on that? graycol.gif 1KViewDownload ecblank.gif 1KViewDownload
[jQuery] Re: var $varname
Yep, as MorningZ said, it's a good practice to use it to differentiate those that are storing a jQuery object. $myDiv = $(#div_1); $myDiv.hide(); It's easier to tell that you're working with a jQuery object. Otherwise, it's just a regular variable. On Jul 2, 8:51 am, MorningZ morni...@gmail.com wrote: obviously I think 2nd is a jQuery variable? If that's the case why should I care and where is the docs on that? It just seems to be common practice by a lot of jQuery people smarter than us to signify it's a jQuery object stored in that variable, it has zero to do with jQuery itself per se On Jul 2, 2:29 pm, Michael Lawson mjlaw...@us.ibm.com wrote: Just to addon to what Waseem here has said: When you are using the default jQuery library, the variable $ is set to the value of jQuery, which creates a shortcut for you so that you don't have to keep typing jQuery everytime you want to access it, you can just type $. cheers Michael Lawson Development Lead, Global Solutions, ibm.com Phone: 1-276-206-8393 E-mail: mjlaw...@us.ibm.com 'Examine my teachings critically, as a gold assayer would test gold. If you find they make sense, conform to your experience, and don't harm yourself or others, only then should you accept them.' From: waseem sabjee waseemsab...@gmail.com To: jquery-en@googlegroups.com Date: 07/02/2009 02:26 PM Subject: [jQuery] Re: var $varname its not really a jquery variable in standard js you can say var $myvar = hello; and var myvar = hello; both will work the same you can access jquery using either the $ or JQuery like $(#myid).hide(); JQuery(#myid).hide(); in a line of the JQuery library code you would see something like JQuery = window.JQuery = window.$ ... your could say its like short hand code instead of saying JQuery() al the time you can just say $() On Thu, Jul 2, 2009 at 8:18 PM, expresso dschin...@gmail.com wrote: what's the difference between: var varname var $varname obviously I think 2nd is a jQuery variable? If that's the case why should I care and where is the docs on that? graycol.gif 1KViewDownload ecblank.gif 1KViewDownload
[jQuery] Re: var $varname
I understand the shortcut. But in this example, it appears to just be a variable here. So why did they even bother putting a $ in front of it! ?? On Jul 2, 1:57 pm, James james.gp@gmail.com wrote: Yep, as MorningZ said, it's a good practice to use it to differentiate those that are storing a jQuery object. $myDiv = $(#div_1); $myDiv.hide(); It's easier to tell that you're working with a jQuery object. Otherwise, it's just a regular variable. On Jul 2, 8:51 am, MorningZ morni...@gmail.com wrote: obviously I think 2nd is a jQuery variable? If that's the case why should I care and where is the docs on that? It just seems to be common practice by a lot of jQuery people smarter than us to signify it's a jQuery object stored in that variable, it has zero to do with jQuery itself per se On Jul 2, 2:29 pm, Michael Lawson mjlaw...@us.ibm.com wrote: Just to addon to what Waseem here has said: When you are using the default jQuery library, the variable $ is set to the value of jQuery, which creates a shortcut for you so that you don't have to keep typing jQuery everytime you want to access it, you can just type $. cheers Michael Lawson Development Lead, Global Solutions, ibm.com Phone: 1-276-206-8393 E-mail: mjlaw...@us.ibm.com 'Examine my teachings critically, as a gold assayer would test gold. If you find they make sense, conform to your experience, and don't harm yourself or others, only then should you accept them.' From: waseem sabjee waseemsab...@gmail.com To: jquery-en@googlegroups.com Date: 07/02/2009 02:26 PM Subject: [jQuery] Re: var $varname its not really a jquery variable in standard js you can say var $myvar = hello; and var myvar = hello; both will work the same you can access jquery using either the $ or JQuery like $(#myid).hide(); JQuery(#myid).hide(); in a line of the JQuery library code you would see something like JQuery = window.JQuery = window.$ ... your could say its like short hand code instead of saying JQuery() al the time you can just say $() On Thu, Jul 2, 2009 at 8:18 PM, expresso dschin...@gmail.com wrote: what's the difference between: var varname var $varname obviously I think 2nd is a jQuery variable? If that's the case why should I care and where is the docs on that? graycol.gif 1KViewDownload ecblank.gif 1KViewDownload