Paypal In-Context Express Checkout button missing on IE - javascript

I have implemented Paypal's In-Context Express Checkout on a website (HTML and JQuery, no shopping cart, no CMS or anything), and it works perfectly on Firefox and Chrome for Windows, and Safari, Firefox, Chrome & Opera for Mac, but it doesn't work on IE.
Paypal's "Paypal Checkout" button is missing on IE. Every other browser has a button inserted which is the one that is clicked on to "activate" the checkout flow, but on IE the button is missing and thus the checkout flow is not activated.
The problem is ONLY on Internet Explorer. IE11, using X-UA-Compatible IE=EDGE.
Any help is greatly appreciated.

I don't see your integration but I'm guessing you're calling window.paypalCheckoutReady far later than the script is being inserted into the page and run, which will mean the paypalCheckoutReady event has already fired. To mitigate this and to prevent blocking the page load, the script tag should be at the end of your page before the closing </body> tag, and have the async attribute added to it.

It turns out that by moving the <script> tag with checkout.js from the <head> to the <body> right before the <form> tag, it works on IE.

Related

window.opener is null... didn't use to be

In our software, we have a page with a link that opens a page within the same site in a new tab using target='_blank'. When the user is done working on that newly opened page, they click a button and when the page refreshes, it calls the following code.
window.opener.location.href = window.opener.location.href; window.close();
This has worked fine for ages but within the last week or so stopped working in all browsers. I can't seem to find anything when I google it about a new security restriction being implemented that would cause this. Any idea what's going on and how to get it working again? I've tested the following code in chrome, firefox, edge and IE11. In all but IE11 window.opener is null. In IE it is not. Is there possibly a new security setting in browsers that would cause this?
<html>
<body>
click me
</body>
</html>
<html>
<body>
<script>
alert(window.opener === null);
</script>
</body>
</html>
I am not sure which version of chrome browser you tested your code on. To avoid "tab-napping" attacks, many browsers have started implementing noopener behavior by default for anchors that target _blank.
Chrome enabled noopener behavior in release 88.
Safari also enabled this in release 68.
I couldn't find any reference to IE 11 change. But it's worth trying adding rel="opener" in anchor tags with target=_blank

Frontend issue with a js code: the images show good on chrome, edge, but not in firefox

I have a site, created with a template, that works just fine on Chrome, Edge, Safari, etc... but in firefox it crashes. It's a thing with a JS code that animates the images in the home page. You can see what I'm talking about in www.andarescolombia.com
If you go to that site in chrome you'll see the images on the home page working fine, but on firefox they seem to get collapsed to the top of the container:
On Chrome:
On Firefox:
So the images collaps in firefox, but the other JS plugins are working just fine. I already tryed to contact the seller, but they just have a lousy customer support service.
Please help!!
just avoid using $. it should prevent your error from occuring in firefox.
On the other hand why do you want to trigger the scroll event on window.load ? Oo
just wrap the magic you're using inside a function and call it on load and on scroll. saves you a lot of headaches.

Twitter Timeline widget not working in Chrome

My Twitter Timeline widget won't load in Chrome, but loads in both Firefox and IE perfectly.
When I check the console for Chrome, I get "Failed resource: http://platform.twitter.com/widgets.js" but when I click on that link, it works.
This is the code I am using:
<a class="twitter-timeline" href="https://twitter.com/funnelholic" data-widget-id="307229764530339840">Tweets by #funnelholic</a><script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
I have also whitelisted both www.funnelholic.com and funnelholic.com
The site in question is: http://funnelholic.com, this is a Wordpress site, and I am using the Text widget to display it.
How can I fix this?
I had the same problem and was very frustrated that it did not work in Chrome.
It seems that the reason was
Adblock Plus
When I deactivated Adblock Plus for my page, it worked!
Guess you, #theintellects, also had Adblock active on the computer it did not work on.
With that said, I have added information on my webpage, that if the user uses Chrome and they don't see any Twitter timeline, they need to deactivate Adblock Plus for this page
Went home and tried it on a different computer in the same Chrome versions. Guess it somehow wasn't getting rid of cache...
you need to add this script
<script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>

