Hmmm (#2511)

Home

Javascript crapola

Dec
142004
Getting an error saying

"Depracated method document.getSelection() call. Please use window.getSelection() instead"

in a favelet that I've written... only thing is document.getSelection() works and window.getSelection() doesn't, what's that all about?

Paid off my very last council tax installment to Hackney Council it seems, by paying next months in advance... the lady on the phone was very odd saying "Ooh, well done!". Does this mean they don't expect people in Hackney to actually pay? This would explain why it's so bloody high, if I was the person who was subsidising everyone else... by the time payments start up again we'll be based permanently inFolkestone...
TweetComment / reply

Which browser are you using? window.getSelection() should work under FF...

Which browser are you using? window.getSelection() should work under FF...
15 Dec TweetComment / reply

I set up a "favelet" under FF today and had no problem or reports of deprecated functions - what are

I set up a "favelet" under FF today and had no problem or reports of deprecated functions - what are you trying to do?
15 Dec TweetComment / reply

Here's my favelet

Hope this will reproduce OK on here:

javascript:function%20s(h){r='';t=0;for(i=0;i'){t=0;}else{if(!t)r+=c}}return%20r}w=window;d=document;l=location;q='';f='';if(!q&&w.getSelection){q=w.getSelection();f+='w.gs'+q+'%250D%250A'}if(!q&&d.getSelection){q=d.getSelection();f+='d.gs'+q+'%250D%250A'}if(!q&&d.selection){q=d.selection.createRange().text;f+='d.s'+q+'%250D%250A'}if(!q){q=d.body.innerHTML;f+='d.b'+q+'%250D%250A'}l.href=('http://www.clarkeology.com/cgi-bin/board.cgi?mPrecis='+l.href+'&mSubject='+escape(d.title)+'&mText='+s(q)+'%250D%250A[['+escape(l.href)+'%250D%250A%250D%250A'+s(q))

Those are arbitrary breaks in there, it should all be on one line... getSelection does work, but it's clashing with something else, the results of my function s() aren't being appended to the URL... that's the prob with writing these things on just one line, it's a bit hard to debug! I need to write it out in full and then write a sort of compiler that'll shrink the code as much as poss... I will do some more work on this today, it might be all good by the time you see it. Well, hopefully...


Glossary:

javascript: a major programming language of the internets, mostly how I make my living
16 Dec TweetComment / reply

Hmmm

Hmmm... I get problems with it interpreting the charAt() method on my FireFox... Might have some time to play this afternoon through.
22 Dec TweetComment / reply

Not sure why that's broken

You're right though, as just javascript:function%20s(h){r='';t=0;for(i=0;i'){t=0};if(!t){r+=c}}return%20r}w=window;d=document;l=location;q='';;f='';if(!q&&w.getSelection){q=w.getSelection();f+='w.gs'+q+'%250D%250A'}if(!q&&d.getSelection){q=d.getSelection();f+='d.gs'+q+'%250D%250A'}if(!q&&d.selection){q=d.selection.createRange().text;f+='d.s'+q+'%250D%250A'}if(!q){q=d.body.innerHTML;f+='d.b'+q+'%250D%250A'}l.href=('http://www.clarkeology.com/cgi-bin/board.cgi?mPrecis='+l.href+'&mSubject='+escape(d.title)+'&mText='+'%20%20[['+escape(l.href)+'%250A%250D%250A%250D'+q)]]
works, but my function s() is trimming out the HTML and truncating... it was working OK, will have to backtrack a bit...


Glossary:

javascript: a major programming language of the internets, mostly how I make my living
22 Dec TweetComment / reply

Fixed it now

Recommended / related
Still got some debugging crap in here:

javascript:function%20s(q){r='';t=0;for(i=0;i'){t=0};if(!t){r+=c}}return%20r}w=window;d=document;l=location;q='';f='';if(!q&&w.getSelection){q=w.getSelection();f+='w.gs'+q+'%250D%250A'}if(!q&&d.getSelection){q=d.getSelection();f+='d.gs'+q+'%250D%250A'}if(!q&&d.selection){q=d.selection.createRange().text;f+='d.s'+q+'%250D%250A'}if(!q){q=d.body.innerHTML;f+='d.b'+q+'%250D%250A'}l.href=('http://www.clarkeology.com/cgi-bin/board.cgi?mPrecis='+escape(l.href)+'&mSubject='+escape(d.title)+'&mText='+'%5B%5B'+escape(l.href)+'%5D%5D%250A%250D'+s(escape(q))) Blog posting favelet

had to escape the contents of the select before passing it into the function, the function was getting nothing...


Glossary:

javascript: a major programming language of the internets, mostly how I make my living
22 Dec TweetComment / reply

Paul Clarke's - I work and live in Hythe near Folkestone, Kent. married to Clare and father to two, I am a code engineer, and I do mostly javascript, nodejs, python, ruby, and php. I like pubbing, restaurants, home automation and other diy jiggery-pokery, history, genealogy, TV, popbitch, squirrels, pirates ☠, lego, and time travel.

Also from the same week

Some more blog posts from the same week as .

Javascript crapola Getting an error saying "Depracated method... [Tue 14 December 2004]

Which browser are you using? window.getSelection()... [Wed 15 December 2004]

I set up a "favelet" under FF today and had no problem or... [Wed 15 December 2004]

Here's my favelet Hope this will reproduce OK on here:... [Thu 16 December 2004]

Ffffffreezing So, as mentioned before our office party was Friday... [Mon 20 December 2004]

Carol singers Had some carol singers outside the house last night,... [Tue 21 December 2004]

Tonsilitis is very contagious! Hope you weren't blowing... [Tue 21 December 2004]

Lego Thriller Think it must be a problem at their end as I can't get... [Wed 22 December 2004]

Hmmm Hmmm... I get problems with it interpreting the charAt()... [Wed 22 December 2004]

Thriller Ah it's because it's not available at the site that's... [Wed 22 December 2004]

Not sure why that's broken You're right though, as just... [Wed 22 December 2004]

Fixed it now Still got some debugging crap in here:... [Wed 22 December 2004]

The Pogues - alright Went to see The Pogues last night at Brixton Academy ,... [Wed 22 December 2004]

DJ BC presents The Beastles dj BC presents The Beastles , more mashups... I'm... [Wed 22 December 2004]

Some mates of mine went and were planning to start their... [Wed 22 December 2004]

Santy worm makes unwelcome visit The Santy worm first appeared on 20 December and within... [Wed 22 December 2004]

Merry Christmas In an interweb cafe (but without the cafe) in Folkestone,... [Thu 23 December 2004]

Just stumbled across this post about The Goose, Brixton again It's been renamed a few times since then and is now " The... [Tue 21 December 2010]

follies shares go ape hospital inn doors ad blocker raspberry pi wfh payers park scottevest chambers mortgage beetle harbour arm orlando micropub pizza new york vegan pay day working from home sofia premier inn center parcs tower bridge share save tax docker harry potter studios holiday bulgaria

Paul Clarke

Links

Latest

Todo:

Projects

Privacy policy