I'm trying to add a payment button to my web page (wix). When clicked, it opens in the same iframe like a widget, but I would like it to open in a new tab when clicked. target="_blank" does not work.
Example code:
<html>
<body>
<script src="https://www.example.com./integrations/v1/web-payment-checkout.js"
data-preference-id="example" data-source="button">
</script>
</body>
</html>
With Bootstrap you can use an anchor like a button.
OR use style to customize link as to appear like a button.
And use target="_blank" to open the link in a new tab.
<html>
<head>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
</head>
<body>
<br>
<a class="btn btn-success" href="https://www.google.com" target="_blank">open google in new tab</a>
</body>
</html>
If you want to open a link in a new tab from velo, I made a video workaround below:
https://joelgrayson.com/open-in-new-tab-wix-code
https://youtu.be/7yp-kLGu1Yw
Essentially, you cannot use <a href='' target='_blank'> in velo, but you can do it in an HTML frame. In the workaround, I messaged the HTML frame from velo. Upon receiving the message, the HTML frame opened using <a href='' target='_blank'.
Related
I'm building a course site for my students, with different 'chapters' accessed from different links. I would like to be able to have two or more popups of the same page so I can view different parts of the same chapter side by side. Is this possible in highslide (I don't think it is...). Any solution, using highslide or not, would be appreciated!
Here's a jsfiddle demo that lets you open multiple HTML popups. In this case, both links are opening the same page of stuff, but that's just to keep the demo setup simple - normally you would have each link opening a different iframed page, but for your specific requirement, I guess you'd be opening the same page twice, just like this demo. Open the first link, then drag it by the header to one side, and open the second link.
http://jsfiddle.net/MisterNeutron/Qk6U6/1/
The code:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Demo by MisterNeutron</title>
<script type='text/javascript' src="http://highslide.com/highslide/highslide-full.js"></script>
<link rel="stylesheet" href="http://highslide.com/highslide/highslide.css">
<script type='text/javascript'>
hs.graphicsDir = 'http://highslide.com/highslide/graphics/';
hs.outlineType = 'rounded-white';
hs.wrapperClassName = 'draggable-header';
</script>
</head>
<body>
<div>
<a id="thumb1" href="http://highslide.com/examples/includes/include-short.htm" onclick="return hs.htmlExpand(this, { objectType: 'iframe' } )">First iframe</a>
<br><br>
<a id="thumb2" href="http://highslide.com/examples/includes/include-short.htm" onclick="return hs.htmlExpand(this, { objectType: 'iframe' } )">Second iframe</a>
</div>
</body>
</html>
I have used Dreamweavers menues to do give my site a dropdown list that I can then edit. Perhaps "open in new window" when you click the link will work. I have found that most clicks will default to open in the same window.
Opening tab with
require("sdk/tabs").open({
url:require("sdk/self").data.url("demo.html")
});
demo.html contains this element:
<a target="_blank" href="https://developer.mozilla.org/en-US/Add-ons/SDK/High-Level_APIs/tabs">click me</a>
The target attribute is not honored, the page opens in the same tab and of course is subjected to all attach events on the tab.
I would comment but don't have enough reputation.
I just set up fresh firefox addon repo using cfx init to test this out, and in my case, it did open the link in a new tab.
Here is the code.
main.js
require("sdk/tabs").open({
url:require("sdk/self").data.url("demo.html")
});
and demo.html:
<html>
<head>
</head>
<body>
<p>Hello!</p>
<a target="_blank" href="https://developer.mozilla.org/en-US/Add-ons/SDK/High-Level_APIs/tabs">click me</a>
</body>
</html>
I'm using HTML5 and I get the website url links to open up in another window named "collegeWin" via, , but i'd like for all the links I click to open to that same window, not a new window everytime. I don't want many new windows every click on a link. I did what the book said to, using the base element and use the target="collegeWin" but no luck. Any thoughts?
Here's my code:
<meta charset="UTF-8" />
<title>Wisconsin Colleges and Universities</title>
<script src="modernizr-1.5.js"></script>
<link href="hestyles.css" rel="stylesheet" type="text/css" />
<base target="collegeWin" />
Basically, you want to open all of your links 1 particular frame. Try this...
function callme(event) {
event.preventDefault();
document.frames["frame"].location = $(this).attr('href');
}
markup:
<a href="http://google.com" target="frame" onclick="callme.call(this,event)">
Link
</a>
<a href="http://yahoo.com" target="frame" onclick="callme.call(this,event)">
Link
</a>
Try this:
jsFiddle
I've been practising some HTML5 as of recent, and come to a halt. I've added an anchor to a part of the code, but when I try to link to it, the link goes straight to the base link. Is there anyway to get past this?
This is the snippet of the code:
<head>
<base href="http://en.wikipedia.org/wiki/" target="_blank" />
</head>
<body>
(...)
Link to anchor: Link!
(...)
<a name="link">Welcome!</a>
</body>
Thanks!
Try:
<span id="link">Welcome!</span>
The name attribute is for form elements in HTML5.
<head>
<base href="http://en.wikipedia.org/" target="_blank" />
</head>
<body>
(...)
Link to anchor: Link!
(...)
<a name="link">Welcome!</a>
</body>
The main HTML window of my application some like this:
<html>
<body>
<a id="a1" href="http://www.example.com/" target="_blank" >Link</a>
</body>
</html>
How I can listen for events occurring when opening new windows by clicking on the link?