Javascript file loading twice

I am having a strange problem in Google Chrome. I am including a js file via script src tag. I place alert('test') in the file and when I load the page in Chrome, It alerts twice. In every other browser it alerts once. Is there any known cause for this?
Here is the code that loads the JS:
<script type="text/javascript" src="/js/main.js"></script>
It appears this happens in Safari as well. Does not occur in IE and firefox.
I had this recently and eventually found out it was a chrome extension, specifically the cache killer extension
This might be helpful
Webkit browsers (Chrome, Safari) are loading pages redirected from .htaccess twice!
I've noticed this same problem in Chrome. I have some code that runs when the page loads and I have an alert inside that code. In every browser other than Chrome this code is run once, thus the alert displays once. In chrome the alert shows twice. I am not doing anything special, just running code when the onload event is triggered within <body onload="somefunction()">. I am not using links, iframes, or the Cache Killer extension. I tested it in Safari and the code is only being called once. This seems to be a Chrome specific problem.
I did some research and it appears this is a bug with Chrome. I found this link https://code.google.com/p/chromium/issues/detail?id=64810
Depending on your specific situation, this page may give you a work around for the problem.
The problem does not seem to be fixed as of yet.

<noscript> not working in Opera 11?

I am testing my noscript tags which display content when javascript is disabled, this works in Safari, Chrome, Firefox, Camino, IE6, IE7, IE8, IE9, basically everything but Opera (I'm running version 11, not sure if its isolated to that version).
In Opera 11 nothing is displayed... is the noscript tag not supported? and what is the alternative?
Nothing surprising:
<noscript>Please enable JavaScript.</noscript>
Located between the body tags.
<html>
<body>
<script>alert('Hello World');</script>
<noscript>Hello World!</noscript>
</body>
</html>
Are you sure you disabled javascript in Opera:
Menu >> Settings >> Preferences >> Content >> Deselect "Enable Javascript"
If so, then post the contents of your entire file here.
EDIT
Until they fix this bug in version 11 which I reckon will happen shortly you can try this:
<script type="text/javascript">
<!--
document.write("<style type='text/css'>.noScript { display: none; }</style>");
//-->
</script>
<span class="noScript">Please enable javascript in your browser.</span>
You are basically using javascript to show css which hides the no script message, but if javascript is disabled then there is no way that css can be displayed hence the message will show.
Uh, yeah. We (as in Opera) broke <noscript> in Opera 11. Known bug.
Implementation of <noscript> is buggy and inconsistent and not recommended. You'd be better off doing something like:
<span class="noscript">Please enable JavaScript.</span>
You can then use JavaScript to hide anything with a class of "noscript" on page load. People with JavaScript disabled will see the message because it won't be hidden.
Hrm. I had wrapped a meta refresh within a noscript, so that a page could automatically reload if a certain set of elements within it couldn't reload via javascript. I can't see any alternative like the hack involving hiding CSS elements. My original thought was perhaps to set a meta refresh header, but override that to not refresh at all if the javascript could execute, but I can't see any ways for javascript to redefine the page refresh time.
try this
<span class="noscript"></span>
<noscript>Please enable JavaScript.</noscript>
The noscript element isn't recommended. It won't work if scripts are partially blocked (e.g. by a corporate firewall or the NoScript extension, or just a temporary DNS failure).
Build on things that work instead.
This works well for me... (Tested in IE, Opera, and FireFox)
<p id="js_disabled">
<script type="text/javascript">
document.getElementById('js_disabled').style.display = 'none';
</script>
Javascript is disabled or not supported by your browser.<br/>
Javascript must be enabled...
</p>
The JavaScript runs immediately so the noscript message never appears.
The idea is to place the JavaScript code immediately following the noscript's opening tag, in this case the paragraph tags.

Categories