My html link only opens with open in new tab? - html

My code has been working fine before but since I added the onlick part, i can no longer access it on left click. I have to open it in new tab.
<a onclick="event.preventDefault(); window.parent.postMessage('link_url:'+this.href,'*');" href="?redirect=Pro" class="btn btn-accept display-5" target="_blank">I AGREE</a>
I cant remove that part since I need it otherwise my other redirect links from another php file wouldnt work. If i remove it, I cant redirect properly. Kindly asking for advice on how to fix this so I can open with left click or at least automatically open in new tab on left click. Thanks in advance.

Remove the event.preventDefault Function from your HTML line. Because,
This will prevent your events.
<a onclick="window.parent.postMessage('link_url:'+this.href,'*');" href="?redirect=Pro" class="btn btn-accept display-5" target="_blank">I AGREE</a>

Related

Make a button that opens a fresh new tab in HTML, no link, just a new tab

Is it possible to make a button, that when clicked, opens a new tab. Not any link, just a new tab. so far I have <button target="_blank" onclick="location.href = ''">New Tab</button>
Simply link to about:blank with the target _blank
<a target="_target" href="about:blank"><button>New Tab</button></a>
The answer is, its impossible. You can't navigate to the users default home page, as stated by Gradyn Wursten. Though you can navigate to a blank white page, using about:blank

Generate Amazon link for open side popup with pre-applied filters

Edit: Stackoverflow modify automatically the Amazon links when you click, so for see the popup, select, copy and paste the URLs in the browser.
On Amazon there is a link to open directly a side popup, like this:
https://www.amazon.com/dp/B07FKTZC4M/#aod (#aod open the popup)
where We can enter some filters. I tried different ways with no success to generate a link that open directly the site popup with new filter pre-applied.
So i need a link that open this page with "new filter" pre-applied:
I tried different solutions, but don't work, for example:
https://www.amazon.com/dp/B07FKTZC4M/ref=aod_f_new#aod
https://www.amazon.com/dp/B07FKTZC4M/ref=new#aod
https://www.amazon.com/dp/B07FKTZC4M/#aod_f_new=true
https://www.amazon.com/dp/B07FKTZC4M/ref=aod_f_new=true#aod
https://www.amazon.com/dp/B07FKTZC4M/ref=aod_f_new?ie=UTF8&f_new=true#aod
I see some informations on source page, maybe that help:
Question: Is there a way to create a link that open directly the side popup with new filter pre-applied? Maybe adding some parameters to the URL.
You can call a function in JavaScript with which you can change the z-index of the popup.
Something like this:
<button onclick="popup()" value="open popup">
Also make the popup. I am just making a rough one:
<div id="popup" style="z-index:1000; position: absolute;">Some code</div>
Remember to set the z-index at behind and the position. Then for JS i will make it simple in case you can't code JS
function popup(){
document.getElementById("popup").style.zIndex=-1;//basically changing the popup's z-index
}
This will just change the z-index of the popup which you must create yourself

Make button enable in html5 from imacro

The button gets disable after one click and to click again i have to refresh the page. This is the html code to the button
/*<button class="btn btn-large center-block btnvote vote" id="765" disabled="disabled">Vote for me</button>*/
I want to make the button enable by using imacro by deleting this disabled="disabled" and click again by using macro.
Can any one help?
using javascript you can remove the disabled property:
document.getElementById('765').disabled = false;
you may need to have a quick search on how to run javascript in imacro if you don't already know how to do this.

How can I make a HTML a href hyperlink open a new window?

This is my code:
test
When you click it, it takes you to Yahoo but it does not open a new window?
test
Easy as that.
Or without JS
test
In order to open a link in a new window, add Javascript command
onclick="window.open('text-link.htm', 'name','width=600,height=400') inside the <a> tag:
Open page in new window
Given answer might be helpful when you want to open a new tab or browser user preference is set to open new window instead of tab, since the original question is about open new window not a tab, here is what works for me.
<a href="#" onClick='window.open(url, "_blank", "resizable=yes, scrollbars=yes, titlebar=yes, width=800, height=600);'>test</a>
Check this one too

Facebook like button changes to a "confirm" button and jumps to the left when clicked

I've embedded a facebook like button on our page http://makethecitysoundbetter.com
When i click it, it turns into a "confirm" button, and moves to the left. When i click the "confirm" i get the normal share box, and after that i works as it should.
I have copied the instructions exactly from facebook's Like button page: developers.facebook.com/docs/reference/plugins/like/
And i've even created an empty html page ONLY with facebooks code, copy pasted and placed exactly as they've written (http://makethecitysoundbetter.com/fb_test.html).
I've tried both the HTML5 and XFBML code, both with the same results..
Does anyone know what is going on, and how i can fix this?
It's very important that our share function works!
Thanks in advance!
Andy
I had the exact same problem. I ended up using the iframe version of the like button and now everything works great.