Category Archives: jQuery

Avoid Mixed Content Warnings Using Protocol Relative URLs

“This webpage contains content that will not be delivered using a secure HTTPS connection, which could compromise the security of the entire webpage.” Undoubtedly, you have seen this message while browsing a site over SSL using Internet Explorer. Chrome, Firefox, … Continue reading

Posted in ASP.Net, C#, jQuery | Leave a comment

JavaScript: Dynamically Add Options to an HTML Select Using jQuery

Here’s how you can dynamically add options to an HTML select using jQuery   var $selector = $(’#mySelect’); $selector.append($('<option>’, { value: "" }).text("– Choose –")); $.each(this.dataArray, function (idx, dataItem) { $selector.append($('<option>’, { value: dataItem.Key }).text(dataItem.Value)); }); $selector.append($('<option>’, { value: "All" … Continue reading

Posted in JavaScript, jQuery | Leave a comment

jQuery: Global AJAX Error Handler

Here’s a quick and dirty way to handle AJAX errors globally if you are using jQuery:   $(document).ready(function () { $.ajaxSetup({ error: function (x, e) { if (x.status == 0) { alert(’Network error’); } else if (x.status == 404) { … Continue reading

Posted in JavaScript, jQuery | Leave a comment