Jump to content

looking for quick javascript/php output help


thenewperson

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.