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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.