I am using jQuery and Ajax, and my Ajax.php file returns the following field into the main file. While I am clicking in Mozilla and Chrome, it is working fine and gives an alert, but when I use Internet Explorer 7 (version 7.0.5730.13), it wasn’t supported. Do I need to do anything on browser side or do I have to modify it?
Here is what my Ajax.php file has:
echo ' <a href='#' onclick=\'javascript:alert('hello')\ '> link</a>';
It returns to the main .html file. There I didn’t get an alert in Internet Explorer 7.
You might want to get rid of the extra space after the closing parenthesis (this may just be a typo in your post, though), put in a semi-colon, and return false so that it doesn’t attempt to follow the link.