PDA

View Full Version : Retrieving document title and URL?



Spinethetic
12-02-2007, 10:17 PM
I have found this great social bookmarking widget-service (http://www.addtoany.com/buttons/) but I have so many pages (all set up in manual HTML files) that it would take days to set it up into each and every single one. However in all of them I have loaded external 'document.write("...")' js files so that I can create the appearance of a Wordpress powered site :p and as such I am able to add content to every page just by adding something into one of the js files.

I am trying to add this widget into one of them and so that my visitors can bookmark certain individual pages that they happen to be on. I would believe there to be a way to do this simply by adding a javascript to <HEAD> and simply putting in some sort of 'variable retriever' into the form fields labeled Your page name and Your page url on this webpage here: http://www.addtoany.com/buttons/

Best Regards
~Ross :)

Twey
12-02-2007, 11:36 PM
I have so many pages (all set up in manual HTML files) that it would take days to set it up into each and every single one. However in all of them I have loaded external 'document.write("...")' js files so that I can create the appearance of a Wordpress powered siteARGH MY BRAIN!

I pity non-JS users who stumble upon your site...

Spinethetic
12-05-2007, 11:51 PM
ARGH MY BRAIN!

I pity non-JS users who stumble upon your site...

Why do you say that? I realize the issue with non-js users though is there a specific problem with using document.write("...")?
Also I plan on integrating a workaround for those users sometime this month anyway.

Best Regards
~Ross :)

Twey
12-06-2007, 12:09 AM
Why do you say that? I realize the issue with non-js users though is there a specific problem with using document.write("...")?Yes. Non-JS users won't get any of that content. For JS users, it will simply slow down the page load rather majorly.
Also I plan on integrating a workaround for those users sometime this month anyway.You're going about this the wrong way. That's not how websites should be built. First comes basic structure and data with HTML, then comes presentation with CSS, then comes functionality enhancements with JS. That way everybody down the chain gets at least the bare contents of the page. Read http://en.wikipedia.org/wiki/Progressive_enhancement and http://www.howtocreate.co.uk/tutorials/design/introduction.