Working with FireFox but not working with IE
I have are created dynamically buttonset toggle radio button with following code. All is working okay but just I have added onclick function which is doing window.location which is working with FireFox but not working with IE and google chrome.
- <script type="text/javascript">
- var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
- $(function () {
- $('#btnSet').buttonstrip();
- });
- ; (function ($) {
- $.widget("ui.buttonstrip", {
- chars: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
- _init: function () {
- var self = this;
- var initElem = self.element;
- var aBtn = $('<input />')
- .attr('type', 'radio')
- .attr('id', initElem.attr('id') + '_Radio_all')
- .attr('name', initElem.attr('id') + '_btnList')
- .attr('checked', 'checked')
- .attr('onclick', "window.location='requester.aspx'")
- .val('-1');
- initElem.append(aBtn);
- initElem.append(self._createLabel(aBtn, 'All'));
- for (var i = 0; i < chars.length; i++) {
- var input = $('<input />')
- .attr('type', 'radio')
- .attr('id', initElem.attr('id') + '_Radio' + i)
- .attr('name', initElem.attr('id') + '_btnList')
- .attr('onclick', "window.location='requester.aspx?s="+this.chars[i]+"'")
- .val(this.chars[i]);
- initElem.append(input);
- initElem.append(self._createLabel(input, this.chars[i]));
- initElem.append(self._checked(input,this.chars[i]));
- }
- initElem.buttonset();
- },
- _createLabel: function (forElem, text) {
- return $('<label />')
- .text(text)
- .attr('for', $(forElem).attr('id'));
- },
- _checked: function(forElem,text){
- if(getParameterByName("s")==text){
- forElem.attr('checked', 'checked')
- }
- else{
- forElem.removeAttr('checked', 'checked')
- }
- }
- });
- function getParameterByName( name)
- {
- name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
- var regexS = "[\\?&]" + name + "=([^&#]*)";
- var regex = new RegExp(regexS);
- var results = regex.exec(window.location.href);
- if (results == null)
- return "";
- else
- return decodeURIComponent(results[1].replace(/\+/g, " "));
- }
- })(jQuery);
- </script>
Kindly help me why it is not working in IE and Google chrome