frank_solo Posted May 16, 2013 Share Posted May 16, 2013 Is there a javascript equivalent to this php script? I have these ugly boxes that apear after a user deletes his or her images in a edit form. It appears in IE I have no clue why they appear even using this in php. Maybe a client script can work?Thanks guys <?PHP $image04 = !empty($rows['image04']) ? "<img src=\"http://www.mydomain.co/user/{$rows['image04']}\" width='100'>" : "<img src=\"http://www.mydomain.co/user/images/classified/no-image.png\" width='100'>";?> Link to comment https://forums.phpfreaks.com/topic/278082-javascrit-equivalient/ Share on other sites More sharing options...
cpd Posted May 16, 2013 Share Posted May 16, 2013 All that's happening is you're setting a variable? <script type="text/javascript"> img = (data['img'] == "" ? "IMAGE 1" : "IMAGE 2"); </script> Is that what you meant? Link to comment https://forums.phpfreaks.com/topic/278082-javascrit-equivalient/#findComment-1430555 Share on other sites More sharing options...
frank_solo Posted May 16, 2013 Author Share Posted May 16, 2013 I just used it and although it has the same function as the php but that ugly box still appears. Thanks CPD. It is just an eye sore. Link to comment https://forums.phpfreaks.com/topic/278082-javascrit-equivalient/#findComment-1430563 Share on other sites More sharing options...
Adam Posted May 17, 2013 Share Posted May 17, 2013 What do you expect to achieve with JavaScript? Looks like this is the ugly image you're talking about: "<img src=\"http://www.mydomain.co/user/images/classified/no-image.png\" width='100'>" Just change the PHP so it doesn't show that when the image column is empty: <?php $image04 = !empty($rows['image04']) ? "<img src=\"http://www.mydomain.co/user/{$rows['image04']}\" width='100'>" : ""; ?> Link to comment https://forums.phpfreaks.com/topic/278082-javascrit-equivalient/#findComment-1430613 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.