I'm trying to send two parameters from PHP to Javascript, but I get second undefined parameter.
<?php echo '<button onclick="deleteImage(\'' . $image->photo_id . ',' . $content->content_id . '\')" >Delete</button>'; ?>
Please help, thank you
I'm trying to send two parameters from PHP to Javascript, but I get second undefined parameter.
<?php echo '<button onclick="deleteImage(\'' . $image->photo_id . ',' . $content->content_id . '\')" >Delete</button>'; ?>
Please help, thank you
I think you forget to escape some '
:
<?php echo '<button onclick="deleteImage(\'' . $image->photo_id . '\',\'' . $content->content_id . '\')" >Delete</button>'; ?>