custom404/README.md

31 lines
918 B
Markdown
Raw Normal View History

2014-01-14 00:32:09 +01:00
# Custom 404
2013-07-20 18:19:58 +02:00
2014-01-14 00:32:09 +01:00
## JQuery plugin for custom error pages
2013-07-20 18:19:58 +02:00
2014-01-14 00:32:09 +01:00
## Info
A jQuery plugin that allows you to use custom error pages.
2014-01-14 00:35:51 +01:00
To be used when you can not edit the file `.htacces` Apache or when using
2014-01-14 00:32:09 +01:00
applications on non-ASP on an IIS server.
Simply checks if the requested resource is available when you open a link.
### Usage
Add in head:
2013-07-20 18:19:58 +02:00
2013-07-20 18:27:15 +02:00
<script src="https://raw.github.com/Rnhmjoj/Custom404/master/jquery.custom404.min.js" type="text/javascript"></script>
2013-07-20 18:19:58 +02:00
2014-01-14 00:32:09 +01:00
In a script:
2013-07-20 18:19:58 +02:00
$(document).ready(function(){
2014-01-14 00:34:17 +01:00
$("a#test").custom404({404: "404page.html"});
2013-07-20 18:19:58 +02:00
});
2014-01-14 00:32:09 +01:00
Options are `statusCode: url`. All the http status codes are fine.
If you do not select anything by default all the links on the page will be used.
You can find an example [here](http://jsfiddle.net/NY9dH/).
### License
2014-01-14 20:28:31 +01:00
Dual licensed under the MIT and GPL licenses:
http://www.opensource.org/licenses/mit-license.php
http://www.gnu.org/licenses/gpl.html