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 comment
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 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.