MyBB Community Forums

Full Version: Save button
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi every body,

I wanna have a save page button (sth like browsers save page button) in my forum and I found this code but it doesn't work even in IE:
http://www.javascriptfreecode.com/37.htm

Could any body help me to have such a button?

Thanks
Moved to Web Development & Administration.
I did some work, from what I read it's a security thing, so it's likely gonna be something you either have to commission someone to get it custom, or find a different way to do it.

Perhaps look at a different way to save them? Maybe as a PDF or something.
(2014-10-01, 05:03 PM)jvdabz Wrote: [ -> ]Hi every body,

I wanna have a save page button (sth like browsers save page button) in my forum and I found this code but it doesn't work even in IE:
http://www.javascriptfreecode.com/37.htm

Could any body help me to have such a button?

Thanks

You can accomplish this with HTML5, though it's probably not exactly what you're looking for (Doesn't save images or CSS, saves as .php).

<a href="#" class="downloadLink" download>Download Page</a>

$(document).ready(function() {
    var url = window.location.href.split('#')[0];
    $('.downloadLink').attr('href', url);
});

Like .Lo said, if that isn't what you want you'll have to look into other options, as it's the best HTML/JS can do.

Edit: Also I made this on localhost, not sure if it will act differently on a server.
(2014-10-01, 07:11 PM)Lo. Wrote: [ -> ]I did some work, from what I read it's a security thing, so it's likely gonna be something you either have to commission someone to get it custom, or find a different way to do it.

Perhaps look at a different way to save them? Maybe as a PDF or something.

Thanks

(2014-10-01, 08:40 PM)Eric J. Wrote: [ -> ]
(2014-10-01, 05:03 PM)jvdabz Wrote: [ -> ]Hi every body,

I wanna have a save page button (sth like browsers save page button) in my forum and I found this code but it doesn't work even in IE:
http://www.javascriptfreecode.com/37.htm

Could any body help me to have such a button?

Thanks

You can accomplish this with HTML5, though it's probably not exactly what you're looking for (Doesn't save images or CSS, saves as .php).

<a href="#" class="downloadLink" download>Download Page</a>

$(document).ready(function() {
    var url = window.location.href.split('#')[0];
    $('.downloadLink').attr('href', url);
});

Like .Lo said, if that isn't what you want you'll have to look into other options, as it's the best HTML/JS can do.

Edit: Also I made this on localhost, not sure if it will act differently on a server.


Thank you for your consideration,

but unfortunately (as you said) your code saves the page with php format and what I want is html format.
Can you please provide any solution for this?
(2014-10-01, 09:38 PM)jvdabz Wrote: [ -> ]
(2014-10-01, 07:11 PM)Lo. Wrote: [ -> ]I did some work, from what I read it's a security thing, so it's likely gonna be something you either have to commission someone to get it custom, or find a different way to do it.

Perhaps look at a different way to save them? Maybe as a PDF or something.

Thanks


(2014-10-01, 08:40 PM)Eric J. Wrote: [ -> ]
(2014-10-01, 05:03 PM)jvdabz Wrote: [ -> ]Hi every body,

I wanna have a save page button (sth like browsers save page button) in my forum and I found this code but it doesn't work even in IE:
http://www.javascriptfreecode.com/37.htm

Could any body help me to have such a button?

Thanks

You can accomplish this with HTML5, though it's probably not exactly what you're looking for (Doesn't save images or CSS, saves as .php).


<a href="#" class="downloadLink" download>Download Page</a>

$(document).ready(function() {
    var url = window.location.href.split('#')[0];
    $('.downloadLink').attr('href', url);
});

Like .Lo said, if that isn't what you want you'll have to look into other options, as it's the best HTML/JS can do.

Edit: Also I made this on localhost, not sure if it will act differently on a server.


Thank you for your consideration,

but unfortunately (as you said) your code saves the page with php format and what I want is html format.
Can you please provide any solution for this?

Well the actual contents of the page are HTML so you can manually change the extension to .html, but as mentioned to get any other result you'll have to use other methods.