How do I make an "email current page" button in HTML? - html

The desired goal: I am trying to make an "email current page" button to go on my website. These are the necessary functions:
It should be versatile to match any page the button is on (ie different articles I put up on my site, etc)
It should have no recipients set automatically
It should have a fixed subject line
It should have body text that includes a link to the current page (again, not a fixed link, but a versatile link that adapts to whatever page the button is activated on).
Lastly, the email button should be visible on the webpage in the form of an image icon.
I am a total html novice (my experience amounts to a few days of playing around on wordpress) so I know absolutely nothing. This is what I came up with (which clearly doesn't work):
this company. They are a search engine. I thought this might be of interest to you. " target="_blank"><img src="http://www.ccaa.ca/web/templates/cc… /></a>
According to www.w3schools.com/html/ this was way wrong, lol. I have tried to put it right but I'm just wrecking it more. Please advise! I've changed the links to remove personal company info and replaced it with generic things such as google, etc. Please tell me what I've done wrong and what I need to do to fix it. Thanks so much!
PS - would it be better to do a form? If so, where do I start? Can I still use the button as a link to the form? Many thanks for the help.

<html>
<head>
<title>My Page</title>
<script language="javascript">
function emailCurrentPage(){
window.location.href="mailto:?subject="+document.title+"&body="+escape(window.location.href);
}
</script>
</head>
<body>
Mail this page!
<body>
</html>
Enjoy!

I would check out a third-party tool such as AddThis, which supports sharing via e-mail and social networks:
http://www.addthis.com/
There is a specific WordPress plug-in or you can add the standard widget to any webpage.

Related

From Newsletter thank you form - what HTML code can I add to make sure the <a href="http://mywebsite.com"> refreshes?

I have just created a Newsletter Form on my website, via an external provider called "Benchmark" - to save time because I am not a professional programmer, so I only know HTML and CSS coding so far.
Their service generates an automatic thank you page that I am free to use, but when you click "back to the website", it automatically goes back to the cached page, which means that all the data inserted into the Newsletter form (email and name) is still there.
I think this gives the customers a lot of uncertainty about whether their data has gone through (and Benchmark replied that I had to make my own "Thank You" page if I want this function), so I would like to create my own page with a link (using HTML-code), which will automatically refresh the page that is linked back to - so that the customer comes back to the page with an empty Newsletter Form.
I have seen some similar questions with answers in the Forum, but as far as I could see, they use other programming languages that I don't know how to implement, so if anybody knows of a method of how to do this with HTML (and CSS, if needed), I would be very grateful. Thank you in advance!
If I understand correctly, you want a page that will redirect to your newsletter form (with the fields empty). You have a couple of options: use a bit of javascript, or use an HTML meta tag. For both of these you'll need a new page. Since you want a pure HTML answer, I'll show you the meta tag version first.
For the meta tag, you'll simply want to put the following code in the head section of your page:
<meta http-equiv="refresh" content="0; url=http://example.com/" />
The javascript solution would also go in the head section as a <script> tag:
<script type="text/javascript">window.location.href = "http://example.com/";</script>
In either one, just replace http://example.com/ with the address of your newsletter form and you should be good to go.
There's also this question that you can look at if you want to learn more.

Open up window in same window html

I have been working with html and css for about 6 months, and a very very little javascript.
I recently saw this site here: http://daegonner.com and i noticed if you click "vote" it opens up this window box, but on the same website.
How is this made?
There are some thing you need to do to have that look.
Firstly you need to create that small windows using css and html, by the way it's called modal (like this one http://getbootstrap.com/javascript/#modals)
Secondly, you need to study javascript onclick events (you can refer here http://www.w3schools.com/jsref/dom_obj_event.asp), which help the small window display when you click to vote link.
Finally, the content inside that box is up to you. The page which you gave embed the content from another page through .
Look for CSS Popup or Lightbox on Google, you will finde something helpfull
You will have to include the jQuery library within the <head> tag:
<head>
<script src="//code.jquery.com/jquery-1.11.2.min.js"></script>
</head>
And then download, include and use some of these plugins or whatever else you find.
http://dimsemenov.com/plugins/magnific-popup/ (recommend - very good and easy to use)
http://www.jacklmoore.com/colorbox/

Email template: Inside Linking

I have a HTML template for my emails, i wanted to know if its posible like to implement a menu, and the link redirect to the corresponding part of the content.
example: imagine the menu is: banna, apple, juice, coke.
and then the content goes: banna etcetcetc, apple etc etc etc...
make each one link to the exact content? thanks..
Nope, sorry. What you're talking about requires some sort of conditional, and that would require a script. Most email clients strip your <script> and <link> tags. Unless you want to get your hands dirty with some server-side code like gif sockets why not link to a little webpage where you can do any of those?
EDIT FROM COMMENTS
Thinking about it now.. Would hashtag linking work for you? Like clicking a link and having the scroll bar jump to that position? you can accomplish that with <a name="linktotop">Other link will scroll to this</a> and Scroll! I just tested it in outlook.com and gmail and it seems to work. No promises on the other clients though.

How to open an iframe from clicking an image

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')">

Google Chrome Extension: Webpage in Popup

I'm new to creating extensions and I also don't know much about html but I have an idea for a chrome extension that should be pretty simple so if you give me a little help I may be able to do it.
I want a popup to open when the user clicks the extension-icon (like most extensions) and the popup is supposed to contain a webpage like "http://google.com". That's actually about it. I created the manifest file with the required data and thats fine, now I need to know how to make the html file contain the external webpage.
Another problem: when I tried different things in the html file the popup was tiny and just white.
I hope someone can give me hint. Thanks!
I have made an extension wich displays links to several websites.
My popup.html looks like this:
<!DOCTYPE html>
<html>
<body>
<p>
<a href="http://www.google.com" target="_blank>Google</a> <br/>
<a href="http://stackoverflow.com" target="_blank>StackOverflow</a> <br/>
</p>
</body>
</html>
The target="blank means it opens the site in a new tab
More information about html is found here:
http://www.w3schools.com/html/html_links.asp
Be sure to make the icon 19x19 pixels,and be sure to name it in the manifest.json file
with the filename extension for example
"browser_action":{
"default_icon":"iconname.png",
"default_popup":"popup.html"
}
You should be able to use an iframe tag within your popup. I do that many times to point the user a FAQ page hosted outside.