I am making a chrome extension and I have a popup.html page that contains a form with method post, it does not do anything when opened using the popup button however if the page is opened as an options page or just a normal html page, the form posts fine and the new page is loaded.
so something in the popup is preventing the form from working.
I cannot figure out why, anyone know how to fix/work around this ?
You need to do an AJAX POST request. A quick Google search brought up this post.
Maybe an answer duplicate of Paypal Button For Google Chrome Extension.
Just in case that somebody arrives here, try adding a simple target="_blank" to your tag (Works with Paypal donate buttons, for example)
Related
I doing a button to share a link to WhatsApp but after I clicked my button, the WhatsApp web shows the message "We couldn't find the page you were looking for".
this is my code
<a target="_blank" ng-href="https://wa.me/?text=aaa" data-action="share/whatsapp/share"></a>
after clicked my button, the URL
https://api.whatsapp.com/resolve?deeplink=/%3Ftext%3Daaa
May I know why the Whatsapp web show the message?
You code is correct, but..
It seems like Whatsapp broke this functionality a while ago. Only these kinds of texts with numbers are working at the moment.
(Was using the same functionality on my own site, have not found a proper replacement yet that works in all places/devices)
I fixed this issue by changing the href url to https://api.whatsapp.com/send/text?=aaa.
I have a button on my website allowing the users to share the site on Facebook.
The button has the following anchor tag:
https://www.facebook.com/sharer/sharer.php?u=example.com.au
This redirects the user to a site where they can post on their Facebook Page. Once the user click's 'Post', Facebook automatically redirects the user to a blank page which has the following in the address bar.
https://www.facebook.com/dialog/return/close#=
I want to direct the user to my own custom website rather than the blank Facebook default.
A quick Google search on this issues suggested that I need to add a redirect parameter in the URL so that Facebook knows where to redirect the user once they complete the post. It is meant to look like this:
https://www.facebook.com/sharer/sharer.php?u=example.com.au&redirect_uri=http://newsite.com
As you can see, I have added the parameter "redirect_uri" and I have set it to: htttp://newsite.com
Only one small problem.....
It doesnt work!
I have no idea why, but it still directs to the default blank page (https://www.facebook.com/sharer/sharer.php?u=example.com.au)
I have tried clearing my browser cache, I have tried different browsers, I have even tried multiple devices but I still can't get this to work.
Am I doing something wrong? Did Facebook deprecate this feature?
FYI: This is where I found to use the redirect parameter:
https://developers.facebook.com/docs/sharing/reference/share-dialog
I don't know why it doesn't return to the correct URL, but I had a similar problem and created the below solution:
<a href="#" onclick="fbShareWindowOpen()">
<span id="fbShareButton">Share this on facebook!</span>
</a>
<script>
function fbShareWindowOpen() {
var myWindow = window.open("https://www.facebook.com/sharer/sharer.php?u=www.url-to-share.com/", "", "top=30px,width=200,height=100");
}
</script>
This will open up a window that will resize correctly to fit the facebook sharer UI. When the link is shared (the share button has been clicked) the new window closes, making for a very clean flow.
I don't know for sure, but I assume the facebook sharer child window is closed by the "..return/close.." redirect URL.
I'm wondering if anyone can help me. I'm hoping I can open an iFrame in the centre of my webpage from clicking a picture. So in effect the iframe would be hidden until the picture is clicked. I have a very small and simple upload form on another page that I would like to appear when the user needs to upload and click the picture. I've had a good look round on this site and google in general but not found what I'm looking for, or the basics weren't included because it's common knowledge for most people here. Would there also be a way of closing this when it's finished uploading too? The form currently diverts to the homepage when finished so It would be handy to have a close option as in the end (post successful upload) the iframe contents will be the same as the page it's displayed on.
The best/easiest I have come across has been on w3schools but I have read using html for iFrames is not widely accepted or it isn't the best option cross-browser.
I have been viewing and trying different code but without even the basic knowledge I can't get my head around it.
If anyone is able to help, please assume I'm 5 years old. I'm not daft but in terms of code I'm literally just starting.
Thanks in advance
You would need to add a javascript onclick function to your img tag which would open a new window upon a click. You would pass the window.open function the name of the html file you want to display. Something like this:
<img src="image.jpg" onclick="window.open('welcome.html')">
I have a code snippet that is installed on third party websites. I can't get into the details, but it loads HTML, CSS and JS onto the page through the use of a <script> tag.
Part of the code is a JS function that executes when this link is clicked:
?
If there are JS errors on the page that prevent the function from executing, clicking the link obviously just adds the hash to the URL and takes the user to the top of the page. This is the expected fallback behavior.
However, on one third party site with a multitude of JS errors, clicking the link removes everything after the top level domain, adds the hash, and directs to that page (the home page). For example, the link would take the user from:
http://www.example.com/2010/05/14/very-interesting-blog-post/
to
http://www.example.com/#
Notably, the issue occurs in Firefox and Chrome, but not IE9. I know it may be impossible to properly diagnose the issue without more detailed code, but I'm not at liberty to provide it. I'm just hoping to get some kind of reasonable explanation for this strange browser behavior.
If it helps at all, the site in question is a WordPress blog. Thanks in advance.
EDIT: This is apparently not caused by any JS on the site, because turning off JS and adding the link with the inspector produced the same behavior.
I had a similar error where clicking on any <a href="#"> causes a full page reload. I managed to solve this by removing the <base href="/"> tag from the <head> of the page. I couldn't find any informations on this (yet). I'll add more if I can find any additional info.
This problem happens when you use windows.onpopstate to handle back or forward buttons and load page using ajax. Try to solve your js code for handling history.
I'm trying to create a relatively basic custom fan page tab with Developer, and for some reason I'm unable to add the app to any pages. In the past with other similar , I've had a "view app profile page" link on the left, but for some reason it's not showing up.
Am I missing a step?
Go to: https://www.facebook.com/dialog/pagetab?app_id=YOUR_APP_ID&next=YOUR_URL where YOUR_APP_ID is found in your app settings, and YOUR_URL is indeed the URL of the tab (this has to be there an correct). This will take you to the Add to Page Dialog of your page.
This is taken from this tutorial: https://developers.facebook.com/docs/appsonfacebook/pagetabs/
If you want to make a button so that anyone can add the tab to their pages check DMCS' link.
See: http://developers.facebook.com/docs/reference/dialogs/add_to_page/