diff --git a/README.markdown b/README.markdown index bcc0fee..37d5729 100644 --- a/README.markdown +++ b/README.markdown @@ -51,4 +51,22 @@ All options are, um, optional, but Reloadr won't actually *do* anything if you d This is kind of a quick and dirty hack. I'd like to add some features to make usage easier, but still keep it simple. Here are some ideas: -- Scan the document's HEAD to find CSS and JS urls to poll. \ No newline at end of file +- Scan the document's HEAD to find CSS and JS urls to poll. +- To this effect, you probably already have jQuery loaded for your project. If so, you can automatically scan for CSS/JS and feed it to reloadr: + + $(document).ready( function() { + var clientResources = Array(); + $("link[type='text/css'], script[type='text/javascript']").each( function(i,el) { + loc = el.href || el.src; + if (loc.match(/yourdomain.tld/)) clientResources.push(loc); + }); + Reloadr.go({ + frequency: 1000, + path: "path/reloadr.php", + client: clientResources, + server: [ + "*.php" + ] + }); + }); +