dannybrazil Posted March 18, 2010 Share Posted March 18, 2010 Hello I wanted to create something that will show a different LINK if its internet explorer or another browser code: <![if !IE]><form action="#" method="post"> <input name="produto" value="'.$this->dados[$i]['codigo'].'" type="hidden" > <input TYPE="image" SRC="images/delete_bt.png" BORDER="0" name="acao" value="Excluir" > </form><![endif]--> <!--[if IE]><a href="javascript:void(0)" onclick="window.open(\'select_ok.php?produto='.$id.'&acao=Excluir\',\'\',\'width=100,height=100\')"><img src="images/delete_bt.png" border="0" /></a><![endif]--> Now in chrome and mozila its working fine BUT in explorer it doesnt work at all I can NOT see either of the links any help ? Link to comment https://forums.phpfreaks.com/topic/195685-if-ie/ Share on other sites More sharing options...
Tazerenix Posted March 19, 2010 Share Posted March 19, 2010 use javascript: function ie() { if (navigator.appName == "Microsoft Internet Explorer") { document.write("<a href=\"javascript:void(0)\" onclick=\"window.open(\'select_ok.php?produto='.$id.'&acao=Excluir\',\'\',\'width=100,height=100\')\"><img src=\"images/delete_bt.png\" border="0" /></a>"); } else { document.write('<form action="#" method="post"> <input name="produto" value="'.$this->dados[$i]['codigo'].'" type="hidden" > <input TYPE="image" SRC="images/delete_bt.png" BORDER="0" name="acao" value="Excluir" > </form>'); } } then call it with <script type="text/javascript">ie()</script> And that should work. Link to comment https://forums.phpfreaks.com/topic/195685-if-ie/#findComment-1028441 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.