jQuery debugging
I'm trying to create a single html page with jQuery inside to interactively calculate a price total based upon the settings of other controls. It's a classic sort of make you order page. Can I get a familiar debugging experience like I'm used into in Visual Studio while writing this page and scripts? I haven't written any JavaScript for years and I have no idea what's available to help me these days. There must be some people in this group writing plain JavaScript or jQuery in their html pages, so what do you do to keep productive? Greg K
Re: jQuery debugging
Debugging in Visual Studio with IE, you can set breakpoints etc and step through your code like C#. If you use Chrome to run your app, the F12 developer tools is WAY better for debugging your Javascript. I switch back and forth depending what I want to do, and must say I prefer debugging in Chrome. Its not in Visual Studio though. On the plus side you could debug your code deployed to test environment... (directly in your browser not in your IDE). Firefox with Firebug used to be the way to go but I don't like it as much as Chrome so don't use it at all. On Tue, Jul 9, 2013 at 10:31 AM, Greg Keogh g...@mira.net wrote: I'm trying to create a single html page with jQuery inside to interactively calculate a price total based upon the settings of other controls. It's a classic sort of make you order page. Can I get a familiar debugging experience like I'm used into in Visual Studio while writing this page and scripts? I haven't written any JavaScript for years and I have no idea what's available to help me these days. There must be some people in this group writing plain JavaScript or jQuery in their html pages, so what do you do to keep productive? Greg K
Re: jQuery debugging
Chrome has by far the best debugging experience – very similar to how it works with .net – and its the same experience on each platform - (although osx makes you do unnatural acts with key combinations). I've found I've been writing code on the console to validate it, and its super easy for debugging ajax as well. Some very nice profiling things there as well – really lets you tune the rendering etc. I tried the tool chaining with VS and it was just too hard to make it work, although I do rate VS as the best JS editor (before sublime :) ) From: g...@mira.netmailto:g...@mira.net g...@mira.netmailto:g...@mira.net Reply-To: ozDotNet ozdotnet@ozdotnet.commailto:ozdotnet@ozdotnet.com Date: Tuesday, 9 July 2013 12:31 PM To: ozDotNet ozdotnet@ozdotnet.commailto:ozdotnet@ozdotnet.com Subject: jQuery debugging I'm trying to create a single html page with jQuery inside to interactively calculate a price total based upon the settings of other controls. It's a classic sort of make you order page. Can I get a familiar debugging experience like I'm used into in Visual Studio while writing this page and scripts? I haven't written any JavaScript for years and I have no idea what's available to help me these days. There must be some people in this group writing plain JavaScript or jQuery in their html pages, so what do you do to keep productive? Greg K
Re: jQuery debugging
Thank chaps, I'll have to look into Chrome, although I've never previously allowed it only my work machines because it's like a virus, everything from Google is like a virus. I would like to mention that in the previous hour I've been cobbling together my price-calc html page, I have needed to run a web search on how to code each individual line: set and get a checkbox, detect textbox changes, disable a control, set text in a span, etc. all absolutely fundamental things you need to do. The inconsistency and patternless quagmire is beyond human endurance. Did the inventors of JavaScript, jQuery and DOM invent this stuff to hamper the progress of the human race? The inventors of this mess should be hunted down if they're still alive and strangled with their own entrails. Examples that need a search for each line and I find absolutely no consistency at all (the first one is utterly cryptic): Is a checkbox checked -- $('chk1').is(':checked') Set text in a span -- $('#span1').text(thevalue) Set text in a textbox -- $('$text1').val(something) Disable a control -- $('radio1').attr('disabled', show) Even worse, most search results have screenloads of people arguing about what bit of sample code is correct. There are sometimes 6 suggestions of how to do a single thing, and 4 of them don't work. The official jQuery API server is offline which makes my experience even better. I'm sure I'll feel better once I can see some sort of pattern in the jQuery/DOM chaos. Greg K On 9 July 2013 13:04, Jorke Odolphi jo...@jorke.net wrote: Chrome has by far the best debugging experience – very similar to how it works with .net – and its the same experience on each platform - (although osx makes you do unnatural acts with key combinations). I've found I've been writing code on the console to validate it, and its super easy for debugging ajax as well. Some very nice profiling things there as well – really lets you tune the rendering etc. I tried the tool chaining with VS and it was just too hard to make it work, although I do rate VS as the best JS editor (before sublime :) ) From: g...@mira.net g...@mira.net Reply-To: ozDotNet ozdotnet@ozdotnet.com Date: Tuesday, 9 July 2013 12:31 PM To: ozDotNet ozdotnet@ozdotnet.com Subject: jQuery debugging I'm trying to create a single html page with jQuery inside to interactively calculate a price total based upon the settings of other controls. It's a classic sort of make you order page. Can I get a familiar debugging experience like I'm used into in Visual Studio while writing this page and scripts? I haven't written any JavaScript for years and I have no idea what's available to help me these days. There must be some people in this group writing plain JavaScript or jQuery in their html pages, so what do you do to keep productive? Greg K
Re: jQuery debugging
The biggest help I found was adding the libraries at the top of the js file in VS, like: /// reference path=https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.js; / Then the intellisense appears and you can guess the right setting about 80% of the time. From: g...@mira.netmailto:g...@mira.net g...@mira.netmailto:g...@mira.net Reply-To: ozDotNet ozdotnet@ozdotnet.commailto:ozdotnet@ozdotnet.com Date: Tuesday, 9 July 2013 1:38 PM To: ozDotNet ozdotnet@ozdotnet.commailto:ozdotnet@ozdotnet.com Subject: Re: jQuery debugging Thank chaps, I'll have to look into Chrome, although I've never previously allowed it only my work machines because it's like a virus, everything from Google is like a virus. I would like to mention that in the previous hour I've been cobbling together my price-calc html page, I have needed to run a web search on how to code each individual line: set and get a checkbox, detect textbox changes, disable a control, set text in a span, etc. all absolutely fundamental things you need to do. The inconsistency and patternless quagmire is beyond human endurance. Did the inventors of JavaScript, jQuery and DOM invent this stuff to hamper the progress of the human race? The inventors of this mess should be hunted down if they're still alive and strangled with their own entrails. Examples that need a search for each line and I find absolutely no consistency at all (the first one is utterly cryptic): Is a checkbox checked -- $('chk1').is(':checked') Set text in a span -- $('#span1').text(thevalue) Set text in a textbox -- $('$text1').val(something) Disable a control -- $('radio1').attr('disabled', show) Even worse, most search results have screenloads of people arguing about what bit of sample code is correct. There are sometimes 6 suggestions of how to do a single thing, and 4 of them don't work. The official jQuery API server is offline which makes my experience even better. I'm sure I'll feel better once I can see some sort of pattern in the jQuery/DOM chaos. Greg K On 9 July 2013 13:04, Jorke Odolphi jo...@jorke.netmailto:jo...@jorke.net wrote: Chrome has by far the best debugging experience – very similar to how it works with .net – and its the same experience on each platform - (although osx makes you do unnatural acts with key combinations). I've found I've been writing code on the console to validate it, and its super easy for debugging ajax as well. Some very nice profiling things there as well – really lets you tune the rendering etc. I tried the tool chaining with VS and it was just too hard to make it work, although I do rate VS as the best JS editor (before sublime :) ) From: g...@mira.netmailto:g...@mira.net g...@mira.netmailto:g...@mira.net Reply-To: ozDotNet ozdotnet@ozdotnet.commailto:ozdotnet@ozdotnet.com Date: Tuesday, 9 July 2013 12:31 PM To: ozDotNet ozdotnet@ozdotnet.commailto:ozdotnet@ozdotnet.com Subject: jQuery debugging I'm trying to create a single html page with jQuery inside to interactively calculate a price total based upon the settings of other controls. It's a classic sort of make you order page. Can I get a familiar debugging experience like I'm used into in Visual Studio while writing this page and scripts? I haven't written any JavaScript for years and I have no idea what's available to help me these days. There must be some people in this group writing plain JavaScript or jQuery in their html pages, so what do you do to keep productive? Greg K
Re: jQuery debugging
My brother works on the chrome team. Are you saying there is something improper about the work he is doing? On 9 Jul 2013 13:38, Greg Keogh g...@mira.net wrote: Thank chaps, I'll have to look into Chrome, although I've never previously allowed it only my work machines because it's like a virus, everything from Google is like a virus. I would like to mention that in the previous hour I've been cobbling together my price-calc html page, I have needed to run a web search on how to code each individual line: set and get a checkbox, detect textbox changes, disable a control, set text in a span, etc. all absolutely fundamental things you need to do. The inconsistency and patternless quagmire is beyond human endurance. Did the inventors of JavaScript, jQuery and DOM invent this stuff to hamper the progress of the human race? The inventors of this mess should be hunted down if they're still alive and strangled with their own entrails. Examples that need a search for each line and I find absolutely no consistency at all (the first one is utterly cryptic): Is a checkbox checked -- $('chk1').is(':checked') Set text in a span -- $('#span1').text(thevalue) Set text in a textbox -- $('$text1').val(something) Disable a control -- $('radio1').attr('disabled', show) Even worse, most search results have screenloads of people arguing about what bit of sample code is correct. There are sometimes 6 suggestions of how to do a single thing, and 4 of them don't work. The official jQuery API server is offline which makes my experience even better. I'm sure I'll feel better once I can see some sort of pattern in the jQuery/DOM chaos. Greg K On 9 July 2013 13:04, Jorke Odolphi jo...@jorke.net wrote: Chrome has by far the best debugging experience – very similar to how it works with .net – and its the same experience on each platform - (although osx makes you do unnatural acts with key combinations). I've found I've been writing code on the console to validate it, and its super easy for debugging ajax as well. Some very nice profiling things there as well – really lets you tune the rendering etc. I tried the tool chaining with VS and it was just too hard to make it work, although I do rate VS as the best JS editor (before sublime :) ) From: g...@mira.net g...@mira.net Reply-To: ozDotNet ozdotnet@ozdotnet.com Date: Tuesday, 9 July 2013 12:31 PM To: ozDotNet ozdotnet@ozdotnet.com Subject: jQuery debugging I'm trying to create a single html page with jQuery inside to interactively calculate a price total based upon the settings of other controls. It's a classic sort of make you order page. Can I get a familiar debugging experience like I'm used into in Visual Studio while writing this page and scripts? I haven't written any JavaScript for years and I have no idea what's available to help me these days. There must be some people in this group writing plain JavaScript or jQuery in their html pages, so what do you do to keep productive? Greg K
Re: jQuery debugging
My brother works on the chrome team. Are you saying there is something improper about the work he is doing? If he's responsible for JavaScript, the DOM or jQuery then it's his roast intestines for dinner ;-) -- Greg
Re: jQuery debugging
Learn to love the web and javascript as there's a hidden beauty once you've mastered it. On Tue, Jul 9, 2013 at 2:21 PM, Stephen Price step...@perthprojects.comwrote: My brother also works at Google. Are you saying he is a virus writer? One could argue the same about Microsoft. And Yahoo. And Facebook. And Insert large organisation. Perhaps you are against large corporations, and capitalism? Jealousy? It sounds like you are frustrated with things that don't work as you expect them. I see a number of alternatives for you. 1. Don't use them. Write it all yourself. Oh, what's that? it would take too long? Hmm.. quite a dilemma you have there... Standing on the shoulders of giants, using the fantastic work that fellow humans have created (with the mix of quality that goes with said complex systems) is a double edged sword. Yes, you get the bugs, but you also get the hundreds and thousands of man hours that went into it. Choose. 2. Retire. If you long for the simple days of when you could code from a book on the shelf, and that book contained all there was to know, then you are out of luck. Those days are gone. They are inventing this stuff faster than anyone can learn it all. Almost daily, I turn and find some new tool or framework or something exciting and new and shiny. And the next day something I was using is dead and buried. (I'm looking at you Silverlight). 3. Suck it up and roll with the punches. This job is fun and exciting, and often at times, frustrating. But I love it and wouldn't give it up for anything else. I don't know it all, and never will. I love learning new things and strive for personal improvement. Writing code is becoming more expensive because it is becoming more complicated. Embrace change and do the best you can. Flower where you are planted. (my favourite motto). Don't forget to stop and eat the roses. :) On Tue, Jul 9, 2013 at 12:04 PM, Joseph Cooney joseph.coo...@gmail.comwrote: My brother works on the chrome team. Are you saying there is something improper about the work he is doing? On 9 Jul 2013 13:38, Greg Keogh g...@mira.net wrote: Thank chaps, I'll have to look into Chrome, although I've never previously allowed it only my work machines because it's like a virus, everything from Google is like a virus. I would like to mention that in the previous hour I've been cobbling together my price-calc html page, I have needed to run a web search on how to code each individual line: set and get a checkbox, detect textbox changes, disable a control, set text in a span, etc. all absolutely fundamental things you need to do. The inconsistency and patternless quagmire is beyond human endurance. Did the inventors of JavaScript, jQuery and DOM invent this stuff to hamper the progress of the human race? The inventors of this mess should be hunted down if they're still alive and strangled with their own entrails. Examples that need a search for each line and I find absolutely no consistency at all (the first one is utterly cryptic): Is a checkbox checked -- $('chk1').is(':checked') Set text in a span -- $('#span1').text(thevalue) Set text in a textbox -- $('$text1').val(something) Disable a control -- $('radio1').attr('disabled', show) Even worse, most search results have screenloads of people arguing about what bit of sample code is correct. There are sometimes 6 suggestions of how to do a single thing, and 4 of them don't work. The official jQuery API server is offline which makes my experience even better. I'm sure I'll feel better once I can see some sort of pattern in the jQuery/DOM chaos. Greg K On 9 July 2013 13:04, Jorke Odolphi jo...@jorke.net wrote: Chrome has by far the best debugging experience – very similar to how it works with .net – and its the same experience on each platform - (although osx makes you do unnatural acts with key combinations). I've found I've been writing code on the console to validate it, and its super easy for debugging ajax as well. Some very nice profiling things there as well – really lets you tune the rendering etc. I tried the tool chaining with VS and it was just too hard to make it work, although I do rate VS as the best JS editor (before sublime :) ) From: g...@mira.net g...@mira.net Reply-To: ozDotNet ozdotnet@ozdotnet.com Date: Tuesday, 9 July 2013 12:31 PM To: ozDotNet ozdotnet@ozdotnet.com Subject: jQuery debugging I'm trying to create a single html page with jQuery inside to interactively calculate a price total based upon the settings of other controls. It's a classic sort of make you order page. Can I get a familiar debugging experience like I'm used into in Visual Studio while writing this page and scripts? I haven't written any JavaScript for years and I have no idea what's available to help me these days. There must be some people in this group writing plain JavaScript or jQuery in their html pages, so what do you do to keep productive
Re: jQuery debugging
Stephen, you've nailed almost everything that giving me the irrates: Things don't work as I expect. I don't want to write it myself. There are lots of bugs. You can't just learn something from a book. People are inventing stuff too fast (without coordination or quality control). The shiny thing of today is buried tomorrow. Writing code is more expensive. Things are more complicated. I can't afford to retire. I've been rolling with the punches since things got bad (about 6 years ago I reckon). I should point out that I come from a long background in computing/IT where things worked, things were documented, standards were adhered to, there was all-around consistency and order ruled. Where are headed now? Perhaps I'm being sentimental or too demanding. Greg
Re: jQuery debugging
The beauty of Javascript is well hidden. Touché! -- Greg
Re: jQuery debugging
Reminds me of a saying, Unix is user friendly. It's just selective on who its friends are. :) On Tue, Jul 9, 2013 at 12:42 PM, Greg Keogh g...@mira.net wrote: The beauty of Javascript is well hidden. Touché! -- Greg
Re: jQuery debugging
Things don't work as I expect. Works fine for me :) I don't want to write it myself. There are lots of bugs. How is there bugs? You can't just learn something from a book. Kinda of a crappy way to learn anyway, slow and dated, learn from github that's better. People are inventing stuff too fast (without coordination or quality control). I think people are experimenting fast and throwing out what doesn't work The shiny thing of today is buried tomorrow. that happens more in proprietary software not the open web Writing code is more expensive. writing code does not cost money ;) Things are more complicated. Oh come'on what about MFC or assembly I can't afford to retire. Maybe we should have been bankers? On Tue, Jul 9, 2013 at 2:40 PM, Greg Keogh g...@mira.net wrote: Stephen, you've nailed almost everything that giving me the irrates: Things don't work as I expect. I don't want to write it myself. There are lots of bugs. You can't just learn something from a book. People are inventing stuff too fast (without coordination or quality control). The shiny thing of today is buried tomorrow. Writing code is more expensive. Things are more complicated. I can't afford to retire. I've been rolling with the punches since things got bad (about 6 years ago I reckon). I should point out that I come from a long background in computing/IT where things worked, things were documented, standards were adhered to, there was all-around consistency and order ruled. Where are headed now? Perhaps I'm being sentimental or too demanding. Greg
RE: jQuery debugging
Spent most of another life working with it. I came the conclusion that the manual was easy to read and clear as long as you’d read the entire manual first :) Regards, Greg Dr Greg Low 1300SQLSQL (1300 775 775) office | +61 419201410 mobile│ +61 3 8676 4913 fax SQL Down Under | Web: http://www.sqldownunder.com/ www.sqldownunder.com From: ozdotnet-boun...@ozdotnet.com [mailto:ozdotnet-boun...@ozdotnet.com] On Behalf Of Stephen Price Sent: Tuesday, 9 July 2013 2:53 PM To: ozDotNet Subject: Re: jQuery debugging Reminds me of a saying, Unix is user friendly. It's just selective on who its friends are. :) On Tue, Jul 9, 2013 at 12:42 PM, Greg Keogh g...@mira.net mailto:g...@mira.net wrote: The beauty of Javascript is well hidden. Touché! -- Greg
Re: jQuery debugging
It's easy to love the lovable things about something (or someone) True love is acceptance. Love the things that are hard to love and you will be happy in your relationship with your coding. If something isn't working for you, change it. If you can't change it, then change how you think of it. I love mixing Ontology into code. :) On Tue, Jul 9, 2013 at 12:40 PM, Greg Keogh g...@mira.net wrote: Stephen, you've nailed almost everything that giving me the irrates: Things don't work as I expect. I don't want to write it myself. There are lots of bugs. You can't just learn something from a book. People are inventing stuff too fast (without coordination or quality control). The shiny thing of today is buried tomorrow. Writing code is more expensive. Things are more complicated. I can't afford to retire. I've been rolling with the punches since things got bad (about 6 years ago I reckon). I should point out that I come from a long background in computing/IT where things worked, things were documented, standards were adhered to, there was all-around consistency and order ruled. Where are headed now? Perhaps I'm being sentimental or too demanding. Greg
Re: jQuery debugging
Things don't work as I expect. Works fine for me :) You're kidding. I've already told my family that my headstone will be engraved with Everything f***ing doesn't work. Greg
Re: jQuery debugging
Stephen, you're turning into some sort of Khalil Gibranhttp://www.brainyquote.com/quotes/authors/k/khalil_gibran.htmlof the computer world -- Greg
Re: jQuery debugging
On 9 July 2013 14:57, Stephen Price step...@perthprojects.com wrote: If something isn't working for you, change it. If you can't change it, then change how you think of it. The first part is what makes engineers, second is path to the enlightenment. Cheers
Re: jQuery debugging
I was discussing reading the manuals with some friends recently when I showed them some books I had kept from the 70s and 80s. Some of them got into IT by doodling with Turbo Pascal and making some stuff without reading any manuals, then they got the programming bug and ran with it, as I did earlier with punch cards! Unlike my friends, I tended to want to read the docs first before diving in and bumbling around. I like to go in prepared and as a result I'm an inveterate manual reader even these days. Some people prefer to futz and learn that way. People seem quite divided on this. I'd like to try parachuting, but rather than just throw a parachute on and jump out of plane to see how it goes, I'd like to read the manual first. Greg
Re: jQuery debugging
Tried pycharm? It's excellent far better than visual studio for js and comes from jet brains so can get the resharper visual studio key bindings for shortcuts. Jet brains have a sale every now and then so worth grabbing next time they do. On 9 Jul 2013 04:04, Jorke Odolphi jo...@jorke.net wrote: Chrome has by far the best debugging experience – very similar to how it works with .net – and its the same experience on each platform - (although osx makes you do unnatural acts with key combinations). I've found I've been writing code on the console to validate it, and its super easy for debugging ajax as well. Some very nice profiling things there as well – really lets you tune the rendering etc. I tried the tool chaining with VS and it was just too hard to make it work, although I do rate VS as the best JS editor (before sublime :) ) From: g...@mira.net g...@mira.net Reply-To: ozDotNet ozdotnet@ozdotnet.com Date: Tuesday, 9 July 2013 12:31 PM To: ozDotNet ozdotnet@ozdotnet.com Subject: jQuery debugging I'm trying to create a single html page with jQuery inside to interactively calculate a price total based upon the settings of other controls. It's a classic sort of make you order page. Can I get a familiar debugging experience like I'm used into in Visual Studio while writing this page and scripts? I haven't written any JavaScript for years and I have no idea what's available to help me these days. There must be some people in this group writing plain JavaScript or jQuery in their html pages, so what do you do to keep productive? Greg K