Return link not supported by Internet Explorer 7 with jQuery

I am using jQuery and Ajax and my file Ajax.php

returns the following field to the main file. Although I click in Mozilla and Chrome it works fine and gives a warning, but when I use Internet Explorer 7 (version 7.0.5730.13) it was not supported. Do I need to do anything from the browser side or do I need to change it?

Here is my file Ajax.php

:

echo " <a href='#' onclick=\"javascript:alert('hello')\ "> link</a>";   

      

It goes back to the main .html file. There I got no warning in Internet Explorer 7.

0


source to share


3 answers


You might want to get rid of the extra space after the closing parenthesis (it could only be a typo in your post), put in a half colon and return false so that it doesn't try to follow the link.



echo " <a href='#' onclick=\"javascript:alert('hello'); return false;\"> link</a>";

      

+2


source


It can be a space between /

and "

.



+1


source


You also don't need a "javascript" label in your onClick event.

You can read more about this in the answer to Stack Overflow question The correct way to call a JavaScript method .

+1


source







All Articles