Need quick help!Ajax+jQuery does not work in IE (works in other browsers)

Hello!I have this code that switch between languages:

		       <?php
			
			include('config.php');
			$pick_lng = mysql_query("SELECT code, name FROM lang");
			?>
			<form id="changeLang" style="all: unset;">
				<select name="userLang" id="userLang"  onChange="updateDb()">
				<?php
			while($p_l_row = mysql_fetch_array($pick_lng)){
				?>
				<option value="<?=$p_l_row['code'];?>"
				<?php
				if($_SESSION['lang']==$p_l_row['code']){echo ' selected';}
				?>
				><?=$p_l_row['code'];?> - <?=$p_l_row['name'];?></option>
			<?php } ?>
			</select>
			</form>

and

		<script>
			function updateDb() {
			// I am using jquery for ajax
			var changeIt = $("#changeLang").serialize();
			 $.post("changeLang.php", changeIt);
			 location.reload();
			}
		</script>

How can i manage it to work on IE also?

P.S. i know that MySQL is deprecated :slight_smile: i just cant do different here!

Which version(s) of IE are you interested in supporting?

@chrisofarabia i newer can know who visit it and with what version so i believe i prefer all of them

Well jQuery only supports IE9+ - Browser Support - so there are limits if you’re sticking purely to what jQuery itself offers. As earlier versions of IE are now out of support by Microsoft, you might want to follow suit.

@chrisofarabia seems that i have IE11 and its not working :frowning:

That helps to an extent, that we now know which version of IE you can see a problem with.

I’ve just checked on IE version support, and they’re supporting less than I was aware of - Microsoft ends support for old Internet Explorer versions - in effect, they’re only really supporting IE11.

I don’t tend to do a lot with jQuery myself - so with the info we’ve now got, maybe one of the other members will chip in.

1 Like

@chrisofarabia ok thanks allot for your time for now :slight_smile:

Issue was because of location.reload();

changing code to

			function updateDb() {

			var changeIt = $("#changeLang").serialize();

			var Changelang = $.post("changeLang.php", changeIt);
			  Changelang.done(function() {
			location.reload();
			  });			
			}

helped :slight_smile:

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.