SorrybutAVG

  • Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg

Thursday, June 25, 2009

Displaying my web development idiocy

Posted on 9:23 AM by Unknown
I was messing around with creating a Widget here, and I wanted to take a remote web page, extract some info from it, and display it. I am just familiar enough with the concept of DOM, and recently educated myself enough on Javascript, that I am confident I could do it in about five minutes if I could just get the DOM of the remote web page loaded into a Document object.

But damned if I can't figure out how to do that...

First I tried putting it in an invisible iframe, but the problem is that the iframe might not be (actually, won't be) loaded when you go to start traversing its DOM tree. Then I thought maybe I could have an onLoad event for the iframe document, and go back and fix the HTML then... but it turns out that doesn't work, and a lot of people make that mistake. You have to put the onLoad handler in the frame itself, and... I can't do that, because I don't have control over the remote web page.

So then I started looking into Ajax, which I am pretty sure is the right thing, but I couldn't for the life of me get it to work. I don't really understand how to debug web stuff, so I am stuck. Gah!

On the plus side, I think I learned enough about DOM that I should be able to create a spiffy Javascript thingy to replace the horrible workaround I did to make those "Continue reading..." links appear at the bottom of the appropriate posts. Right now, I put a special label called "more" on each post where I want it (blech!) and then I hacked all the label-referencing code to omit that label. This has numerous disadvantages though.

However, with JS I should be able to get the div that includes the post, then search to see whether it contains the special div tag to hide the text below the fold. Shouldn't be too hard...

Update: Woo hoo, after much fumbling it worked! It probably would have taken me no time at all if I hadn't got confused and started searching for a div tag when I was actually looking for a span tag. D'oh!

Getting rid of that stupid "more" hack also fixed a problem I was having with my tag cloud. Ah, much better... now only if I could figure out AJAX...
Email ThisBlogThis!Share to XShare to Facebook
Posted in programming | No comments
Newer Post Older Post Home

0 comments:

Post a Comment

Subscribe to: Post Comments (Atom)

Popular Posts

  • I win an argument with Dan Cooper!
    I won't bore anyone with the details, but I just totally whupped Dan Cooper (yes, that Dan Cooper) in an argument on Google+ . After I...
  • God takes sides in Survivor: Samoa
    My wife and I were watching Survivor: Samoa last night (yes, I kind of like that show) and a reward challenge involved a hilarious scene wh...
  • Ten New Ways to Piss Off God
    Found a new one today. Leviticus 21:18-20, while not explicitly condemning anyone, bars the following individuals from "approaching th...
  • I feel bad for George Zimmerman, I really do
    The latest news has George Zimmerman completely flipping out and ditching his lawyers, putting together a poorly-designed website 1 , and t...
  • About that Time cover...
    So yeah, everybody's seen it , right? A lot of my Facebook friends are nursing moms, a lot of them are AP moms, a few of them are even ...
  • The disastrous ethical consequences of the Atonement meme
    It has been pointed out by Hitchens and others that the idea of Jesus suffering and dying for our sins is not just repulsive because it...
  • Before, During, and After
    I don't usually blog much about home improvement , but I figured I ought to do a follow-up post to the one about venturing into the craw...
  • The Archdiocese of Washington and Pat Condell
    Earlier today I watched the newest Pat Condell rant by following the link at richarddawkins.net . Then later, I happened to stumble on thi...
  • I guess the Birthers were right all along
    Ah hah, here is the proof that Obama is not an American citizen after all! On a side note, take a gander at the ad for Carnation infant for...
  • Faith is Nihilism
    Bryan Fischer says that not exploiting fossil fuels to the absolute maximum is like rejecting a birthday present from Jesus, and that if we...

Categories

  • abortion
  • accomodationism
  • alternative medicine
  • apatheism
  • atheism
  • birther hilarity
  • bus ads
  • censorship
  • christian apologetics
  • christianity
  • civility
  • colbert
  • cooking
  • creationism
  • death
  • drinking
  • dualism
  • environment
  • evolution
  • facial hair
  • faith
  • feminism
  • file sharing
  • health care
  • hinduism
  • history
  • home improvement
  • intelligent design
  • islam
  • judaism
  • lgbt
  • local farming
  • lolcatz
  • math
  • misogyny
  • morality
  • mormonism
  • music
  • occupy
  • parenthood
  • peer review
  • philosophy
  • physics
  • politics
  • programming
  • racism
  • sikhism
  • skepticism
  • sustainable farming
  • trolls
  • vaccines
  • vegetarianism
  • video games
  • war on christmas

Blog Archive

  • ►  2013 (2)
    • ►  April (1)
    • ►  February (1)
  • ►  2012 (55)
    • ►  December (1)
    • ►  November (3)
    • ►  October (1)
    • ►  September (1)
    • ►  August (3)
    • ►  July (2)
    • ►  June (8)
    • ►  May (9)
    • ►  April (7)
    • ►  March (10)
    • ►  February (4)
    • ►  January (6)
  • ►  2011 (72)
    • ►  December (4)
    • ►  November (7)
    • ►  October (2)
    • ►  September (4)
    • ►  August (4)
    • ►  July (4)
    • ►  June (1)
    • ►  May (3)
    • ►  April (6)
    • ►  March (17)
    • ►  February (10)
    • ►  January (10)
  • ►  2010 (106)
    • ►  December (7)
    • ►  November (4)
    • ►  October (10)
    • ►  September (11)
    • ►  August (15)
    • ►  July (7)
    • ►  June (10)
    • ►  May (5)
    • ►  April (14)
    • ►  March (10)
    • ►  February (5)
    • ►  January (8)
  • ▼  2009 (171)
    • ►  December (10)
    • ►  November (5)
    • ►  October (19)
    • ►  September (26)
    • ►  August (38)
    • ►  July (52)
    • ▼  June (21)
      • Join Us
      • Relativism, Absolutism, Religion, and Alternative ...
      • At least they spelled "God" correctly...
      • More thoughts on gun control
      • Get Your Gunn
      • "Atheist" vs. "Nontheist"
      • Family Entertainment, Sharia style
      • Displaying my web development idiocy
      • ¡Viva la México!
      • That guy's horrible mustache
      • Getting certified to be a military chaplain
      • The atheism, cooking, and home improvement blog?
      • What happened to the cooking?
      • RIAA channels Dr. Evil
      • Expelled parody
      • Abolitionist Clergymen?
      • Beer can duck?
      • The Vaccine Meeting
      • Christian group actually sues for right to burn a ...
      • Into the Lion's Den...
      • The idea of this blog, and some random chicken recipe
Powered by Blogger.

About Me

Unknown
View my complete profile