Author Topic: [if !ie]  (Read 424 times)

0 Members and 1 Guest are viewing this topic.

Offline dannybrazilTopic starter

  • Enthusiast
  • Posts: 171
    • View Profile
[if !ie]
« on: March 18, 2010, 10:10:27 AM »
Hello

I wanted to create something that will show a different LINK if its internet explorer or another browser

code:
Code: [Select]

  <![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 ?

Offline Tazerenix

  • Enthusiast
  • Posts: 228
  • Gender: Male
  • Call me taz :D
    • View Profile
    • Tazerenix Productions
Re: [if !ie]
« Reply #1 on: March 19, 2010, 02:13:42 AM »
use javascript:
Code: [Select]
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.
Quote
"War does not determine who is right... Only who is dead" - Unknown



NOTE: Most of the code I post is untested. So hope for the best