Skip to main content
added explanation for target utilization
Source Link
davids
  • 5.6k
  • 12
  • 60
  • 96

I have a web site with this element:

<a id="ProPayHyperLink" href="javascript:$ProPay.playIntro('ProPay');" target="_blank">ProPay Payment Center</a>

In Chrome, it successfully runs the $ProPay.playIntro script. However, when I run the site in FireFox or IE, I get a new blank tab. Using debugger, I can see that it never gets to the javascript code.

I am running IE 11 and Firefox 30.0

What am I doing wrong?

UPDATE I use target="_blank" because the javascript href is temporary and only for specific situations, and because it didn't cause issues in Chrome. I can always add and remove it as needed though.

I have a web site with this element:

<a id="ProPayHyperLink" href="javascript:$ProPay.playIntro('ProPay');" target="_blank">ProPay Payment Center</a>

In Chrome, it successfully runs the $ProPay.playIntro script. However, when I run the site in FireFox or IE, I get a new blank tab. Using debugger, I can see that it never gets to the javascript code.

I am running IE 11 and Firefox 30.0

What am I doing wrong?

I have a web site with this element:

<a id="ProPayHyperLink" href="javascript:$ProPay.playIntro('ProPay');" target="_blank">ProPay Payment Center</a>

In Chrome, it successfully runs the $ProPay.playIntro script. However, when I run the site in FireFox or IE, I get a new blank tab. Using debugger, I can see that it never gets to the javascript code.

I am running IE 11 and Firefox 30.0

What am I doing wrong?

UPDATE I use target="_blank" because the javascript href is temporary and only for specific situations, and because it didn't cause issues in Chrome. I can always add and remove it as needed though.

Source Link
davids
  • 5.6k
  • 12
  • 60
  • 96

Firefox opens a new tab instead of javascript code

I have a web site with this element:

<a id="ProPayHyperLink" href="javascript:$ProPay.playIntro('ProPay');" target="_blank">ProPay Payment Center</a>

In Chrome, it successfully runs the $ProPay.playIntro script. However, when I run the site in FireFox or IE, I get a new blank tab. Using debugger, I can see that it never gets to the javascript code.

I am running IE 11 and Firefox 30.0

What am I doing wrong?