+
+{% endif %}
\ No newline at end of file
diff --git a/.themes/classic/source/_includes/asides/github.html b/.themes/classic/source/_includes/asides/github.html
new file mode 100644
index 0000000..cb267f0
--- /dev/null
+++ b/.themes/classic/source/_includes/asides/github.html
@@ -0,0 +1,30 @@
+{% if site.github_user %}
+
+
GitHub Repos
+
+
Status updating...
+
+ {% if site.github_show_profile_link %}
+ @{{site.github_user}} on GitHub
+ {% endif %}
+
+
+
+{% endif %}
diff --git a/.themes/classic/source/_includes/asides/googleplus.html b/.themes/classic/source/_includes/asides/googleplus.html
new file mode 100644
index 0000000..00a0aa8
--- /dev/null
+++ b/.themes/classic/source/_includes/asides/googleplus.html
@@ -0,0 +1,11 @@
+{% if site.googleplus_user %}
+
+
diff --git a/.themes/classic/source/favicon.png b/.themes/classic/source/favicon.png
new file mode 100644
index 0000000..0f25067
Binary files /dev/null and b/.themes/classic/source/favicon.png differ
diff --git a/images/bird_32_gray.png b/.themes/classic/source/images/bird_32_gray.png
similarity index 100%
rename from images/bird_32_gray.png
rename to .themes/classic/source/images/bird_32_gray.png
diff --git a/images/bird_32_gray_fail.png b/.themes/classic/source/images/bird_32_gray_fail.png
similarity index 100%
rename from images/bird_32_gray_fail.png
rename to .themes/classic/source/images/bird_32_gray_fail.png
diff --git a/images/code_bg.png b/.themes/classic/source/images/code_bg.png
similarity index 100%
rename from images/code_bg.png
rename to .themes/classic/source/images/code_bg.png
diff --git a/images/dotted-border.png b/.themes/classic/source/images/dotted-border.png
similarity index 100%
rename from images/dotted-border.png
rename to .themes/classic/source/images/dotted-border.png
diff --git a/images/email.png b/.themes/classic/source/images/email.png
similarity index 100%
rename from images/email.png
rename to .themes/classic/source/images/email.png
diff --git a/images/line-tile.png b/.themes/classic/source/images/line-tile.png
similarity index 100%
rename from images/line-tile.png
rename to .themes/classic/source/images/line-tile.png
diff --git a/images/noise.png b/.themes/classic/source/images/noise.png
similarity index 100%
rename from images/noise.png
rename to .themes/classic/source/images/noise.png
diff --git a/images/rss.png b/.themes/classic/source/images/rss.png
similarity index 100%
rename from images/rss.png
rename to .themes/classic/source/images/rss.png
diff --git a/images/search.png b/.themes/classic/source/images/search.png
similarity index 100%
rename from images/search.png
rename to .themes/classic/source/images/search.png
diff --git a/.themes/classic/source/index.html b/.themes/classic/source/index.html
new file mode 100644
index 0000000..a114e5a
--- /dev/null
+++ b/.themes/classic/source/index.html
@@ -0,0 +1,29 @@
+---
+layout: default
+---
+
+
+ {% assign index = true %}
+ {% for post in paginator.posts %}
+ {% assign content = post.content %}
+
+ {% include article.html %}
+
+ {% endfor %}
+
+ {% if paginator.next_page %}
+ ← Older
+ {% endif %}
+ Blog Archives
+ {% if paginator.previous_page %}
+ Newer →
+ {% endif %}
+
+
+
diff --git a/javascripts/ender.js b/.themes/classic/source/javascripts/ender.js
similarity index 100%
rename from javascripts/ender.js
rename to .themes/classic/source/javascripts/ender.js
diff --git a/.themes/classic/source/javascripts/github.js b/.themes/classic/source/javascripts/github.js
new file mode 100644
index 0000000..9e98b8c
--- /dev/null
+++ b/.themes/classic/source/javascripts/github.js
@@ -0,0 +1,37 @@
+var github = (function(){
+ function render(target, repos){
+ var i = 0, fragment = '', t = $(target)[0];
+
+ for(i = 0; i < repos.length; i++) {
+ fragment += '
Debuggify is a simple cloud based full-stack debugging service which enhances the modern web development experience.
-
-
The Mission
-
-
Debugging software is hard and also time consuming process. Its involves a lot of advance technologies, techniques and tools. As the web is evolving faster than ever and so are the technologies involved in developing a website.
-
-
The websites have moved from static pages to complex web applications which depends on the following
-
-
-
Third party APIs like twitter, facebook, google etc
-
Third party libs/gems/npm/modules both in client side and server side
-
Third party Frameworks
-
-
-
-
With HTML5, CSS3, & ES6 the browsers are upgrading continuously. There is big diversity in the browser vendors. Even the different versions of same vendors doesn’t have similar behavior for same api.
-
-
Due to high dependency on third party and bleeding edge browser environment, makes web application development even more complex process.
-
-
We are dedicated to build easy to use tools and technologies which helps developers not only build great and robust applications but also boost their productivity.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/atom.xml b/atom.xml
deleted file mode 100644
index 4a9b63c..0000000
--- a/atom.xml
+++ /dev/null
@@ -1,469 +0,0 @@
-
-
-
-
-
-
- 2013-09-23T10:08:01+05:30
- http://developers.debuggify.net/
-
-
-
-
- Octopress
-
-
-
-
-
- 2013-07-25T04:44:00+05:30
- http://developers.debuggify.net/blog/2013/07/25/tracking-jquery-ajax-errors-and-exceptions
- The web had already shifted from static web pages to ajax driven websites for good. This shift have made the web awesome and faster but have introduced some new problems which need to taken care of . One of these is failed ajax requests. There are many reasons for a ajax request to fail, some of them are
-
-
-
Api End points are down or unreachable
-
Unauthorized / Invalid data requested
-
Some error happened at the API back-end
-
Edge cases are not handed properly in the code
-
-
-
-
Normally the ajax pull data from self hosted as well 3rd party hosted APIs. In both cases, the failure of ajax request has to handled at both ends, but front end is more important because of its high impact on the user experience. In case of 3rd party APIs, there is any way no possibility to have control over back-end, so front-end is the default choice.
-
-
The browser behaves differently when it comes to make a ajax calls for same origin and ajax call for cross origin, and therefore exceptional handling also have to different.
-
-
Same Origin
-
-
In jQuery, the simplest way to catch all the ajax errors and exceptions on a web page
-
-
$(document).ajaxError(function(event, jqXHR, ajaxSettings, thrownError) {
-
- // This is the default error handler for ajax request.
-
- // Extract all the information required to understand.
- var requestResponse = {
- url: ajaxSettings.url,
- method: ajaxSettings.type,
- data: ajaxSettings.data,
- httpStatus: jqXHR.status,
- error: thrownError || jqXHR.statusText,
- data: ajaxSettings.data
- };
-
- console.error(requestResponse)
-
- // Notify the user so he might not wonder.
- alert('Something went wrong, Please try again');
-
- // Report it back for fixing it
- // Only for debuggify users
- var ajaxErrors = debuggify.Logger.get('ajax_errors');
- ajaxErrors.attach(requestResponse);
- ajaxErrors.error('Caught ajax error');
-
-});
-
-
-
One important thing to note here is this handler is not called for cross-domain scripts and cross-domain JSONP requests which made its easy to avoid any ajax errors happening in application other than your native javascript code.
-
-
Note If $.ajax() or $.ajaxSetup() is called with the global option set to false, the .ajaxError() method will not fire.
-
-
Apart from this generic handler, it is possible to have a dedicated error handler for each type of request.
-
-
$.ajax({
-
- type: "POST",
- url: "https://api.twitter.com/1.1/statuses/user_timeline.json",
- error: function(jqXHR, textStatus,errorThrown) {
- var requestResponse = {
- httpStatus: jqXHR.status,
- error: thrownError || jqXHR.statusText,
- };
-
- console.log(requestResponse);
-
- // Notify the user so he might not wonder.
- alert('Something went wrong, Please try again');
-
-
- // Report it back for fixing it
- // Only for debuggify users
- var ajaxErrors = debuggify.Logger.get('ajax_errors');
- ajaxErrors.attach(requestResponse);
- ajaxErrors.error('Caught ajax error');
-
- }
-});
-
-
-
Event this dedicated handler is not called for cross-domain script and cross-domain JSONP requests.
-
-
Cross Origin
-
-
The limitation for ajax exception handlers is not just a jQuery limitation, but it is a javascript limitation. The reason behind this limitation is that most browser are not giving permissions to access error messages for cross domain scripts due to security reasons.
-
-
There are some solutions (or workarounds) for this. (Reference stackoverflow )
-
-
First one, if backend is accessible, set (in my example PHP) headers to allow a cross domain call. When you do this, then JavaScript accepts the call, and no crossdomain tricks are needed.
Secondly if there is no access to backend, a timeout based workaround can be used to get a error callback
-
-
$.ajax({
- type: "POST",
- url: "https://api.twitter.com/1.1/statuses/user_timeline.json",
- success: start_map,
- timeout: 2000, // 2 seconds timeout before error function will be called
- dataType: 'script',
- crossDomain: true
-});
-
-
-
This is a nasty trick to solve the problem as it can definitely screw up things for slow internet connection.
-
-
Another alternative option is using the jQuery plugin jquery-jsonp. This plugin is using script onload / onerror method along with timeout to get the error callback.
-]]>
-
-
-
-
-
- 2013-07-24T04:24:00+05:30
- http://developers.debuggify.net/blog/2013/07/24/new-apis-to-add-custom-data-points
- In the past we have received many requests related to attach some custom data along with every messages collected.
-
-
We have added this functionality, and to simplify it, we have come with 3 new APIs
-
-
The Alias API
-
-
Using this api, its possible to set an alias to the unique user identification used by the debuggify. This make it easy to map a debuggify user identifier to your site username or email id. Remember the old data will not have alias.
-
-
debuggify.alias('foo@example.com');
-
-
-
Its pretty straight forward to use the above api.
-
-
Note Make sure every unique user should be given the one alias to avoid any data inconsistency.
-
-
The Metadata API
-
-
To attach custom data along with every message
-
-
debuggify.metadata({'login': true});
-
-
-
The Attach API
-
-
To attach custom data along with a single message. This api need to be called on the logger object
-
-
var ajaxErrors = debuggify.Logger.get('ajax_errors');
-
-ajaxErrors.attach({
- type: 'POST',
- url: '/api/notification'
-});
-
-ajaxErrors.error('Error in Notification Api');
-
-
-
After calling attach, it must be followed by the one of the logging Apis like .log, .error, .warn, .debug or .message to push that data to the server.
-
-
Note: The attached data will expire after its once used by logging Api’s. To send data with every request use .metadata api
-
-
We soon be adding use cases on how to use this APIs more powerfully.
-]]>
-
-
-
-
-
- 2013-06-22T08:12:00+05:30
- http://developers.debuggify.net/blog/2013/06/22/error-in-javascript-comments
- Last week, I was writing code in javascript when I found something that completly blew off my mind. This is what I found
-
-
-
-
Yeah, IE thowing error in javascript comment. For some time I didnot believe what I am seeing, but gradually I came to my senses. Like most developers, first thing I did was started cursing IE on twitter, but later reality struct me and that is to find a solution to this mess.
-
-
I dig in a lot of wrong places until I found conditional comments in IE. A sample of how the conditional logic works is below
-
-
<script>
-/*@cc_on
-
- @if (@_jscript_version == 10)
- document.write("You are using IE10");
-
- @elif (@_jscript_version == 9)
- document.write("You are using IE9");
-
- @elif (@_jscript_version == 5.8)
- document.write("You are using IE8");
-
- @elif (@_jscript_version == 5.7 && window.XMLHttpRequest)
- document.write("You are using IE7");
-
- @elif (@_jscript_version == 5.6 || (@_jscript_version == 5.7 && !window.XMLHttpRequest))
- document.write("You are using IE6");
-
- @elif (@_jscript_version == 5.5)
- document.write("You are using IE5.5");
-
- @else
- document.write("You are using IE5 or older");
-
- @end
-
-@*/
-</script>
-
-
-
To fix this all I need to do is to remove the whole comment. This comment is anyways useful for sourcemaps supported browsers which is long way to go for IE.
Finally all I have to say is God Bless IE Developers
-]]>
-
-
-
-
-
- 2013-03-31T17:39:00+05:30
- http://developers.debuggify.net/blog/2013/03/31/debug-javascript-in-production
- Today I had great time sharing my experience on javascript debugging with the javascript ninja community at Bangalore
-
-
Here is the presentation
-
-
-
-
-
-
-
-
-
-
I will be explaining each point in details in the future posts.
-
-
I know I have abandoned the blog for long time but not any more. Stay connected for more.
-
-
Happy Debugging !!
-]]>
-
-
-
-
-
- 2012-11-26T13:18:00+05:30
- http://developers.debuggify.net/blog/2012/11/26/window-dot-onerror-is-not-enough
- Scott Hanselman blogged about JavaScript the assembly language for the web. There a plenty of languages that compiles to javascript. With the addition of Dart from Google and Typescript from Microsoft a war has broke out for better.
-
-
With the rise of compiled to javascript languages it hard to traceback the errors to original source. Almost all modern provides the window.onerror api to catch all uncaught exceptions on a page. This api provides very limited information (error message, filename and line number only) which is the root cause of many problems.
-
-
With modern web development practices the amount of javascript code per page is growing rapidly. Also this code is minified by the minification tools(like Google Closure Compiler, UglifyJS2 etc) to reduce the code size. After minification whole code ends in one single line. Here is where most problem starts. I am listing some really annoying issues related to window.onerror below
-
-
-
Missing Char No: The char no is very important for the minified code to point at the exact statement as there is only one line in minified code. Even source maps cannot be helpful in tracking back to original line.
-
No Call Stack: The call stack is completely hidden from the developer so its hard to identify the functions flow. However there is a trick to extract stack in IE9 only.
-
Cross Origin Errors: These types are thown when some cross origin permission is broken. They are very common on pages with facebook like and google plus widget installed. For such errors window.error message throw a single message “Script Error”. As per stackoverflow post this behavior is intentional to avoid some security risks but its at expense of useful debugging information.
-
-
-
-
Most of above mentioned problems are roadblock in debugging production websites / applications. There is a need for better tools and libraries for the job.
-
-
I will soon be writing a post on Best Debugging Practices For Javascript In Production Environment
-]]>
-
-
-
-
-
- 2012-08-07T12:10:00+05:30
- http://developers.debuggify.net/blog/2012/08/07/why-debuggify
- Who am I?
-
-
I was born 6 years back when I bought my first computer and a internet connection. To be frank, Internet is a second home to me. For most of people out there who feel same, are continuously trying to make Internet a better place.
-
-
I am also a computer science engineering grad, so I am surrounded by technology. In order to feed my engineering inquisitiveness I have explored the black, white and gray sections of the internet.
-
-
Where it all started?
-
-
I am a full stack web developer by profession and have authored / co-authored many 3rd party social plugins for Shareaholic Inc which runs on thousands of different blogs and websites driving 1+ billion pageviews per month. These plugins can be installed on different CMS/blogging platform like Wordpress, Drupal, Tumblr, Blogger etc. While working on these plugins I closely interact with the different elements of the modern internet ecosystem.
-
-
What’s my use case of 3rd party plugin ?
-
-
A 3rd party plugin has to be robust enough to work in 3rd party environments while interacting with 3rd party apis and support every major browser vendor out there
-
-
Elaborating the above quote
-
-
-
As plugins runs on 3rd party websites, it has to be robust so it doesn't break itself and neither the website
-
It has to be fast enough to deliver good page load time
-
It should not conflict with other existing plugins
-
It should support major browser vendors including internet explorer
-
It should also support legacy browser versions like ie6 ie7 etc.
-
As plugins interact with over 200+ 3rd party apis, it’s hard to keep track when something break
-
It should be easy to setup with multiple cms/blogging environments for better distribution
-
-
-
-
Technical challenges faced ?
-
-
-
In 3rd party environment, developers have limited or no control over things, so it’s hard to debug and reproduce bugs / issues
-
If some plugin feature is not working its hard to know whether
-
-
-
it’s not working for a particular website,
-
or not working for a set of URLs
-
or for a particular CMS/Blogging environment
-
or for a particular screen resolution
-
or for a particular browser vendor
-
or even for a particular version of a browser vendor
-
or for all cases
-
-
-
Its hard to judge the impact of every release, whether it fixed the problem or introduced some new side effects
-
The 3rd party API’s are continuously changing, upgrading & depreciating. Companies like Facebook, Google, Twitter are continuously bashing developers with bleeding edges of their API’s
-
With HTML5, ES Harmony and CSS3, browsers are evolving faster than ever, so they are also releasing bleeding edge features and API’s
-
-
-
-
Who else is facing problems?
-
-
As all wise developers know
-
-
Zero Bugs is a Myth
-
-
I have talked to a few friends about the problems. All are encountering similar set of problems on the daily basic. A majority their development time is spend in debugging and fixing bugs. The debugging is also becoming hard due to the evolving nature of the web.
-
-
What to do about it?
-
-
So I finally decided to go on a quest to make Internet a better place for developers.
-
-
Why Developers ?
-
-
Developers are the keepers of the modern internet.
-
-
The web is evolving because of the developers. There are around 1+ million developers on the planet. I can build something that make developers more productive and can save up to 1hr/day of their time, it’s going to be revolutionary. Developers can reinvest this time in open source projects, new innovations or anything that eventually make Internet a better place
-
-
So that is Debuggify is all about. Contact me if you want to join me on my quest.
I was born 6 years back when I bought my first computer and a internet connection. To be frank, Internet is a second home to me. For most of people out there who feel same, are continuously trying to make Internet a better place.
-
-
I am also a computer science engineering grad, so I am surrounded by technology. In order to feed my engineering inquisitiveness I have explored the black, white and gray sections of the internet.
-
-
Where it all started?
-
-
I am a full stack web developer by profession and have authored / co-authored many 3rd party social plugins for Shareaholic Inc which runs on thousands of different blogs and websites driving 1+ billion pageviews per month. These plugins can be installed on different CMS/blogging platform like Wordpress, Drupal, Tumblr, Blogger etc. While working on these plugins I closely interact with the different elements of the modern internet ecosystem.
-
-
What’s my use case of 3rd party plugin ?
-
-
A 3rd party plugin has to be robust enough to work in 3rd party environments while interacting with 3rd party apis and support every major browser vendor out there
-
-
Elaborating the above quote
-
-
-
As plugins runs on 3rd party websites, it has to be robust so it doesn't break itself and neither the website
-
It has to be fast enough to deliver good page load time
-
It should not conflict with other existing plugins
-
It should support major browser vendors including internet explorer
-
It should also support legacy browser versions like ie6 ie7 etc.
-
As plugins interact with over 200+ 3rd party apis, it’s hard to keep track when something break
-
It should be easy to setup with multiple cms/blogging environments for better distribution
-
-
-
-
Technical challenges faced ?
-
-
-
In 3rd party environment, developers have limited or no control over things, so it’s hard to debug and reproduce bugs / issues
-
If some plugin feature is not working its hard to know whether
-
-
-
it’s not working for a particular website,
-
or not working for a set of URLs
-
or for a particular CMS/Blogging environment
-
or for a particular screen resolution
-
or for a particular browser vendor
-
or even for a particular version of a browser vendor
-
or for all cases
-
-
-
Its hard to judge the impact of every release, whether it fixed the problem or introduced some new side effects
-
The 3rd party API’s are continuously changing, upgrading & depreciating. Companies like Facebook, Google, Twitter are continuously bashing developers with bleeding edges of their API’s
-
With HTML5, ES Harmony and CSS3, browsers are evolving faster than ever, so they are also releasing bleeding edge features and API’s
-
-
-
-
Who else is facing problems?
-
-
As all wise developers know
-
-
Zero Bugs is a Myth
-
-
I have talked to a few friends about the problems. All are encountering similar set of problems on the daily basic. A majority their development time is spend in debugging and fixing bugs. The debugging is also becoming hard due to the evolving nature of the web.
-
-
What to do about it?
-
-
So I finally decided to go on a quest to make Internet a better place for developers.
-
-
Why Developers ?
-
-
Developers are the keepers of the modern internet.
-
-
The web is evolving because of the developers. There are around 1+ million developers on the planet. I can build something that make developers more productive and can save up to 1hr/day of their time, it’s going to be revolutionary. Developers can reinvest this time in open source projects, new innovations or anything that eventually make Internet a better place
-
-
So that is Debuggify is all about. Contact me if you want to join me on my quest.
With the rise of compiled to javascript languages it hard to traceback the errors to original source. Almost all modern provides the window.onerror api to catch all uncaught exceptions on a page. This api provides very limited information (error message, filename and line number only) which is the root cause of many problems.
-
-
With modern web development practices the amount of javascript code per page is growing rapidly. Also this code is minified by the minification tools(like Google Closure Compiler, UglifyJS2 etc) to reduce the code size. After minification whole code ends in one single line. Here is where most problem starts. I am listing some really annoying issues related to window.onerror below
-
-
-
Missing Char No: The char no is very important for the minified code to point at the exact statement as there is only one line in minified code. Even source maps cannot be helpful in tracking back to original line.
-
No Call Stack: The call stack is completely hidden from the developer so its hard to identify the functions flow. However there is a trick to extract stack in IE9 only.
-
Cross Origin Errors: These types are thown when some cross origin permission is broken. They are very common on pages with facebook like and google plus widget installed. For such errors window.error message throw a single message “Script Error”. As per stackoverflow post this behavior is intentional to avoid some security risks but its at expense of useful debugging information.
-
-
-
-
Most of above mentioned problems are roadblock in debugging production websites / applications. There is a need for better tools and libraries for the job.
-
-
I will soon be writing a post on Best Debugging Practices For Javascript In Production Environment
Last week, I was writing code in javascript when I found something that completly blew off my mind. This is what I found
-
-
-
-
Yeah, IE thowing error in javascript comment. For some time I didnot believe what I am seeing, but gradually I came to my senses. Like most developers, first thing I did was started cursing IE on twitter, but later reality struct me and that is to find a solution to this mess.
-
-
I dig in a lot of wrong places until I found conditional comments in IE. A sample of how the conditional logic works is below
-
-
<script>
-/*@cc_on
-
- @if (@_jscript_version == 10)
- document.write("You are using IE10");
-
- @elif (@_jscript_version == 9)
- document.write("You are using IE9");
-
- @elif (@_jscript_version == 5.8)
- document.write("You are using IE8");
-
- @elif (@_jscript_version == 5.7 && window.XMLHttpRequest)
- document.write("You are using IE7");
-
- @elif (@_jscript_version == 5.6 || (@_jscript_version == 5.7 && !window.XMLHttpRequest))
- document.write("You are using IE6");
-
- @elif (@_jscript_version == 5.5)
- document.write("You are using IE5.5");
-
- @else
- document.write("You are using IE5 or older");
-
- @end
-
-@*/
-</script>
-
-
-
To fix this all I need to do is to remove the whole comment. This comment is anyways useful for sourcemaps supported browsers which is long way to go for IE.
In the past we have received many requests related to attach some custom data along with every messages collected.
-
-
We have added this functionality, and to simplify it, we have come with 3 new APIs
-
-
The Alias API
-
-
Using this api, its possible to set an alias to the unique user identification used by the debuggify. This make it easy to map a debuggify user identifier to your site username or email id. Remember the old data will not have alias.
-
-
debuggify.alias('foo@example.com');
-
-
-
Its pretty straight forward to use the above api.
-
-
Note Make sure every unique user should be given the one alias to avoid any data inconsistency.
-
-
The Metadata API
-
-
To attach custom data along with every message
-
-
debuggify.metadata({'login': true});
-
-
-
The Attach API
-
-
To attach custom data along with a single message. This api need to be called on the logger object
-
-
var ajaxErrors = debuggify.Logger.get('ajax_errors');
-
-ajaxErrors.attach({
- type: 'POST',
- url: '/api/notification'
-});
-
-ajaxErrors.error('Error in Notification Api');
-
-
-
After calling attach, it must be followed by the one of the logging Apis like .log, .error, .warn, .debug or .message to push that data to the server.
-
-
Note: The attached data will expire after its once used by logging Api’s. To send data with every request use .metadata api
-
-
We soon be adding use cases on how to use this APIs more powerfully.
The web had already shifted from static web pages to ajax driven websites for good. This shift have made the web awesome and faster but have introduced some new problems which need to taken care of . One of these is failed ajax requests. There are many reasons for a ajax request to fail, some of them are
-
-
-
Api End points are down or unreachable
-
Unauthorized / Invalid data requested
-
Some error happened at the API back-end
-
Edge cases are not handed properly in the code
-
-
-
-
Normally the ajax pull data from self hosted as well 3rd party hosted APIs. In both cases, the failure of ajax request has to handled at both ends, but front end is more important because of its high impact on the user experience. In case of 3rd party APIs, there is any way no possibility to have control over back-end, so front-end is the default choice.
-
-
The browser behaves differently when it comes to make a ajax calls for same origin and ajax call for cross origin, and therefore exceptional handling also have to different.
-
-
Same Origin
-
-
In jQuery, the simplest way to catch all the ajax errors and exceptions on a web page
-
-
$(document).ajaxError(function(event, jqXHR, ajaxSettings, thrownError) {
-
- // This is the default error handler for ajax request.
-
- // Extract all the information required to understand.
- var requestResponse = {
- url: ajaxSettings.url,
- method: ajaxSettings.type,
- data: ajaxSettings.data,
- httpStatus: jqXHR.status,
- error: thrownError || jqXHR.statusText,
- data: ajaxSettings.data
- };
-
- console.error(requestResponse)
-
- // Notify the user so he might not wonder.
- alert('Something went wrong, Please try again');
-
- // Report it back for fixing it
- // Only for debuggify users
- var ajaxErrors = debuggify.Logger.get('ajax_errors');
- ajaxErrors.attach(requestResponse);
- ajaxErrors.error('Caught ajax error');
-
-});
-
-
-
One important thing to note here is this handler is not called for cross-domain scripts and cross-domain JSONP requests which made its easy to avoid any ajax errors happening in application other than your native javascript code.
-
-
Note If $.ajax() or $.ajaxSetup() is called with the global option set to false, the .ajaxError() method will not fire.
-
-
Apart from this generic handler, it is possible to have a dedicated error handler for each type of request.
-
-
$.ajax({
-
- type: "POST",
- url: "https://api.twitter.com/1.1/statuses/user_timeline.json",
- error: function(jqXHR, textStatus,errorThrown) {
- var requestResponse = {
- httpStatus: jqXHR.status,
- error: thrownError || jqXHR.statusText,
- };
-
- console.log(requestResponse);
-
- // Notify the user so he might not wonder.
- alert('Something went wrong, Please try again');
-
-
- // Report it back for fixing it
- // Only for debuggify users
- var ajaxErrors = debuggify.Logger.get('ajax_errors');
- ajaxErrors.attach(requestResponse);
- ajaxErrors.error('Caught ajax error');
-
- }
-});
-
-
-
Event this dedicated handler is not called for cross-domain script and cross-domain JSONP requests.
-
-
Cross Origin
-
-
The limitation for ajax exception handlers is not just a jQuery limitation, but it is a javascript limitation. The reason behind this limitation is that most browser are not giving permissions to access error messages for cross domain scripts due to security reasons.
-
-
There are some solutions (or workarounds) for this. (Reference stackoverflow )
-
-
First one, if backend is accessible, set (in my example PHP) headers to allow a cross domain call. When you do this, then JavaScript accepts the call, and no crossdomain tricks are needed.
Secondly if there is no access to backend, a timeout based workaround can be used to get a error callback
-
-
$.ajax({
- type: "POST",
- url: "https://api.twitter.com/1.1/statuses/user_timeline.json",
- success: start_map,
- timeout: 2000, // 2 seconds timeout before error function will be called
- dataType: 'script',
- crossDomain: true
-});
-
-
-
This is a nasty trick to solve the problem as it can definitely screw up things for slow internet connection.
-
-
Another alternative option is using the jQuery plugin jquery-jsonp. This plugin is using script onload / onerror method along with timeout to get the error callback.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/blog/categories/ajax/atom.xml b/blog/categories/ajax/atom.xml
deleted file mode 100644
index d25555c..0000000
--- a/blog/categories/ajax/atom.xml
+++ /dev/null
@@ -1,130 +0,0 @@
-
-
-
-
-
-
- 2013-09-23T10:08:01+05:30
- http://developers.debuggify.net/
-
-
-
-
- Octopress
-
-
-
-
-
- 2013-07-25T04:44:00+05:30
- http://developers.debuggify.net/blog/2013/07/25/tracking-jquery-ajax-errors-and-exceptions
- The web had already shifted from static web pages to ajax driven websites for good. This shift have made the web awesome and faster but have introduced some new problems which need to taken care of . One of these is failed ajax requests. There are many reasons for a ajax request to fail, some of them are
-
-
-
Api End points are down or unreachable
-
Unauthorized / Invalid data requested
-
Some error happened at the API back-end
-
Edge cases are not handed properly in the code
-
-
-
-
Normally the ajax pull data from self hosted as well 3rd party hosted APIs. In both cases, the failure of ajax request has to handled at both ends, but front end is more important because of its high impact on the user experience. In case of 3rd party APIs, there is any way no possibility to have control over back-end, so front-end is the default choice.
-
-
The browser behaves differently when it comes to make a ajax calls for same origin and ajax call for cross origin, and therefore exceptional handling also have to different.
-
-
Same Origin
-
-
In jQuery, the simplest way to catch all the ajax errors and exceptions on a web page
-
-
$(document).ajaxError(function(event, jqXHR, ajaxSettings, thrownError) {
-
- // This is the default error handler for ajax request.
-
- // Extract all the information required to understand.
- var requestResponse = {
- url: ajaxSettings.url,
- method: ajaxSettings.type,
- data: ajaxSettings.data,
- httpStatus: jqXHR.status,
- error: thrownError || jqXHR.statusText,
- data: ajaxSettings.data
- };
-
- console.error(requestResponse)
-
- // Notify the user so he might not wonder.
- alert('Something went wrong, Please try again');
-
- // Report it back for fixing it
- // Only for debuggify users
- var ajaxErrors = debuggify.Logger.get('ajax_errors');
- ajaxErrors.attach(requestResponse);
- ajaxErrors.error('Caught ajax error');
-
-});
-
-
-
One important thing to note here is this handler is not called for cross-domain scripts and cross-domain JSONP requests which made its easy to avoid any ajax errors happening in application other than your native javascript code.
-
-
Note If $.ajax() or $.ajaxSetup() is called with the global option set to false, the .ajaxError() method will not fire.
-
-
Apart from this generic handler, it is possible to have a dedicated error handler for each type of request.
-
-
$.ajax({
-
- type: "POST",
- url: "https://api.twitter.com/1.1/statuses/user_timeline.json",
- error: function(jqXHR, textStatus,errorThrown) {
- var requestResponse = {
- httpStatus: jqXHR.status,
- error: thrownError || jqXHR.statusText,
- };
-
- console.log(requestResponse);
-
- // Notify the user so he might not wonder.
- alert('Something went wrong, Please try again');
-
-
- // Report it back for fixing it
- // Only for debuggify users
- var ajaxErrors = debuggify.Logger.get('ajax_errors');
- ajaxErrors.attach(requestResponse);
- ajaxErrors.error('Caught ajax error');
-
- }
-});
-
-
-
Event this dedicated handler is not called for cross-domain script and cross-domain JSONP requests.
-
-
Cross Origin
-
-
The limitation for ajax exception handlers is not just a jQuery limitation, but it is a javascript limitation. The reason behind this limitation is that most browser are not giving permissions to access error messages for cross domain scripts due to security reasons.
-
-
There are some solutions (or workarounds) for this. (Reference stackoverflow )
-
-
First one, if backend is accessible, set (in my example PHP) headers to allow a cross domain call. When you do this, then JavaScript accepts the call, and no crossdomain tricks are needed.
Secondly if there is no access to backend, a timeout based workaround can be used to get a error callback
-
-
$.ajax({
- type: "POST",
- url: "https://api.twitter.com/1.1/statuses/user_timeline.json",
- success: start_map,
- timeout: 2000, // 2 seconds timeout before error function will be called
- dataType: 'script',
- crossDomain: true
-});
-
-
-
This is a nasty trick to solve the problem as it can definitely screw up things for slow internet connection.
-
-
Another alternative option is using the jQuery plugin jquery-jsonp. This plugin is using script onload / onerror method along with timeout to get the error callback.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/blog/categories/catch/atom.xml b/blog/categories/catch/atom.xml
deleted file mode 100644
index 8044dd7..0000000
--- a/blog/categories/catch/atom.xml
+++ /dev/null
@@ -1,130 +0,0 @@
-
-
-
-
-
-
- 2013-09-23T10:08:01+05:30
- http://developers.debuggify.net/
-
-
-
-
- Octopress
-
-
-
-
-
- 2013-07-25T04:44:00+05:30
- http://developers.debuggify.net/blog/2013/07/25/tracking-jquery-ajax-errors-and-exceptions
- The web had already shifted from static web pages to ajax driven websites for good. This shift have made the web awesome and faster but have introduced some new problems which need to taken care of . One of these is failed ajax requests. There are many reasons for a ajax request to fail, some of them are
-
-
-
Api End points are down or unreachable
-
Unauthorized / Invalid data requested
-
Some error happened at the API back-end
-
Edge cases are not handed properly in the code
-
-
-
-
Normally the ajax pull data from self hosted as well 3rd party hosted APIs. In both cases, the failure of ajax request has to handled at both ends, but front end is more important because of its high impact on the user experience. In case of 3rd party APIs, there is any way no possibility to have control over back-end, so front-end is the default choice.
-
-
The browser behaves differently when it comes to make a ajax calls for same origin and ajax call for cross origin, and therefore exceptional handling also have to different.
-
-
Same Origin
-
-
In jQuery, the simplest way to catch all the ajax errors and exceptions on a web page
-
-
$(document).ajaxError(function(event, jqXHR, ajaxSettings, thrownError) {
-
- // This is the default error handler for ajax request.
-
- // Extract all the information required to understand.
- var requestResponse = {
- url: ajaxSettings.url,
- method: ajaxSettings.type,
- data: ajaxSettings.data,
- httpStatus: jqXHR.status,
- error: thrownError || jqXHR.statusText,
- data: ajaxSettings.data
- };
-
- console.error(requestResponse)
-
- // Notify the user so he might not wonder.
- alert('Something went wrong, Please try again');
-
- // Report it back for fixing it
- // Only for debuggify users
- var ajaxErrors = debuggify.Logger.get('ajax_errors');
- ajaxErrors.attach(requestResponse);
- ajaxErrors.error('Caught ajax error');
-
-});
-
-
-
One important thing to note here is this handler is not called for cross-domain scripts and cross-domain JSONP requests which made its easy to avoid any ajax errors happening in application other than your native javascript code.
-
-
Note If $.ajax() or $.ajaxSetup() is called with the global option set to false, the .ajaxError() method will not fire.
-
-
Apart from this generic handler, it is possible to have a dedicated error handler for each type of request.
-
-
$.ajax({
-
- type: "POST",
- url: "https://api.twitter.com/1.1/statuses/user_timeline.json",
- error: function(jqXHR, textStatus,errorThrown) {
- var requestResponse = {
- httpStatus: jqXHR.status,
- error: thrownError || jqXHR.statusText,
- };
-
- console.log(requestResponse);
-
- // Notify the user so he might not wonder.
- alert('Something went wrong, Please try again');
-
-
- // Report it back for fixing it
- // Only for debuggify users
- var ajaxErrors = debuggify.Logger.get('ajax_errors');
- ajaxErrors.attach(requestResponse);
- ajaxErrors.error('Caught ajax error');
-
- }
-});
-
-
-
Event this dedicated handler is not called for cross-domain script and cross-domain JSONP requests.
-
-
Cross Origin
-
-
The limitation for ajax exception handlers is not just a jQuery limitation, but it is a javascript limitation. The reason behind this limitation is that most browser are not giving permissions to access error messages for cross domain scripts due to security reasons.
-
-
There are some solutions (or workarounds) for this. (Reference stackoverflow )
-
-
First one, if backend is accessible, set (in my example PHP) headers to allow a cross domain call. When you do this, then JavaScript accepts the call, and no crossdomain tricks are needed.
Secondly if there is no access to backend, a timeout based workaround can be used to get a error callback
-
-
$.ajax({
- type: "POST",
- url: "https://api.twitter.com/1.1/statuses/user_timeline.json",
- success: start_map,
- timeout: 2000, // 2 seconds timeout before error function will be called
- dataType: 'script',
- crossDomain: true
-});
-
-
-
This is a nasty trick to solve the problem as it can definitely screw up things for slow internet connection.
-
-
Another alternative option is using the jQuery plugin jquery-jsonp. This plugin is using script onload / onerror method along with timeout to get the error callback.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/blog/categories/comments/atom.xml b/blog/categories/comments/atom.xml
deleted file mode 100644
index c3d3d31..0000000
--- a/blog/categories/comments/atom.xml
+++ /dev/null
@@ -1,67 +0,0 @@
-
-
-
-
-
-
- 2013-09-23T10:08:01+05:30
- http://developers.debuggify.net/
-
-
-
-
- Octopress
-
-
-
-
-
- 2013-06-22T08:12:00+05:30
- http://developers.debuggify.net/blog/2013/06/22/error-in-javascript-comments
- Last week, I was writing code in javascript when I found something that completly blew off my mind. This is what I found
-
-
-
-
Yeah, IE thowing error in javascript comment. For some time I didnot believe what I am seeing, but gradually I came to my senses. Like most developers, first thing I did was started cursing IE on twitter, but later reality struct me and that is to find a solution to this mess.
-
-
I dig in a lot of wrong places until I found conditional comments in IE. A sample of how the conditional logic works is below
-
-
<script>
-/*@cc_on
-
- @if (@_jscript_version == 10)
- document.write("You are using IE10");
-
- @elif (@_jscript_version == 9)
- document.write("You are using IE9");
-
- @elif (@_jscript_version == 5.8)
- document.write("You are using IE8");
-
- @elif (@_jscript_version == 5.7 && window.XMLHttpRequest)
- document.write("You are using IE7");
-
- @elif (@_jscript_version == 5.6 || (@_jscript_version == 5.7 && !window.XMLHttpRequest))
- document.write("You are using IE6");
-
- @elif (@_jscript_version == 5.5)
- document.write("You are using IE5.5");
-
- @else
- document.write("You are using IE5 or older");
-
- @end
-
-@*/
-</script>
-
-
-
To fix this all I need to do is to remove the whole comment. This comment is anyways useful for sourcemaps supported browsers which is long way to go for IE.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/blog/categories/cross-origin/atom.xml b/blog/categories/cross-origin/atom.xml
deleted file mode 100644
index aa96164..0000000
--- a/blog/categories/cross-origin/atom.xml
+++ /dev/null
@@ -1,130 +0,0 @@
-
-
-
-
-
-
- 2013-09-23T10:08:01+05:30
- http://developers.debuggify.net/
-
-
-
-
- Octopress
-
-
-
-
-
- 2013-07-25T04:44:00+05:30
- http://developers.debuggify.net/blog/2013/07/25/tracking-jquery-ajax-errors-and-exceptions
- The web had already shifted from static web pages to ajax driven websites for good. This shift have made the web awesome and faster but have introduced some new problems which need to taken care of . One of these is failed ajax requests. There are many reasons for a ajax request to fail, some of them are
-
-
-
Api End points are down or unreachable
-
Unauthorized / Invalid data requested
-
Some error happened at the API back-end
-
Edge cases are not handed properly in the code
-
-
-
-
Normally the ajax pull data from self hosted as well 3rd party hosted APIs. In both cases, the failure of ajax request has to handled at both ends, but front end is more important because of its high impact on the user experience. In case of 3rd party APIs, there is any way no possibility to have control over back-end, so front-end is the default choice.
-
-
The browser behaves differently when it comes to make a ajax calls for same origin and ajax call for cross origin, and therefore exceptional handling also have to different.
-
-
Same Origin
-
-
In jQuery, the simplest way to catch all the ajax errors and exceptions on a web page
-
-
$(document).ajaxError(function(event, jqXHR, ajaxSettings, thrownError) {
-
- // This is the default error handler for ajax request.
-
- // Extract all the information required to understand.
- var requestResponse = {
- url: ajaxSettings.url,
- method: ajaxSettings.type,
- data: ajaxSettings.data,
- httpStatus: jqXHR.status,
- error: thrownError || jqXHR.statusText,
- data: ajaxSettings.data
- };
-
- console.error(requestResponse)
-
- // Notify the user so he might not wonder.
- alert('Something went wrong, Please try again');
-
- // Report it back for fixing it
- // Only for debuggify users
- var ajaxErrors = debuggify.Logger.get('ajax_errors');
- ajaxErrors.attach(requestResponse);
- ajaxErrors.error('Caught ajax error');
-
-});
-
-
-
One important thing to note here is this handler is not called for cross-domain scripts and cross-domain JSONP requests which made its easy to avoid any ajax errors happening in application other than your native javascript code.
-
-
Note If $.ajax() or $.ajaxSetup() is called with the global option set to false, the .ajaxError() method will not fire.
-
-
Apart from this generic handler, it is possible to have a dedicated error handler for each type of request.
-
-
$.ajax({
-
- type: "POST",
- url: "https://api.twitter.com/1.1/statuses/user_timeline.json",
- error: function(jqXHR, textStatus,errorThrown) {
- var requestResponse = {
- httpStatus: jqXHR.status,
- error: thrownError || jqXHR.statusText,
- };
-
- console.log(requestResponse);
-
- // Notify the user so he might not wonder.
- alert('Something went wrong, Please try again');
-
-
- // Report it back for fixing it
- // Only for debuggify users
- var ajaxErrors = debuggify.Logger.get('ajax_errors');
- ajaxErrors.attach(requestResponse);
- ajaxErrors.error('Caught ajax error');
-
- }
-});
-
-
-
Event this dedicated handler is not called for cross-domain script and cross-domain JSONP requests.
-
-
Cross Origin
-
-
The limitation for ajax exception handlers is not just a jQuery limitation, but it is a javascript limitation. The reason behind this limitation is that most browser are not giving permissions to access error messages for cross domain scripts due to security reasons.
-
-
There are some solutions (or workarounds) for this. (Reference stackoverflow )
-
-
First one, if backend is accessible, set (in my example PHP) headers to allow a cross domain call. When you do this, then JavaScript accepts the call, and no crossdomain tricks are needed.
Secondly if there is no access to backend, a timeout based workaround can be used to get a error callback
-
-
$.ajax({
- type: "POST",
- url: "https://api.twitter.com/1.1/statuses/user_timeline.json",
- success: start_map,
- timeout: 2000, // 2 seconds timeout before error function will be called
- dataType: 'script',
- crossDomain: true
-});
-
-
-
This is a nasty trick to solve the problem as it can definitely screw up things for slow internet connection.
-
-
Another alternative option is using the jQuery plugin jquery-jsonp. This plugin is using script onload / onerror method along with timeout to get the error callback.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/blog/categories/custom-data/atom.xml b/blog/categories/custom-data/atom.xml
deleted file mode 100644
index 4f2e740..0000000
--- a/blog/categories/custom-data/atom.xml
+++ /dev/null
@@ -1,65 +0,0 @@
-
-
-
-
-
-
- 2013-09-23T10:08:01+05:30
- http://developers.debuggify.net/
-
-
-
-
- Octopress
-
-
-
-
-
- 2013-07-24T04:24:00+05:30
- http://developers.debuggify.net/blog/2013/07/24/new-apis-to-add-custom-data-points
- In the past we have received many requests related to attach some custom data along with every messages collected.
-
-
We have added this functionality, and to simplify it, we have come with 3 new APIs
-
-
The Alias API
-
-
Using this api, its possible to set an alias to the unique user identification used by the debuggify. This make it easy to map a debuggify user identifier to your site username or email id. Remember the old data will not have alias.
-
-
debuggify.alias('foo@example.com');
-
-
-
Its pretty straight forward to use the above api.
-
-
Note Make sure every unique user should be given the one alias to avoid any data inconsistency.
-
-
The Metadata API
-
-
To attach custom data along with every message
-
-
debuggify.metadata({'login': true});
-
-
-
The Attach API
-
-
To attach custom data along with a single message. This api need to be called on the logger object
-
-
var ajaxErrors = debuggify.Logger.get('ajax_errors');
-
-ajaxErrors.attach({
- type: 'POST',
- url: '/api/notification'
-});
-
-ajaxErrors.error('Error in Notification Api');
-
-
-
After calling attach, it must be followed by the one of the logging Apis like .log, .error, .warn, .debug or .message to push that data to the server.
-
-
Note: The attached data will expire after its once used by logging Api’s. To send data with every request use .metadata api
-
-
We soon be adding use cases on how to use this APIs more powerfully.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/blog/categories/debug/atom.xml b/blog/categories/debug/atom.xml
deleted file mode 100644
index 4e4fa89..0000000
--- a/blog/categories/debug/atom.xml
+++ /dev/null
@@ -1,130 +0,0 @@
-
-
-
-
-
-
- 2013-09-23T10:08:01+05:30
- http://developers.debuggify.net/
-
-
-
-
- Octopress
-
-
-
-
-
- 2013-07-25T04:44:00+05:30
- http://developers.debuggify.net/blog/2013/07/25/tracking-jquery-ajax-errors-and-exceptions
- The web had already shifted from static web pages to ajax driven websites for good. This shift have made the web awesome and faster but have introduced some new problems which need to taken care of . One of these is failed ajax requests. There are many reasons for a ajax request to fail, some of them are
-
-
-
Api End points are down or unreachable
-
Unauthorized / Invalid data requested
-
Some error happened at the API back-end
-
Edge cases are not handed properly in the code
-
-
-
-
Normally the ajax pull data from self hosted as well 3rd party hosted APIs. In both cases, the failure of ajax request has to handled at both ends, but front end is more important because of its high impact on the user experience. In case of 3rd party APIs, there is any way no possibility to have control over back-end, so front-end is the default choice.
-
-
The browser behaves differently when it comes to make a ajax calls for same origin and ajax call for cross origin, and therefore exceptional handling also have to different.
-
-
Same Origin
-
-
In jQuery, the simplest way to catch all the ajax errors and exceptions on a web page
-
-
$(document).ajaxError(function(event, jqXHR, ajaxSettings, thrownError) {
-
- // This is the default error handler for ajax request.
-
- // Extract all the information required to understand.
- var requestResponse = {
- url: ajaxSettings.url,
- method: ajaxSettings.type,
- data: ajaxSettings.data,
- httpStatus: jqXHR.status,
- error: thrownError || jqXHR.statusText,
- data: ajaxSettings.data
- };
-
- console.error(requestResponse)
-
- // Notify the user so he might not wonder.
- alert('Something went wrong, Please try again');
-
- // Report it back for fixing it
- // Only for debuggify users
- var ajaxErrors = debuggify.Logger.get('ajax_errors');
- ajaxErrors.attach(requestResponse);
- ajaxErrors.error('Caught ajax error');
-
-});
-
-
-
One important thing to note here is this handler is not called for cross-domain scripts and cross-domain JSONP requests which made its easy to avoid any ajax errors happening in application other than your native javascript code.
-
-
Note If $.ajax() or $.ajaxSetup() is called with the global option set to false, the .ajaxError() method will not fire.
-
-
Apart from this generic handler, it is possible to have a dedicated error handler for each type of request.
-
-
$.ajax({
-
- type: "POST",
- url: "https://api.twitter.com/1.1/statuses/user_timeline.json",
- error: function(jqXHR, textStatus,errorThrown) {
- var requestResponse = {
- httpStatus: jqXHR.status,
- error: thrownError || jqXHR.statusText,
- };
-
- console.log(requestResponse);
-
- // Notify the user so he might not wonder.
- alert('Something went wrong, Please try again');
-
-
- // Report it back for fixing it
- // Only for debuggify users
- var ajaxErrors = debuggify.Logger.get('ajax_errors');
- ajaxErrors.attach(requestResponse);
- ajaxErrors.error('Caught ajax error');
-
- }
-});
-
-
-
Event this dedicated handler is not called for cross-domain script and cross-domain JSONP requests.
-
-
Cross Origin
-
-
The limitation for ajax exception handlers is not just a jQuery limitation, but it is a javascript limitation. The reason behind this limitation is that most browser are not giving permissions to access error messages for cross domain scripts due to security reasons.
-
-
There are some solutions (or workarounds) for this. (Reference stackoverflow )
-
-
First one, if backend is accessible, set (in my example PHP) headers to allow a cross domain call. When you do this, then JavaScript accepts the call, and no crossdomain tricks are needed.
Secondly if there is no access to backend, a timeout based workaround can be used to get a error callback
-
-
$.ajax({
- type: "POST",
- url: "https://api.twitter.com/1.1/statuses/user_timeline.json",
- success: start_map,
- timeout: 2000, // 2 seconds timeout before error function will be called
- dataType: 'script',
- crossDomain: true
-});
-
-
-
This is a nasty trick to solve the problem as it can definitely screw up things for slow internet connection.
-
-
Another alternative option is using the jQuery plugin jquery-jsonp. This plugin is using script onload / onerror method along with timeout to get the error callback.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/blog/categories/debugging/atom.xml b/blog/categories/debugging/atom.xml
deleted file mode 100644
index 4c63fee..0000000
--- a/blog/categories/debugging/atom.xml
+++ /dev/null
@@ -1,90 +0,0 @@
-
-
-
-
-
-
- 2013-09-23T10:08:01+05:30
- http://developers.debuggify.net/
-
-
-
-
- Octopress
-
-
-
-
-
- 2013-07-24T04:24:00+05:30
- http://developers.debuggify.net/blog/2013/07/24/new-apis-to-add-custom-data-points
- In the past we have received many requests related to attach some custom data along with every messages collected.
-
-
We have added this functionality, and to simplify it, we have come with 3 new APIs
-
-
The Alias API
-
-
Using this api, its possible to set an alias to the unique user identification used by the debuggify. This make it easy to map a debuggify user identifier to your site username or email id. Remember the old data will not have alias.
-
-
debuggify.alias('foo@example.com');
-
-
-
Its pretty straight forward to use the above api.
-
-
Note Make sure every unique user should be given the one alias to avoid any data inconsistency.
-
-
The Metadata API
-
-
To attach custom data along with every message
-
-
debuggify.metadata({'login': true});
-
-
-
The Attach API
-
-
To attach custom data along with a single message. This api need to be called on the logger object
-
-
var ajaxErrors = debuggify.Logger.get('ajax_errors');
-
-ajaxErrors.attach({
- type: 'POST',
- url: '/api/notification'
-});
-
-ajaxErrors.error('Error in Notification Api');
-
-
-
After calling attach, it must be followed by the one of the logging Apis like .log, .error, .warn, .debug or .message to push that data to the server.
-
-
Note: The attached data will expire after its once used by logging Api’s. To send data with every request use .metadata api
-
-
We soon be adding use cases on how to use this APIs more powerfully.
-]]>
-
-
-
-
-
- 2013-03-31T17:39:00+05:30
- http://developers.debuggify.net/blog/2013/03/31/debug-javascript-in-production
- Today I had great time sharing my experience on javascript debugging with the javascript ninja community at Bangalore
-
-
Here is the presentation
-
-
-
-
-
-
-
-
-
-
I will be explaining each point in details in the future posts.
-
-
I know I have abandoned the blog for long time but not any more. Stay connected for more.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/blog/categories/error/atom.xml b/blog/categories/error/atom.xml
deleted file mode 100644
index 833755e..0000000
--- a/blog/categories/error/atom.xml
+++ /dev/null
@@ -1,67 +0,0 @@
-
-
-
-
-
-
- 2013-09-23T10:08:01+05:30
- http://developers.debuggify.net/
-
-
-
-
- Octopress
-
-
-
-
-
- 2013-06-22T08:12:00+05:30
- http://developers.debuggify.net/blog/2013/06/22/error-in-javascript-comments
- Last week, I was writing code in javascript when I found something that completly blew off my mind. This is what I found
-
-
-
-
Yeah, IE thowing error in javascript comment. For some time I didnot believe what I am seeing, but gradually I came to my senses. Like most developers, first thing I did was started cursing IE on twitter, but later reality struct me and that is to find a solution to this mess.
-
-
I dig in a lot of wrong places until I found conditional comments in IE. A sample of how the conditional logic works is below
-
-
<script>
-/*@cc_on
-
- @if (@_jscript_version == 10)
- document.write("You are using IE10");
-
- @elif (@_jscript_version == 9)
- document.write("You are using IE9");
-
- @elif (@_jscript_version == 5.8)
- document.write("You are using IE8");
-
- @elif (@_jscript_version == 5.7 && window.XMLHttpRequest)
- document.write("You are using IE7");
-
- @elif (@_jscript_version == 5.6 || (@_jscript_version == 5.7 && !window.XMLHttpRequest))
- document.write("You are using IE6");
-
- @elif (@_jscript_version == 5.5)
- document.write("You are using IE5.5");
-
- @else
- document.write("You are using IE5 or older");
-
- @end
-
-@*/
-</script>
-
-
-
To fix this all I need to do is to remove the whole comment. This comment is anyways useful for sourcemaps supported browsers which is long way to go for IE.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/blog/categories/errors/atom.xml b/blog/categories/errors/atom.xml
deleted file mode 100644
index 4e5139b..0000000
--- a/blog/categories/errors/atom.xml
+++ /dev/null
@@ -1,130 +0,0 @@
-
-
-
-
-
-
- 2013-09-23T10:08:01+05:30
- http://developers.debuggify.net/
-
-
-
-
- Octopress
-
-
-
-
-
- 2013-07-25T04:44:00+05:30
- http://developers.debuggify.net/blog/2013/07/25/tracking-jquery-ajax-errors-and-exceptions
- The web had already shifted from static web pages to ajax driven websites for good. This shift have made the web awesome and faster but have introduced some new problems which need to taken care of . One of these is failed ajax requests. There are many reasons for a ajax request to fail, some of them are
-
-
-
Api End points are down or unreachable
-
Unauthorized / Invalid data requested
-
Some error happened at the API back-end
-
Edge cases are not handed properly in the code
-
-
-
-
Normally the ajax pull data from self hosted as well 3rd party hosted APIs. In both cases, the failure of ajax request has to handled at both ends, but front end is more important because of its high impact on the user experience. In case of 3rd party APIs, there is any way no possibility to have control over back-end, so front-end is the default choice.
-
-
The browser behaves differently when it comes to make a ajax calls for same origin and ajax call for cross origin, and therefore exceptional handling also have to different.
-
-
Same Origin
-
-
In jQuery, the simplest way to catch all the ajax errors and exceptions on a web page
-
-
$(document).ajaxError(function(event, jqXHR, ajaxSettings, thrownError) {
-
- // This is the default error handler for ajax request.
-
- // Extract all the information required to understand.
- var requestResponse = {
- url: ajaxSettings.url,
- method: ajaxSettings.type,
- data: ajaxSettings.data,
- httpStatus: jqXHR.status,
- error: thrownError || jqXHR.statusText,
- data: ajaxSettings.data
- };
-
- console.error(requestResponse)
-
- // Notify the user so he might not wonder.
- alert('Something went wrong, Please try again');
-
- // Report it back for fixing it
- // Only for debuggify users
- var ajaxErrors = debuggify.Logger.get('ajax_errors');
- ajaxErrors.attach(requestResponse);
- ajaxErrors.error('Caught ajax error');
-
-});
-
-
-
One important thing to note here is this handler is not called for cross-domain scripts and cross-domain JSONP requests which made its easy to avoid any ajax errors happening in application other than your native javascript code.
-
-
Note If $.ajax() or $.ajaxSetup() is called with the global option set to false, the .ajaxError() method will not fire.
-
-
Apart from this generic handler, it is possible to have a dedicated error handler for each type of request.
-
-
$.ajax({
-
- type: "POST",
- url: "https://api.twitter.com/1.1/statuses/user_timeline.json",
- error: function(jqXHR, textStatus,errorThrown) {
- var requestResponse = {
- httpStatus: jqXHR.status,
- error: thrownError || jqXHR.statusText,
- };
-
- console.log(requestResponse);
-
- // Notify the user so he might not wonder.
- alert('Something went wrong, Please try again');
-
-
- // Report it back for fixing it
- // Only for debuggify users
- var ajaxErrors = debuggify.Logger.get('ajax_errors');
- ajaxErrors.attach(requestResponse);
- ajaxErrors.error('Caught ajax error');
-
- }
-});
-
-
-
Event this dedicated handler is not called for cross-domain script and cross-domain JSONP requests.
-
-
Cross Origin
-
-
The limitation for ajax exception handlers is not just a jQuery limitation, but it is a javascript limitation. The reason behind this limitation is that most browser are not giving permissions to access error messages for cross domain scripts due to security reasons.
-
-
There are some solutions (or workarounds) for this. (Reference stackoverflow )
-
-
First one, if backend is accessible, set (in my example PHP) headers to allow a cross domain call. When you do this, then JavaScript accepts the call, and no crossdomain tricks are needed.
Secondly if there is no access to backend, a timeout based workaround can be used to get a error callback
-
-
$.ajax({
- type: "POST",
- url: "https://api.twitter.com/1.1/statuses/user_timeline.json",
- success: start_map,
- timeout: 2000, // 2 seconds timeout before error function will be called
- dataType: 'script',
- crossDomain: true
-});
-
-
-
This is a nasty trick to solve the problem as it can definitely screw up things for slow internet connection.
-
-
Another alternative option is using the jQuery plugin jquery-jsonp. This plugin is using script onload / onerror method along with timeout to get the error callback.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/blog/categories/exceptions/atom.xml b/blog/categories/exceptions/atom.xml
deleted file mode 100644
index 21c386c..0000000
--- a/blog/categories/exceptions/atom.xml
+++ /dev/null
@@ -1,130 +0,0 @@
-
-
-
-
-
-
- 2013-09-23T10:08:01+05:30
- http://developers.debuggify.net/
-
-
-
-
- Octopress
-
-
-
-
-
- 2013-07-25T04:44:00+05:30
- http://developers.debuggify.net/blog/2013/07/25/tracking-jquery-ajax-errors-and-exceptions
- The web had already shifted from static web pages to ajax driven websites for good. This shift have made the web awesome and faster but have introduced some new problems which need to taken care of . One of these is failed ajax requests. There are many reasons for a ajax request to fail, some of them are
-
-
-
Api End points are down or unreachable
-
Unauthorized / Invalid data requested
-
Some error happened at the API back-end
-
Edge cases are not handed properly in the code
-
-
-
-
Normally the ajax pull data from self hosted as well 3rd party hosted APIs. In both cases, the failure of ajax request has to handled at both ends, but front end is more important because of its high impact on the user experience. In case of 3rd party APIs, there is any way no possibility to have control over back-end, so front-end is the default choice.
-
-
The browser behaves differently when it comes to make a ajax calls for same origin and ajax call for cross origin, and therefore exceptional handling also have to different.
-
-
Same Origin
-
-
In jQuery, the simplest way to catch all the ajax errors and exceptions on a web page
-
-
$(document).ajaxError(function(event, jqXHR, ajaxSettings, thrownError) {
-
- // This is the default error handler for ajax request.
-
- // Extract all the information required to understand.
- var requestResponse = {
- url: ajaxSettings.url,
- method: ajaxSettings.type,
- data: ajaxSettings.data,
- httpStatus: jqXHR.status,
- error: thrownError || jqXHR.statusText,
- data: ajaxSettings.data
- };
-
- console.error(requestResponse)
-
- // Notify the user so he might not wonder.
- alert('Something went wrong, Please try again');
-
- // Report it back for fixing it
- // Only for debuggify users
- var ajaxErrors = debuggify.Logger.get('ajax_errors');
- ajaxErrors.attach(requestResponse);
- ajaxErrors.error('Caught ajax error');
-
-});
-
-
-
One important thing to note here is this handler is not called for cross-domain scripts and cross-domain JSONP requests which made its easy to avoid any ajax errors happening in application other than your native javascript code.
-
-
Note If $.ajax() or $.ajaxSetup() is called with the global option set to false, the .ajaxError() method will not fire.
-
-
Apart from this generic handler, it is possible to have a dedicated error handler for each type of request.
-
-
$.ajax({
-
- type: "POST",
- url: "https://api.twitter.com/1.1/statuses/user_timeline.json",
- error: function(jqXHR, textStatus,errorThrown) {
- var requestResponse = {
- httpStatus: jqXHR.status,
- error: thrownError || jqXHR.statusText,
- };
-
- console.log(requestResponse);
-
- // Notify the user so he might not wonder.
- alert('Something went wrong, Please try again');
-
-
- // Report it back for fixing it
- // Only for debuggify users
- var ajaxErrors = debuggify.Logger.get('ajax_errors');
- ajaxErrors.attach(requestResponse);
- ajaxErrors.error('Caught ajax error');
-
- }
-});
-
-
-
Event this dedicated handler is not called for cross-domain script and cross-domain JSONP requests.
-
-
Cross Origin
-
-
The limitation for ajax exception handlers is not just a jQuery limitation, but it is a javascript limitation. The reason behind this limitation is that most browser are not giving permissions to access error messages for cross domain scripts due to security reasons.
-
-
There are some solutions (or workarounds) for this. (Reference stackoverflow )
-
-
First one, if backend is accessible, set (in my example PHP) headers to allow a cross domain call. When you do this, then JavaScript accepts the call, and no crossdomain tricks are needed.
Secondly if there is no access to backend, a timeout based workaround can be used to get a error callback
-
-
$.ajax({
- type: "POST",
- url: "https://api.twitter.com/1.1/statuses/user_timeline.json",
- success: start_map,
- timeout: 2000, // 2 seconds timeout before error function will be called
- dataType: 'script',
- crossDomain: true
-});
-
-
-
This is a nasty trick to solve the problem as it can definitely screw up things for slow internet connection.
-
-
Another alternative option is using the jQuery plugin jquery-jsonp. This plugin is using script onload / onerror method along with timeout to get the error callback.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/blog/categories/ie6/atom.xml b/blog/categories/ie6/atom.xml
deleted file mode 100644
index 9a85984..0000000
--- a/blog/categories/ie6/atom.xml
+++ /dev/null
@@ -1,67 +0,0 @@
-
-
-
-
-
-
- 2013-09-23T10:08:01+05:30
- http://developers.debuggify.net/
-
-
-
-
- Octopress
-
-
-
-
-
- 2013-06-22T08:12:00+05:30
- http://developers.debuggify.net/blog/2013/06/22/error-in-javascript-comments
- Last week, I was writing code in javascript when I found something that completly blew off my mind. This is what I found
-
-
-
-
Yeah, IE thowing error in javascript comment. For some time I didnot believe what I am seeing, but gradually I came to my senses. Like most developers, first thing I did was started cursing IE on twitter, but later reality struct me and that is to find a solution to this mess.
-
-
I dig in a lot of wrong places until I found conditional comments in IE. A sample of how the conditional logic works is below
-
-
<script>
-/*@cc_on
-
- @if (@_jscript_version == 10)
- document.write("You are using IE10");
-
- @elif (@_jscript_version == 9)
- document.write("You are using IE9");
-
- @elif (@_jscript_version == 5.8)
- document.write("You are using IE8");
-
- @elif (@_jscript_version == 5.7 && window.XMLHttpRequest)
- document.write("You are using IE7");
-
- @elif (@_jscript_version == 5.6 || (@_jscript_version == 5.7 && !window.XMLHttpRequest))
- document.write("You are using IE6");
-
- @elif (@_jscript_version == 5.5)
- document.write("You are using IE5.5");
-
- @else
- document.write("You are using IE5 or older");
-
- @end
-
-@*/
-</script>
-
-
-
To fix this all I need to do is to remove the whole comment. This comment is anyways useful for sourcemaps supported browsers which is long way to go for IE.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/blog/categories/ie7/atom.xml b/blog/categories/ie7/atom.xml
deleted file mode 100644
index e2cd8a1..0000000
--- a/blog/categories/ie7/atom.xml
+++ /dev/null
@@ -1,67 +0,0 @@
-
-
-
-
-
-
- 2013-09-23T10:08:01+05:30
- http://developers.debuggify.net/
-
-
-
-
- Octopress
-
-
-
-
-
- 2013-06-22T08:12:00+05:30
- http://developers.debuggify.net/blog/2013/06/22/error-in-javascript-comments
- Last week, I was writing code in javascript when I found something that completly blew off my mind. This is what I found
-
-
-
-
Yeah, IE thowing error in javascript comment. For some time I didnot believe what I am seeing, but gradually I came to my senses. Like most developers, first thing I did was started cursing IE on twitter, but later reality struct me and that is to find a solution to this mess.
-
-
I dig in a lot of wrong places until I found conditional comments in IE. A sample of how the conditional logic works is below
-
-
<script>
-/*@cc_on
-
- @if (@_jscript_version == 10)
- document.write("You are using IE10");
-
- @elif (@_jscript_version == 9)
- document.write("You are using IE9");
-
- @elif (@_jscript_version == 5.8)
- document.write("You are using IE8");
-
- @elif (@_jscript_version == 5.7 && window.XMLHttpRequest)
- document.write("You are using IE7");
-
- @elif (@_jscript_version == 5.6 || (@_jscript_version == 5.7 && !window.XMLHttpRequest))
- document.write("You are using IE6");
-
- @elif (@_jscript_version == 5.5)
- document.write("You are using IE5.5");
-
- @else
- document.write("You are using IE5 or older");
-
- @end
-
-@*/
-</script>
-
-
-
To fix this all I need to do is to remove the whole comment. This comment is anyways useful for sourcemaps supported browsers which is long way to go for IE.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/blog/categories/ie8/atom.xml b/blog/categories/ie8/atom.xml
deleted file mode 100644
index 7886c9d..0000000
--- a/blog/categories/ie8/atom.xml
+++ /dev/null
@@ -1,67 +0,0 @@
-
-
-
-
-
-
- 2013-09-23T10:08:01+05:30
- http://developers.debuggify.net/
-
-
-
-
- Octopress
-
-
-
-
-
- 2013-06-22T08:12:00+05:30
- http://developers.debuggify.net/blog/2013/06/22/error-in-javascript-comments
- Last week, I was writing code in javascript when I found something that completly blew off my mind. This is what I found
-
-
-
-
Yeah, IE thowing error in javascript comment. For some time I didnot believe what I am seeing, but gradually I came to my senses. Like most developers, first thing I did was started cursing IE on twitter, but later reality struct me and that is to find a solution to this mess.
-
-
I dig in a lot of wrong places until I found conditional comments in IE. A sample of how the conditional logic works is below
-
-
<script>
-/*@cc_on
-
- @if (@_jscript_version == 10)
- document.write("You are using IE10");
-
- @elif (@_jscript_version == 9)
- document.write("You are using IE9");
-
- @elif (@_jscript_version == 5.8)
- document.write("You are using IE8");
-
- @elif (@_jscript_version == 5.7 && window.XMLHttpRequest)
- document.write("You are using IE7");
-
- @elif (@_jscript_version == 5.6 || (@_jscript_version == 5.7 && !window.XMLHttpRequest))
- document.write("You are using IE6");
-
- @elif (@_jscript_version == 5.5)
- document.write("You are using IE5.5");
-
- @else
- document.write("You are using IE5 or older");
-
- @end
-
-@*/
-</script>
-
-
-
To fix this all I need to do is to remove the whole comment. This comment is anyways useful for sourcemaps supported browsers which is long way to go for IE.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/blog/categories/ie9/atom.xml b/blog/categories/ie9/atom.xml
deleted file mode 100644
index 9895a7a..0000000
--- a/blog/categories/ie9/atom.xml
+++ /dev/null
@@ -1,67 +0,0 @@
-
-
-
-
-
-
- 2013-09-23T10:08:01+05:30
- http://developers.debuggify.net/
-
-
-
-
- Octopress
-
-
-
-
-
- 2013-06-22T08:12:00+05:30
- http://developers.debuggify.net/blog/2013/06/22/error-in-javascript-comments
- Last week, I was writing code in javascript when I found something that completly blew off my mind. This is what I found
-
-
-
-
Yeah, IE thowing error in javascript comment. For some time I didnot believe what I am seeing, but gradually I came to my senses. Like most developers, first thing I did was started cursing IE on twitter, but later reality struct me and that is to find a solution to this mess.
-
-
I dig in a lot of wrong places until I found conditional comments in IE. A sample of how the conditional logic works is below
-
-
<script>
-/*@cc_on
-
- @if (@_jscript_version == 10)
- document.write("You are using IE10");
-
- @elif (@_jscript_version == 9)
- document.write("You are using IE9");
-
- @elif (@_jscript_version == 5.8)
- document.write("You are using IE8");
-
- @elif (@_jscript_version == 5.7 && window.XMLHttpRequest)
- document.write("You are using IE7");
-
- @elif (@_jscript_version == 5.6 || (@_jscript_version == 5.7 && !window.XMLHttpRequest))
- document.write("You are using IE6");
-
- @elif (@_jscript_version == 5.5)
- document.write("You are using IE5.5");
-
- @else
- document.write("You are using IE5 or older");
-
- @end
-
-@*/
-</script>
-
-
-
To fix this all I need to do is to remove the whole comment. This comment is anyways useful for sourcemaps supported browsers which is long way to go for IE.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/blog/categories/javascript/atom.xml b/blog/categories/javascript/atom.xml
deleted file mode 100644
index 74cab60..0000000
--- a/blog/categories/javascript/atom.xml
+++ /dev/null
@@ -1,141 +0,0 @@
-
-
-
-
-
-
- 2013-09-23T10:08:01+05:30
- http://developers.debuggify.net/
-
-
-
-
- Octopress
-
-
-
-
-
- 2013-07-24T04:24:00+05:30
- http://developers.debuggify.net/blog/2013/07/24/new-apis-to-add-custom-data-points
- In the past we have received many requests related to attach some custom data along with every messages collected.
-
-
We have added this functionality, and to simplify it, we have come with 3 new APIs
-
-
The Alias API
-
-
Using this api, its possible to set an alias to the unique user identification used by the debuggify. This make it easy to map a debuggify user identifier to your site username or email id. Remember the old data will not have alias.
-
-
debuggify.alias('foo@example.com');
-
-
-
Its pretty straight forward to use the above api.
-
-
Note Make sure every unique user should be given the one alias to avoid any data inconsistency.
-
-
The Metadata API
-
-
To attach custom data along with every message
-
-
debuggify.metadata({'login': true});
-
-
-
The Attach API
-
-
To attach custom data along with a single message. This api need to be called on the logger object
-
-
var ajaxErrors = debuggify.Logger.get('ajax_errors');
-
-ajaxErrors.attach({
- type: 'POST',
- url: '/api/notification'
-});
-
-ajaxErrors.error('Error in Notification Api');
-
-
-
After calling attach, it must be followed by the one of the logging Apis like .log, .error, .warn, .debug or .message to push that data to the server.
-
-
Note: The attached data will expire after its once used by logging Api’s. To send data with every request use .metadata api
-
-
We soon be adding use cases on how to use this APIs more powerfully.
-]]>
-
-
-
-
-
- 2013-06-22T08:12:00+05:30
- http://developers.debuggify.net/blog/2013/06/22/error-in-javascript-comments
- Last week, I was writing code in javascript when I found something that completly blew off my mind. This is what I found
-
-
-
-
Yeah, IE thowing error in javascript comment. For some time I didnot believe what I am seeing, but gradually I came to my senses. Like most developers, first thing I did was started cursing IE on twitter, but later reality struct me and that is to find a solution to this mess.
-
-
I dig in a lot of wrong places until I found conditional comments in IE. A sample of how the conditional logic works is below
-
-
<script>
-/*@cc_on
-
- @if (@_jscript_version == 10)
- document.write("You are using IE10");
-
- @elif (@_jscript_version == 9)
- document.write("You are using IE9");
-
- @elif (@_jscript_version == 5.8)
- document.write("You are using IE8");
-
- @elif (@_jscript_version == 5.7 && window.XMLHttpRequest)
- document.write("You are using IE7");
-
- @elif (@_jscript_version == 5.6 || (@_jscript_version == 5.7 && !window.XMLHttpRequest))
- document.write("You are using IE6");
-
- @elif (@_jscript_version == 5.5)
- document.write("You are using IE5.5");
-
- @else
- document.write("You are using IE5 or older");
-
- @end
-
-@*/
-</script>
-
-
-
To fix this all I need to do is to remove the whole comment. This comment is anyways useful for sourcemaps supported browsers which is long way to go for IE.
Finally all I have to say is God Bless IE Developers
-]]>
-
-
-
-
-
- 2013-03-31T17:39:00+05:30
- http://developers.debuggify.net/blog/2013/03/31/debug-javascript-in-production
- Today I had great time sharing my experience on javascript debugging with the javascript ninja community at Bangalore
-
-
Here is the presentation
-
-
-
-
-
-
-
-
-
-
I will be explaining each point in details in the future posts.
-
-
I know I have abandoned the blog for long time but not any more. Stay connected for more.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/blog/categories/metadata/atom.xml b/blog/categories/metadata/atom.xml
deleted file mode 100644
index 8216654..0000000
--- a/blog/categories/metadata/atom.xml
+++ /dev/null
@@ -1,65 +0,0 @@
-
-
-
-
-
-
- 2013-09-23T10:08:01+05:30
- http://developers.debuggify.net/
-
-
-
-
- Octopress
-
-
-
-
-
- 2013-07-24T04:24:00+05:30
- http://developers.debuggify.net/blog/2013/07/24/new-apis-to-add-custom-data-points
- In the past we have received many requests related to attach some custom data along with every messages collected.
-
-
We have added this functionality, and to simplify it, we have come with 3 new APIs
-
-
The Alias API
-
-
Using this api, its possible to set an alias to the unique user identification used by the debuggify. This make it easy to map a debuggify user identifier to your site username or email id. Remember the old data will not have alias.
-
-
debuggify.alias('foo@example.com');
-
-
-
Its pretty straight forward to use the above api.
-
-
Note Make sure every unique user should be given the one alias to avoid any data inconsistency.
-
-
The Metadata API
-
-
To attach custom data along with every message
-
-
debuggify.metadata({'login': true});
-
-
-
The Attach API
-
-
To attach custom data along with a single message. This api need to be called on the logger object
-
-
var ajaxErrors = debuggify.Logger.get('ajax_errors');
-
-ajaxErrors.attach({
- type: 'POST',
- url: '/api/notification'
-});
-
-ajaxErrors.error('Error in Notification Api');
-
-
-
After calling attach, it must be followed by the one of the logging Apis like .log, .error, .warn, .debug or .message to push that data to the server.
-
-
Note: The attached data will expire after its once used by logging Api’s. To send data with every request use .metadata api
-
-
We soon be adding use cases on how to use this APIs more powerfully.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/blog/categories/same-origin/atom.xml b/blog/categories/same-origin/atom.xml
deleted file mode 100644
index 72116c2..0000000
--- a/blog/categories/same-origin/atom.xml
+++ /dev/null
@@ -1,130 +0,0 @@
-
-
-
-
-
-
- 2013-09-23T10:08:01+05:30
- http://developers.debuggify.net/
-
-
-
-
- Octopress
-
-
-
-
-
- 2013-07-25T04:44:00+05:30
- http://developers.debuggify.net/blog/2013/07/25/tracking-jquery-ajax-errors-and-exceptions
- The web had already shifted from static web pages to ajax driven websites for good. This shift have made the web awesome and faster but have introduced some new problems which need to taken care of . One of these is failed ajax requests. There are many reasons for a ajax request to fail, some of them are
-
-
-
Api End points are down or unreachable
-
Unauthorized / Invalid data requested
-
Some error happened at the API back-end
-
Edge cases are not handed properly in the code
-
-
-
-
Normally the ajax pull data from self hosted as well 3rd party hosted APIs. In both cases, the failure of ajax request has to handled at both ends, but front end is more important because of its high impact on the user experience. In case of 3rd party APIs, there is any way no possibility to have control over back-end, so front-end is the default choice.
-
-
The browser behaves differently when it comes to make a ajax calls for same origin and ajax call for cross origin, and therefore exceptional handling also have to different.
-
-
Same Origin
-
-
In jQuery, the simplest way to catch all the ajax errors and exceptions on a web page
-
-
$(document).ajaxError(function(event, jqXHR, ajaxSettings, thrownError) {
-
- // This is the default error handler for ajax request.
-
- // Extract all the information required to understand.
- var requestResponse = {
- url: ajaxSettings.url,
- method: ajaxSettings.type,
- data: ajaxSettings.data,
- httpStatus: jqXHR.status,
- error: thrownError || jqXHR.statusText,
- data: ajaxSettings.data
- };
-
- console.error(requestResponse)
-
- // Notify the user so he might not wonder.
- alert('Something went wrong, Please try again');
-
- // Report it back for fixing it
- // Only for debuggify users
- var ajaxErrors = debuggify.Logger.get('ajax_errors');
- ajaxErrors.attach(requestResponse);
- ajaxErrors.error('Caught ajax error');
-
-});
-
-
-
One important thing to note here is this handler is not called for cross-domain scripts and cross-domain JSONP requests which made its easy to avoid any ajax errors happening in application other than your native javascript code.
-
-
Note If $.ajax() or $.ajaxSetup() is called with the global option set to false, the .ajaxError() method will not fire.
-
-
Apart from this generic handler, it is possible to have a dedicated error handler for each type of request.
-
-
$.ajax({
-
- type: "POST",
- url: "https://api.twitter.com/1.1/statuses/user_timeline.json",
- error: function(jqXHR, textStatus,errorThrown) {
- var requestResponse = {
- httpStatus: jqXHR.status,
- error: thrownError || jqXHR.statusText,
- };
-
- console.log(requestResponse);
-
- // Notify the user so he might not wonder.
- alert('Something went wrong, Please try again');
-
-
- // Report it back for fixing it
- // Only for debuggify users
- var ajaxErrors = debuggify.Logger.get('ajax_errors');
- ajaxErrors.attach(requestResponse);
- ajaxErrors.error('Caught ajax error');
-
- }
-});
-
-
-
Event this dedicated handler is not called for cross-domain script and cross-domain JSONP requests.
-
-
Cross Origin
-
-
The limitation for ajax exception handlers is not just a jQuery limitation, but it is a javascript limitation. The reason behind this limitation is that most browser are not giving permissions to access error messages for cross domain scripts due to security reasons.
-
-
There are some solutions (or workarounds) for this. (Reference stackoverflow )
-
-
First one, if backend is accessible, set (in my example PHP) headers to allow a cross domain call. When you do this, then JavaScript accepts the call, and no crossdomain tricks are needed.
Secondly if there is no access to backend, a timeout based workaround can be used to get a error callback
-
-
$.ajax({
- type: "POST",
- url: "https://api.twitter.com/1.1/statuses/user_timeline.json",
- success: start_map,
- timeout: 2000, // 2 seconds timeout before error function will be called
- dataType: 'script',
- crossDomain: true
-});
-
-
-
This is a nasty trick to solve the problem as it can definitely screw up things for slow internet connection.
-
-
Another alternative option is using the jQuery plugin jquery-jsonp. This plugin is using script onload / onerror method along with timeout to get the error callback.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/blog/categories/track/atom.xml b/blog/categories/track/atom.xml
deleted file mode 100644
index 08426a3..0000000
--- a/blog/categories/track/atom.xml
+++ /dev/null
@@ -1,130 +0,0 @@
-
-
-
-
-
-
- 2013-09-23T10:08:01+05:30
- http://developers.debuggify.net/
-
-
-
-
- Octopress
-
-
-
-
-
- 2013-07-25T04:44:00+05:30
- http://developers.debuggify.net/blog/2013/07/25/tracking-jquery-ajax-errors-and-exceptions
- The web had already shifted from static web pages to ajax driven websites for good. This shift have made the web awesome and faster but have introduced some new problems which need to taken care of . One of these is failed ajax requests. There are many reasons for a ajax request to fail, some of them are
-
-
-
Api End points are down or unreachable
-
Unauthorized / Invalid data requested
-
Some error happened at the API back-end
-
Edge cases are not handed properly in the code
-
-
-
-
Normally the ajax pull data from self hosted as well 3rd party hosted APIs. In both cases, the failure of ajax request has to handled at both ends, but front end is more important because of its high impact on the user experience. In case of 3rd party APIs, there is any way no possibility to have control over back-end, so front-end is the default choice.
-
-
The browser behaves differently when it comes to make a ajax calls for same origin and ajax call for cross origin, and therefore exceptional handling also have to different.
-
-
Same Origin
-
-
In jQuery, the simplest way to catch all the ajax errors and exceptions on a web page
-
-
$(document).ajaxError(function(event, jqXHR, ajaxSettings, thrownError) {
-
- // This is the default error handler for ajax request.
-
- // Extract all the information required to understand.
- var requestResponse = {
- url: ajaxSettings.url,
- method: ajaxSettings.type,
- data: ajaxSettings.data,
- httpStatus: jqXHR.status,
- error: thrownError || jqXHR.statusText,
- data: ajaxSettings.data
- };
-
- console.error(requestResponse)
-
- // Notify the user so he might not wonder.
- alert('Something went wrong, Please try again');
-
- // Report it back for fixing it
- // Only for debuggify users
- var ajaxErrors = debuggify.Logger.get('ajax_errors');
- ajaxErrors.attach(requestResponse);
- ajaxErrors.error('Caught ajax error');
-
-});
-
-
-
One important thing to note here is this handler is not called for cross-domain scripts and cross-domain JSONP requests which made its easy to avoid any ajax errors happening in application other than your native javascript code.
-
-
Note If $.ajax() or $.ajaxSetup() is called with the global option set to false, the .ajaxError() method will not fire.
-
-
Apart from this generic handler, it is possible to have a dedicated error handler for each type of request.
-
-
$.ajax({
-
- type: "POST",
- url: "https://api.twitter.com/1.1/statuses/user_timeline.json",
- error: function(jqXHR, textStatus,errorThrown) {
- var requestResponse = {
- httpStatus: jqXHR.status,
- error: thrownError || jqXHR.statusText,
- };
-
- console.log(requestResponse);
-
- // Notify the user so he might not wonder.
- alert('Something went wrong, Please try again');
-
-
- // Report it back for fixing it
- // Only for debuggify users
- var ajaxErrors = debuggify.Logger.get('ajax_errors');
- ajaxErrors.attach(requestResponse);
- ajaxErrors.error('Caught ajax error');
-
- }
-});
-
-
-
Event this dedicated handler is not called for cross-domain script and cross-domain JSONP requests.
-
-
Cross Origin
-
-
The limitation for ajax exception handlers is not just a jQuery limitation, but it is a javascript limitation. The reason behind this limitation is that most browser are not giving permissions to access error messages for cross domain scripts due to security reasons.
-
-
There are some solutions (or workarounds) for this. (Reference stackoverflow )
-
-
First one, if backend is accessible, set (in my example PHP) headers to allow a cross domain call. When you do this, then JavaScript accepts the call, and no crossdomain tricks are needed.
Secondly if there is no access to backend, a timeout based workaround can be used to get a error callback
-
-
$.ajax({
- type: "POST",
- url: "https://api.twitter.com/1.1/statuses/user_timeline.json",
- success: start_map,
- timeout: 2000, // 2 seconds timeout before error function will be called
- dataType: 'script',
- crossDomain: true
-});
-
-
-
This is a nasty trick to solve the problem as it can definitely screw up things for slow internet connection.
-
-
Another alternative option is using the jQuery plugin jquery-jsonp. This plugin is using script onload / onerror method along with timeout to get the error callback.
The web had already shifted from static web pages to ajax driven websites for good. This shift have made the web awesome and faster but have introduced some new problems which need to taken care of . One of these is failed ajax requests. There are many reasons for a ajax request to fail, some of them are
-
-
-
Api End points are down or unreachable
-
Unauthorized / Invalid data requested
-
Some error happened at the API back-end
-
Edge cases are not handed properly in the code
-
-
-
-
Normally the ajax pull data from self hosted as well 3rd party hosted APIs. In both cases, the failure of ajax request has to handled at both ends, but front end is more important because of its high impact on the user experience. In case of 3rd party APIs, there is any way no possibility to have control over back-end, so front-end is the default choice.
-
-
The browser behaves differently when it comes to make a ajax calls for same origin and ajax call for cross origin, and therefore exceptional handling also have to different.
-
-
Same Origin
-
-
In jQuery, the simplest way to catch all the ajax errors and exceptions on a web page
-
-
$(document).ajaxError(function(event, jqXHR, ajaxSettings, thrownError) {
-
- // This is the default error handler for ajax request.
-
- // Extract all the information required to understand.
- var requestResponse = {
- url: ajaxSettings.url,
- method: ajaxSettings.type,
- data: ajaxSettings.data,
- httpStatus: jqXHR.status,
- error: thrownError || jqXHR.statusText,
- data: ajaxSettings.data
- };
-
- console.error(requestResponse)
-
- // Notify the user so he might not wonder.
- alert('Something went wrong, Please try again');
-
- // Report it back for fixing it
- // Only for debuggify users
- var ajaxErrors = debuggify.Logger.get('ajax_errors');
- ajaxErrors.attach(requestResponse);
- ajaxErrors.error('Caught ajax error');
-
-});
-
-
-
One important thing to note here is this handler is not called for cross-domain scripts and cross-domain JSONP requests which made its easy to avoid any ajax errors happening in application other than your native javascript code.
-
-
Note If $.ajax() or $.ajaxSetup() is called with the global option set to false, the .ajaxError() method will not fire.
-
-
Apart from this generic handler, it is possible to have a dedicated error handler for each type of request.
-
-
$.ajax({
-
- type: "POST",
- url: "https://api.twitter.com/1.1/statuses/user_timeline.json",
- error: function(jqXHR, textStatus,errorThrown) {
- var requestResponse = {
- httpStatus: jqXHR.status,
- error: thrownError || jqXHR.statusText,
- };
-
- console.log(requestResponse);
-
- // Notify the user so he might not wonder.
- alert('Something went wrong, Please try again');
-
-
- // Report it back for fixing it
- // Only for debuggify users
- var ajaxErrors = debuggify.Logger.get('ajax_errors');
- ajaxErrors.attach(requestResponse);
- ajaxErrors.error('Caught ajax error');
-
- }
-});
-
-
-
Event this dedicated handler is not called for cross-domain script and cross-domain JSONP requests.
-
-
Cross Origin
-
-
The limitation for ajax exception handlers is not just a jQuery limitation, but it is a javascript limitation. The reason behind this limitation is that most browser are not giving permissions to access error messages for cross domain scripts due to security reasons.
-
-
There are some solutions (or workarounds) for this. (Reference stackoverflow )
-
-
First one, if backend is accessible, set (in my example PHP) headers to allow a cross domain call. When you do this, then JavaScript accepts the call, and no crossdomain tricks are needed.
Secondly if there is no access to backend, a timeout based workaround can be used to get a error callback
-
-
$.ajax({
- type: "POST",
- url: "https://api.twitter.com/1.1/statuses/user_timeline.json",
- success: start_map,
- timeout: 2000, // 2 seconds timeout before error function will be called
- dataType: 'script',
- crossDomain: true
-});
-
-
-
This is a nasty trick to solve the problem as it can definitely screw up things for slow internet connection.
-
-
Another alternative option is using the jQuery plugin jquery-jsonp. This plugin is using script onload / onerror method along with timeout to get the error callback.
In the past we have received many requests related to attach some custom data along with every messages collected.
-
-
We have added this functionality, and to simplify it, we have come with 3 new APIs
-
-
The Alias API
-
-
Using this api, its possible to set an alias to the unique user identification used by the debuggify. This make it easy to map a debuggify user identifier to your site username or email id. Remember the old data will not have alias.
-
-
debuggify.alias('foo@example.com');
-
-
-
Its pretty straight forward to use the above api.
-
-
Note Make sure every unique user should be given the one alias to avoid any data inconsistency.
-
-
The Metadata API
-
-
To attach custom data along with every message
-
-
debuggify.metadata({'login': true});
-
-
-
The Attach API
-
-
To attach custom data along with a single message. This api need to be called on the logger object
-
-
var ajaxErrors = debuggify.Logger.get('ajax_errors');
-
-ajaxErrors.attach({
- type: 'POST',
- url: '/api/notification'
-});
-
-ajaxErrors.error('Error in Notification Api');
-
-
-
After calling attach, it must be followed by the one of the logging Apis like .log, .error, .warn, .debug or .message to push that data to the server.
-
-
Note: The attached data will expire after its once used by logging Api’s. To send data with every request use .metadata api
-
-
We soon be adding use cases on how to use this APIs more powerfully.
Last week, I was writing code in javascript when I found something that completly blew off my mind. This is what I found
-
-
-
-
Yeah, IE thowing error in javascript comment. For some time I didnot believe what I am seeing, but gradually I came to my senses. Like most developers, first thing I did was started cursing IE on twitter, but later reality struct me and that is to find a solution to this mess.
-
-
I dig in a lot of wrong places until I found conditional comments in IE. A sample of how the conditional logic works is below
-
-
<script>
-/*@cc_on
-
- @if (@_jscript_version == 10)
- document.write("You are using IE10");
-
- @elif (@_jscript_version == 9)
- document.write("You are using IE9");
-
- @elif (@_jscript_version == 5.8)
- document.write("You are using IE8");
-
- @elif (@_jscript_version == 5.7 && window.XMLHttpRequest)
- document.write("You are using IE7");
-
- @elif (@_jscript_version == 5.6 || (@_jscript_version == 5.7 && !window.XMLHttpRequest))
- document.write("You are using IE6");
-
- @elif (@_jscript_version == 5.5)
- document.write("You are using IE5.5");
-
- @else
- document.write("You are using IE5 or older");
-
- @end
-
-@*/
-</script>
-
-
-
To fix this all I need to do is to remove the whole comment. This comment is anyways useful for sourcemaps supported browsers which is long way to go for IE.
With the rise of compiled to javascript languages it hard to traceback the errors to original source. Almost all modern provides the window.onerror api to catch all uncaught exceptions on a page. This api provides very limited information (error message, filename and line number only) which is the root cause of many problems.
-
-
With modern web development practices the amount of javascript code per page is growing rapidly. Also this code is minified by the minification tools(like Google Closure Compiler, UglifyJS2 etc) to reduce the code size. After minification whole code ends in one single line. Here is where most problem starts. I am listing some really annoying issues related to window.onerror below
-
-
-
Missing Char No: The char no is very important for the minified code to point at the exact statement as there is only one line in minified code. Even source maps cannot be helpful in tracking back to original line.
-
No Call Stack: The call stack is completely hidden from the developer so its hard to identify the functions flow. However there is a trick to extract stack in IE9 only.
-
Cross Origin Errors: These types are thown when some cross origin permission is broken. They are very common on pages with facebook like and google plus widget installed. For such errors window.error message throw a single message “Script Error”. As per stackoverflow post this behavior is intentional to avoid some security risks but its at expense of useful debugging information.
-
-
-
-
Most of above mentioned problems are roadblock in debugging production websites / applications. There is a need for better tools and libraries for the job.
-
-
I will soon be writing a post on Best Debugging Practices For Javascript In Production Environment
I was born 6 years back when I bought my first computer and a internet connection. To be frank, Internet is a second home to me. For most of people out there who feel same, are continuously trying to make Internet a better place.
-
-
I am also a computer science engineering grad, so I am surrounded by technology. In order to feed my engineering inquisitiveness I have explored the black, white and gray sections of the internet.
-
-
Where it all started?
-
-
I am a full stack web developer by profession and have authored / co-authored many 3rd party social plugins for Shareaholic Inc which runs on thousands of different blogs and websites driving 1+ billion pageviews per month. These plugins can be installed on different CMS/blogging platform like Wordpress, Drupal, Tumblr, Blogger etc. While working on these plugins I closely interact with the different elements of the modern internet ecosystem.
-
-
What’s my use case of 3rd party plugin ?
-
-
A 3rd party plugin has to be robust enough to work in 3rd party environments while interacting with 3rd party apis and support every major browser vendor out there
-
-
Elaborating the above quote
-
-
-
As plugins runs on 3rd party websites, it has to be robust so it doesn't break itself and neither the website
-
It has to be fast enough to deliver good page load time
-
It should not conflict with other existing plugins
-
It should support major browser vendors including internet explorer
-
It should also support legacy browser versions like ie6 ie7 etc.
-
As plugins interact with over 200+ 3rd party apis, it’s hard to keep track when something break
-
It should be easy to setup with multiple cms/blogging environments for better distribution
-
-
-
-
Technical challenges faced ?
-
-
-
In 3rd party environment, developers have limited or no control over things, so it’s hard to debug and reproduce bugs / issues
-
If some plugin feature is not working its hard to know whether
-
-
-
it’s not working for a particular website,
-
or not working for a set of URLs
-
or for a particular CMS/Blogging environment
-
or for a particular screen resolution
-
or for a particular browser vendor
-
or even for a particular version of a browser vendor
-
or for all cases
-
-
-
Its hard to judge the impact of every release, whether it fixed the problem or introduced some new side effects
-
The 3rd party API’s are continuously changing, upgrading & depreciating. Companies like Facebook, Google, Twitter are continuously bashing developers with bleeding edges of their API’s
-
With HTML5, ES Harmony and CSS3, browsers are evolving faster than ever, so they are also releasing bleeding edge features and API’s
-
-
-
-
Who else is facing problems?
-
-
As all wise developers know
-
-
Zero Bugs is a Myth
-
-
I have talked to a few friends about the problems. All are encountering similar set of problems on the daily basic. A majority their development time is spend in debugging and fixing bugs. The debugging is also becoming hard due to the evolving nature of the web.
-
-
What to do about it?
-
-
So I finally decided to go on a quest to make Internet a better place for developers.
-
-
Why Developers ?
-
-
Developers are the keepers of the modern internet.
-
-
The web is evolving because of the developers. There are around 1+ million developers on the planet. I can build something that make developers more productive and can save up to 1hr/day of their time, it’s going to be revolutionary. Developers can reinvest this time in open source projects, new innovations or anything that eventually make Internet a better place
-
-
So that is Debuggify is all about. Contact me if you want to join me on my quest.
','','{name}','View source...',"","",'{name}',"",'',"singleton","","",'enum of {[values["enum"].type]}',"","{[this.renderAliases(values.aliases)]}","{[this.renderMetaTags(values.meta)]}","
')},showLoggedOut:function(){this.update('Sign in / Register')}});Ext.define("Docs.view.ThumbList",{extend:"Ext.view.View",alias:"widget.thumblist",requires:["Docs.Comments"],cls:"thumb-list",itemSelector:"dl",urlField:"url",commentType:"",itemTpl:[],initComponent:function(){this.addEvents("urlclick");Ext.Array.forEach(this.data,function(c,d){c.id="sample-"+d});this.store=Ext.create("Ext.data.JsonStore",{fields:["id","title","items"]});this.store.loadData(this.flattenSubgroups(this.data));this.tpl=new Ext.XTemplate(Ext.Array.flatten(["
",{linkify:function(a){return a.replace(/(\bhttps?:\/\/\S+)/ig,"$1")}});this.update(this.tpl.apply(b));if(Docs.Comments.isEnabled()){this.initComments()}},initComments:function(){this.expander=new Docs.view.comments.LargeExpander({type:"video",name:this.video.name,el:this.getEl().down(".x-panel-body")})},updateCommentCounts:function(){if(!this.expander){return}this.expander.getExpander().setCount(Docs.Comments.getCount(["video",this.video.name,""]))}});Ext.define("Docs.view.comments.MemberWrap",{extend:"Docs.view.cls.MemberWrap",requires:["Docs.Comments","Docs.view.comments.Expander"],constructor:function(d){this.callParent([d]);var c=Docs.Comments.getCount(this.getTarget());if(c>0){this.updateSignatureCommentCount(c)}},getTarget:function(){if(!this.target){this.target=["class",this.getDefinedIn(),this.getMemberId()]}return this.target},getExpander:function(){if(!this.expander){var b=Ext.DomHelper.append(this.el.down(".long"),"");this.expander=new Docs.view.comments.Expander({count:Docs.Comments.getCount(this.getTarget()),target:this.getTarget(),newCommentTitle:this.getNewCommentTitle(),renderTo:b})}return this.expander},setCount:function(b){this.getExpander().setCount(b);this.updateSignatureCommentCount(b)},updateSignatureCommentCount:function(g){var e=this.el.down(".title");var f=e.down(".comment-counter-small");if(g>0){if(f){f.update(""+g)}else{var h=Ext.DomHelper.append(e,Docs.Comments.counterHtml(g),true);h.on("click",function(){this.el.addCls("open");this.getExpander().expand();this.parent.scrollToEl(this.getExpander().getEl())},this)}}else{if(f){f.remove()}}},getNewCommentTitle:function(){if(this.getDefinedIn()!==this.className){return["Be aware. This comment will be posted to "+this.getDefinedIn()+" class, ","from where this member is inherited from."].join("")}else{return undefined}},setExpanded:function(b){this.callParent([b]);if(b){this.getExpander().show()}}});Ext.define("Docs.view.comments.TopList",{extend:"Ext.panel.Panel",componentCls:"comments-toplist",requires:["Docs.view.SimpleSelectBehavior","Docs.view.comments.FilterField"],layout:"border",displayField:"text",scoreField:"score",filterEmptyText:"Filter by name...",initComponent:function(){this.items=[this.tabpanel=Ext.widget("tabpanel",{plain:true,region:"north",height:50,items:[{title:"By comment count"}],dockedItems:[{dock:"bottom",items:[{xtype:"commentsFilterField",emptyText:this.filterEmptyText,width:320,height:20,listeners:{filter:this.onFilter,scope:this}}]}]}),this.list=Ext.widget("dataview",{region:"center",cls:"iScroll top-list",autoScroll:true,store:new Ext.data.Store({model:this.model}),allowDeselect:true,tpl:["
',deferEmptyText:false,initComponent:function(){this.store=Ext.create("Ext.data.Store",{model:"Docs.model.Comment",listeners:{update:this.fireChangeEvent,scope:this}});this.tpl=Docs.view.comments.Template.create({showTarget:this.showTarget,enableDragDrop:this.enableDragDrop});this.callParent(arguments);this.on("refresh",function(){Docs.Syntax.highlight(this.getEl());this.renderExpanders(this.store.getRange())},this);this.on("itemupdate",function(f,e,d){Docs.Syntax.highlight(d);this.renderExpanders([f])},this)},renderExpanders:function(b){if(b[0]&&b[0].get("parentId")){return}Ext.Array.forEach(b,function(a){if(a.get("deleted")){return}new Docs.view.comments.RepliesExpander({count:a.get("replyCount"),target:a.get("target"),parentId:a.get("id"),renderTo:this.getNode(a)})},this)},afterRender:function(){this.callParent(arguments);this.mun(this.getTargetEl(),"keydown");this.delegateClick("a.voteCommentUp",function(d,c){this.vote(d,c,"up")},this);this.delegateClick("a.voteCommentDown",function(d,c){this.vote(d,c,"down")},this);this.delegateClick("a.editComment",function(d,c){this.edit(d,c)},this);this.delegateClick("a.deleteComment",function(d,c){this.setDeleted(d,c,true)},this);this.delegateClick("a.undoDeleteComment",function(d,c){this.setDeleted(d,c,false)},this);this.delegateClick("a.readComment",this.markRead,this);this.delegateClick("a.add-tag",this.addTag,this);this.delegateClick("a.remove-tag",this.removeTag,this);if(this.enableDragDrop){new Docs.view.comments.DragZone(this);new Docs.view.comments.DropZone(this,{onValidDrop:Ext.Function.bind(this.setParent,this)})}},delegateClick:function(e,f,d){this.getEl().on("click",function(b,c){var a=this.getRecord(this.findItemByChild(c));if(a){f.call(d,c,a)}},this,{preventDefault:true,delegate:e})},vote:function(e,f,d){if(!Docs.Auth.isLoggedIn()){Docs.Tip.show("Please login to vote on this comment",e);return}if(f.get("upVote")&&d==="up"||f.get("downVote")&&d==="down"){Docs.Tip.show("You have already voted on this comment",e);return}f.vote(d,{failure:function(a){Docs.Tip.show(a,e)}})},edit:function(d,c){c.loadContent(function(a){var b=Ext.get(d).up(".comment").down(".content");b.update("");new Docs.view.comments.Form({renderTo:b,title:"Edit comment",user:Docs.Auth.getUser(),content:a,listeners:{submit:function(f){c.saveContent(f)},cancel:function(){this.refreshComment(c)},scope:this}})},this)},refreshComment:function(b){this.refreshNode(this.getStore().findExact("id",b.get("id")))},setDeleted:function(d,f,e){f.setDeleted(e)},markRead:function(d,c){c.markRead()},addTag:function(d,f){var e=new Docs.view.comments.TagEditor();e.on("select",f.addTag,f);e.popup(d)},removeTag:function(e,f){var d=Ext.get(e).up(".tag").down("b").getHTML();f.removeTag(d)},setParent:function(c,d){c.setParent(d,function(){this.fireEvent("reorder")},this)},load:function(f,e){if(f.length===0){this.emptyText=""}var d=this.store.getProxy().getReader().readRecords(f).records;this.store.loadData(d,e);this.fireChangeEvent()},fireChangeEvent:function(){var b=function(a){return !a.get("deleted")};this.fireEvent("countChange",this.getStore().queryBy(b).getCount())}});Ext.define("Docs.view.comments.FullList",{extend:"Ext.panel.Panel",alias:"widget.commentsFullList",requires:["Docs.Settings","Docs.Auth","Docs.Comments","Docs.view.comments.List","Docs.view.comments.Pager"],componentCls:"comments-full-list",dockedItems:[{xtype:"container",dock:"top",height:35,html:['
Comments
',"","