I want to update this code to call javascript in order to validate the url of my image. This is PHP echoing xhtml with embedded javascript.
echo "<img class = \"c\" src=\"$fav\" alt=\"\"\/><a name = \"a1\" class = \"b\" href = \"$ass_array[url]\">$ass_array[name]</a>";
This is what I have. Will it work?
echo "<img class = \"c\" src=\"<script type=\"text/javascript\">validate_fav($fav)</script>\" alt=\"\"\/><a name = \"a1\" class = \"b\" href = \"$ass_array[url]\">$ass_array[name]</a>";
Thanks.
No, that is invalid XHTML. You end up setting the src to
<script type=and then you have invalid markup.You should do something like: