Jump to content

[if !ie]


dannybrazil

Recommended Posts

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 post
Share on other sites

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 post
Share on other sites

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.