tag:blogger.com,1999:blog-15626356.post113688648018920768..comments2012-10-17T10:09:12.903-07:00Comments on ecmanaut: Adding javascript to Blogger postsJohan Sundströmhttp://www.blogger.com/profile/04076097346172610543noreply@blogger.comBlogger15125tag:blogger.com,1999:blog-15626356.post-46038904125332799472008-06-12T14:35:00.000-07:002008-06-12T14:35:00.000-07:00Last time I checked, you wrote script code in Blog...Last time I checked, you wrote script code in Blogger blog posts by using the <script/gt; tag just as usual (see second paragraph, in bold face).Johan Sundströmhttps://www.blogger.com/profile/04076097346172610543noreply@blogger.comtag:blogger.com,1999:blog-15626356.post-51417509241260775392008-06-12T12:53:00.000-07:002008-06-12T12:53:00.000-07:00Where to put this block of javascript code....in t...Where to put this block of javascript code....in template so that it accurs automatically with every post ,or we can copy this code to current blog post ?<BR/>I wanted to put javascript games on my blog..<BR/>thankssumithttps://www.blogger.com/profile/01940624040906853438noreply@blogger.comtag:blogger.com,1999:blog-15626356.post-58445899510923736392008-03-08T17:21:00.000-08:002008-03-08T17:21:00.000-08:00Typed "javascript blogger" into google because I n...Typed "javascript blogger" into google because I needed this, your site came up, copied and pasted code, sorted! Thanks very much :)Duncanhttps://www.blogger.com/profile/12519826343100100135noreply@blogger.comtag:blogger.com,1999:blog-15626356.post-1164572329246095672006-11-26T12:18:00.000-08:002006-11-26T12:18:00.000-08:00Won't checking this checkbox when creating a post ...Won't checking this checkbox when creating a post produce lots of errors when republishing the blog?Pornsterhttps://www.blogger.com/profile/10468626706100440267noreply@blogger.comtag:blogger.com,1999:blog-15626356.post-1163841207121692032006-11-18T01:13:00.000-08:002006-11-18T01:13:00.000-08:00Drop the script tag in the first example; that pur...Drop the script tag in the first example; that purpose is already filled by the code tag and cdata statement combination.Johan Sundströmhttps://www.blogger.com/profile/04076097346172610543noreply@blogger.comtag:blogger.com,1999:blog-15626356.post-1163837289192711082006-11-18T00:08:00.000-08:002006-11-18T00:08:00.000-08:00More typos in the link... It's getting way to late...More typos in the link... It's getting way to late here. There is an L missing in CopperBarre<B>l</B>:<BR/><BR/>http://www.copperbarrel.com/hot/digg_code_error.gif<BR/><BR/>anda<BR/><BR/>http://www.copperbarrel.com/hot/digg_code_error2.gifchevashttps://www.blogger.com/profile/00198754653321696957noreply@blogger.comtag:blogger.com,1999:blog-15626356.post-1163833346692915582006-11-17T23:02:00.000-08:002006-11-17T23:02:00.000-08:00Typo: Second link has a 2 in it.http://www.copper...Typo: Second link has a 2 in it.<BR/><BR/>http://www.copperbarre.com/hot/digg_code_error2.gifchevashttps://www.blogger.com/profile/00198754653321696957noreply@blogger.comtag:blogger.com,1999:blog-15626356.post-1163833236060748342006-11-17T23:00:00.000-08:002006-11-17T23:00:00.000-08:00Thanks for your quick reply.Just use the code as i...Thanks for your quick reply.<BR/><BR/><I>Just use the code as is, ignoring my hack. The Blogger editor gives you a checkbox to check, stating that you do indeed want that script tag to go in your blog post; click it, and see if it won't just simply work beautifully.</I><BR/><BR/>Tried this already. Not a thing displayed.<BR/><BR/><I>My hack, should you go down that path, won't let you source external content, just post script statements inside the code block, i e the digg_url = "URL of story on digg"; part of your example, sans surrounding script tags. If you plan on using that in every post of your blog, I'd stick the latter script tag into the blog template somewhere after where the post gets included, and have just this bit in the blog entry itself.</I><BR/><BR/>I wasn't sure exactly where to split the code up, so the first part of it was in each post while the second part was in the template. Here's what displayed when I tried this:<BR/><BR/>http://www.copperbarre.com/hot/digg_code_error.gif<BR/><BR/><BR/>How I split the code up is shown here:<BR/><BR/>http://www.copperbarre.com/hot/digg_code_error.gif<BR/><BR/><BR/><I>If the Digg code employs the (somewhat deprecated, though unfortunately useful) document.write (I'm guessing it does), you actually can't use my hack, and have to go with the defaults. Wailing at Blogger's doorstep about not wanting the pains sometimes actually does help; they do read their suggestions / feedback input, and sometimes even have the time to act on it.</I><BR/><BR/>I fear this may be true.chevashttps://www.blogger.com/profile/00198754653321696957noreply@blogger.comtag:blogger.com,1999:blog-15626356.post-1163831937962344532006-11-17T22:38:00.000-08:002006-11-17T22:38:00.000-08:00Just use the code as is, ignoring my hack. The Blo...Just use the code as is, ignoring my hack. The Blogger editor gives you a checkbox to check, stating that you do indeed want that script tag to go in your blog post; click it, and see if it won't just simply work beautifully.<BR/><BR/>My hack, should you go down that path, won't let you source external content, just post script statements inside the code block, i e the <B>digg_url = "URL of story on digg";</B> part of your example, sans surrounding script tags. If you plan on using that in every post of your blog, I'd stick the latter script tag into the blog template somewhere after where the post gets included, and have just this bit in the blog entry itself.<BR/><BR/>First choice, not using my hack (as following web standards is better and more portable), but if it annoys the heck out of you with those mandatory double posting to get the checkbox every time, using the code tags instead, enclosing just the bit in bold where my post says "your code here".<BR/><BR/>If the Digg code employs the (somewhat deprecated, though unfortunately useful) document.write (I'm guessing it does), you actually <I>can't</I> use my hack, and have to go with the defaults. Wailing at Blogger's doorstep about not wanting the pains sometimes actually does help; they do read their suggestions / feedback input, and sometimes even have the time to act on it.Johan Sundströmhttps://www.blogger.com/profile/04076097346172610543noreply@blogger.comtag:blogger.com,1999:blog-15626356.post-1163827932370243042006-11-17T21:32:00.000-08:002006-11-17T21:32:00.000-08:00I'm really trying to understand the correct syntax...I'm really trying to understand the correct syntax to use. I don't know a lick of java except how to copy and paste the appropriate blocks of code surrounded by the script tags in my html header. <BR/><BR/>I want to be able to implement the digg story button (the one with the counter) into each blog post and so I remove the "display:none" style so that it does show, but I know I'm doing something completely wrong. The java I'm trying to run is:<BR/><BR/>"[script]<BR/>digg_url = "URL of story on digg";<BR/>[/script]<BR/>[script src="http://digg.com/api/diggthis.js"][/script]"<BR/><BR/>I of course us the appropriate carrot arrows instead of brackets.chevashttps://www.blogger.com/profile/00198754653321696957noreply@blogger.comtag:blogger.com,1999:blog-15626356.post-1142232551527100212006-03-12T22:49:00.000-08:002006-03-12T22:49:00.000-08:00Wow. These are some hard-core JavaScript include h...Wow. These are some hard-core JavaScript include hacks. Thanks for the ideas. I am thinking about creating a service where after adding one Javascript include to your blog template, you can attach other gadgets to each post. Sort of like having a configurable toolbar on every post. Have you seen anything like that?Adamhttps://www.blogger.com/profile/04362021649966087342noreply@blogger.comtag:blogger.com,1999:blog-15626356.post-1140508002219701632006-02-20T23:46:00.000-08:002006-02-20T23:46:00.000-08:00Indeed; thanks for mentioning! While the above des...Indeed; thanks for mentioning! While the above described method may be good for some things (especially if the Atom feed isn't filtered for sanity), there are cases, such as when needing to use document.write (yourself, or when a scripts written by someone else does), when post processing just isn't viable.Johan Sundströmhttps://www.blogger.com/profile/04076097346172610543noreply@blogger.comtag:blogger.com,1999:blog-15626356.post-1140504453232074562006-02-20T22:47:00.000-08:002006-02-20T22:47:00.000-08:00Those methods are cool and very slick.But you CAN ...Those methods are cool and very slick.<BR/><BR/>But you CAN put a script tag inside a blog post.<BR/><BR/>Two things when doing. If you have convert line breaks set to YES, then you have to put the script in without carriage returns or it will get all the br tags inserted on new lines and cause the script to break.<BR/><BR/>When publishing, it will initially give you an error saying "tag is not allowed". Check the box that says stop reporting errors for this post and publish again and it will go through and work. <BR/><BR/>Whether or not it's a good idea to do this I don't know. But I do it all the time.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-15626356.post-1139605209329408692006-02-10T13:00:00.000-08:002006-02-10T13:00:00.000-08:00If the code you write uses document.write(), it wi...If the code you write uses document.write(), it will not work with this work-around, as the code will not be run in the first pass when the document is being rendered, as would an inline script tag. To do that kind of thing, you would have to put the code in a script tag in your blog template instead.Johan Sundströmhttps://www.blogger.com/profile/04076097346172610543noreply@blogger.comtag:blogger.com,1999:blog-15626356.post-1139591080788551952006-02-10T09:04:00.000-08:002006-02-10T09:04:00.000-08:00I would like to have a weekly post that lists my f...I would like to have a weekly post that lists my favorite finds that I've tagged in delicious. delicious offers some javascript for doing that, but I am having trouble getting it to work in a blogger post. I tried your workaround, but to no avail. I am sure it has something to do with my ignorance of javascript, template modification, etc. I am feeling my way through the dark, letting you guys with more experience lead me. Any ideas on how I can do what I am hoping to do?Chris Spinkshttps://www.blogger.com/profile/09737073474163949048noreply@blogger.com