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 Link to comment https://forums.phpfreaks.com/topic/180025-looking-for-quick-javascriptphp-output-help/ 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. Link to comment https://forums.phpfreaks.com/topic/180025-looking-for-quick-javascriptphp-output-help/#findComment-949892 Share on other sites More sharing options...
thenewperson Posted November 3, 2009 Author Share Posted November 3, 2009 thanks, solved problem + found out disadvantages ^^ Link to comment https://forums.phpfreaks.com/topic/180025-looking-for-quick-javascriptphp-output-help/#findComment-949930 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.