I am working with web apps, and I am wondering if there is a way to open a link in an app-type window using HTML? Something like this:
My App
Something like this?
Click Here
HTML alone does not support this. You need to use some JS.
And also consider nowadays people use popup blocker in browsers.
open popup
I feel like this is the simplest way. (Feel free to change the width and height values).
<a href="http://www.google.com"
target="popup"
onclick="window.open('http://www.google.com','popup','width=600,height=600'); return false;">
Link Text goes here...
</a>
Open a popup, a sample, link with in the same site.
<a onclick="window.open('/Product/Product', 'popup', 'location=0,width=750,height=650,left=500,top=55'); return false;" class="btn btn-primary btn-sm">+</a>
Related
This is my implementation of tweet button
<a href="https://twitter.com/share?url=generated_url"
class="twitter-share-button"
data-text="Hi, you can see my presentation on this link">Tweet
</a>
There is something like list of presentations and every one has tweet button and itself generated url to share.
It working well, post tweet like I want - text and url. But, when I tweet via this button, link on twitter is unclickable. What is wrong?
EDIT:
unclickable - showed as plain text, example screenshot:
The code is correct, but the links with "localhost" are not clickable.
I had the same problem until I tested with a "live/public" link.
Your generated_url should not contain localhost, but http ://www . yoursite . com / data
I think this page on the twitter dev docs and this question can help a lot. For what i found there, it would be something like this:
<a href="https://twitter.com/share"
class="twitter-share-button"
data-lang="en"
data-url="http://this.url.com/foo/bar">Tweet</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="https://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
With one of my requirements i need to open up the default mailing client with invoking a call to a service, this needs to be accomplished using anchor tags or purely html, the constraint is that we can not use javascript for the same.
Does anyone have any idea on how to accomplish this?
try this:
Click to Mail
This will open default mailing client.
Edit :
You may use onClick function to open new window and call you webservice url in it.like
Click to Mail
you can use like this
<a href="mailto:me#domain.com?subject=Call me&body=dummy mail:">
touch here</a>
try it
If you feel very very daring (and don't mind a horrible hack), you can try if
<meta http-equiv="refresh" content="1; url=mailto:foo#bar.baz" />
on your service page helps you. My brief check in FF suggests that since the new target starts an external program, the page doesn't go elsewhere. This might require some reshuffling of your service, depending on where exactly you want to spawn the mail window.
I'm not sure if this question is being asked, but I can't find any related post about this.
I actually created at pop out box after pressing a submit button so that I can create a user, however the pop out box looks like this
This is the code of it
<g:actionSubmit value="Submit" action="createUser" class="btn_gray_large" type="button" role="button" aria-disabled="false" onclick="return confirm('${message(code: 'default.button.cancel.confirm.message', default: 'Are you sure?')}');"/>
I want to change the "The page at localhost:8080 says:" part into something else.
Is there anyway i can change that? By the way I'm using gsp grails and groovy to do this.
Thanks in advance!
You can't change it (for security reasons), but you can make your own using something like jQuery dialog or jQuery Alert Dialogs if you use jQuery, or the Javascript confirm dialog for vanilla js.
I have a hyperlink with contains third party website link. I want to open this link in new tab with print command. How can i do this?
Suppose:
Print
Note: I know how to open a link in new TAB/Window. I want to know how to open with PRINT DIALOG.
You could try something like this:
print pdf
This method works well for me.
<a href="/url/" onclick="window.open(this.href).print(); return false">
There is no way for a website to cause a browser to load a third party website and display the print dialog for it automatically.
<img src="print.png" style="cursor:hand" onclick="window.frames['pact'].print();"><iframe name="pact" src="pact.pdf" width="0" height="0" frameborder="0"></iframe>
This absolutely worked for me. I'm coding a site in Angular 6.
Print
Here's my source (enter link description here) but watch out for double quotes in the originak source.
:)
This is depend on your browsers, you can enable the tab for new link, If you are using Firefox you can enable the tab using Firefox -> Options -> options -> open a new windows in a new tab instead option
I have added a back form button to my website, which works great, but i am wondering if it is possible to replace it with a home button if a visitor has just landed on my website.
This is my form button:
<FORM><INPUT VALUE='Back' id='backbutton' onClick='history.go(-1);return true;' type='button'/></FORM>
and i want it to be replaced by this if visitors have just landed on my website:
<FORM><INPUT VALUE='Home' id='homebutton' onClick='href="http://www.gamer4eva.com/"' type='button'/></FORM>
You could see if the visitor is from your site with $_SERVER['HTTP_REFERER']
Best use preg_match on it to get the domain, and if its not your site that means they came from somewhere else.
This is not 100% accurate though, since users can edit the HTTP_REFERER value.
Good luck
This is a clientside solution:
onClick="(document.referrer.match('gamer4eva.com') || document.referrer === "")?href='http://www.gamer4eva.com/':history.go(-1)"
and you don't need a form for that. Better use an anchor:
Back
of course you could also check this serverside. Depends on your taste.