Hi there. I have a problem with .ajax function and IE8. Short brief: I use jQuery for ajax requests and have trouble with that in IE8 but in other browsers my code works fine. I can say more. Even IE8 works fine but after manual page refresh (f5, ctrl+r). When page loads first time and I click on ajax item I`ve got error "Object expected" or something like that.
Now I ask for help. I spent about 3 days on this trouble. Thanks.
My sample code:
- <h1>IE Ajax Test</h1>
- <a href='javascript:void(0);' id='ajax'>do ajax</a><br/>
- <div id='res'></div>
- <script type='text/javascript'>
- $(document).ready(function(){
- if($.browser.msie) alert("IE ver. " + $.browser.version);
- $('#ajax').click(function(){
- doAjax();
- });
- });
- function doAjax() {
- var post_data = "ajax=true";
- $.ajax({
- type: 'POST',
- data: post_data,
- url: '<?php echo $this->createUrl('test/ajax');?>',
- success: function(responce) {
- $("#res").append(responce + "<br/>");
- }
- });
- }
- </script>