thenewperson Posted November 2, 2009 Share Posted November 2, 2009 Trying to output this to txtHint div but it keeps failing. This code comes from gethint.php which is called through clienthint.js which is called from html page when button is c licked. However the error from alert in the clienthint.js says document.getElementById('txtHint').innerHTML = document.getElementById('txtHint').innerHTML + <img src=\"p_pink.png\" />; <?php $image = "<img src=\"p_pink.png\" />"; for($i=0; $i < 1; $i++){ echo "document.getElementById('txtHint').innerHTML = document.getElementById('txtHint').innerHTML + " . $image . ";"; } ?> i think the problem is just how im trying to echo out documentget. Trying to echo out 2 images in same place in for loop so adding the img + innerhtml Quote Link to comment Share on other sites More sharing options...
BillyBoB Posted November 3, 2009 Share Posted November 3, 2009 You should check this site out: http://slayeroffice.com/articles/innerHTML_alternatives/ I simply love that page. It explains so much and will help with not using innerHTML because it isn't supported by many browsers. Quote Link to comment Share on other sites More sharing options...
thenewperson Posted November 3, 2009 Author Share Posted November 3, 2009 thanks, solved problem + found out disadvantages ^^ Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.