Latewire
We never sleep.
 
Register (free)
Grab Twitter Feed: Latewire / Coughlin
Username: Password: NVR4GET
«· Previous Article || Next Article ·»
Dynamically Loading Custom Google Search Engine

Daniel Roe
Poster: Daniel Roe @ Sat Sep 19, 2009 12:49 pm

Google has created a free search tool for websites that allows for in-line AJAX-backed searching. It's actually a really fast and cool bunch of scripts, but it's way too cumbersome to load with the page.

It took a couple hours to get all the bugs worked out and customize it for a black background, but I figured out and integrated a custom google search engine into the site here.

Obviously google makes this pretty easy. The hard part was customization to fit this particular website (where the results and the search box are separate) and having it dynamically load (It doesn't load until you click on the "search" field). Just having the 'CSE' load with the rest of the page can delay load-time by 2-7 seconds.

Though there was a straightforward coding example on google's site, it wasn't made for 'search', it was made for mapping or something.

Before you use this code, obviously you have to create a 'custom search ID' on this website. When using the javascript, replace your ID with mine.

Here's the code including CSS (it's messy and uncommented, but it's free so shut up):
images/fekken_random/google_search_field_code.txt

The loading graphic is here:
images/tinyloading.gif
example

(84,441)
Keywords: Google  Ajax  Search  Javascript  Cse  Custom Search Engine 
Comments: 0  •  Post Comment  •  Share Share Top
«· Previous Article || Next Article ·»

Not working? Try this.
Bio: Daniel Roe
User avatar
Site Admin


Location:
Cake City

Website:
http://www.facebook.com/latewire

Occupation:
Daniel is Medical Resident from the southwest US. Prior to medicine, he worked in IT as a consultant, programmer, web designer/developer, and technician.

Interests:
Health, music, economics, libertarianism, computers


Best Of Latewire
- 3rd Party Payer: How Gov't Made Healthcare Unaffordable
- Is Russia behind the global terrorist epidemic?
- Intern Hell
- S&P's Torrid Love Affair With The Government
- Green Subsidies Destroying Energy Market & Environment
- Why Economic Stimulus Doesn't Work (Latewire Original Video)
- The Season of Reason
- Happy Holidays from your pals at Latewire
- The Healthcare Disaster and Why Obamacare Will Make It Worse
- Video: Interest Rates, The Fed, and History Repeating
- Urban agriculture : Planning your vegetable garden part V
- Urban Agriculture : Planning your Vegetable Garden part IV
- Why The Government Wont Rescue The Dollar
- How the US Government Is Destroying the Dollar -Latewire Vid
- Governing Crazy: Broken Minds & Alcohol
- Urban Agriculture : planning your vegetable garden part III
- Urban Agriculture : Planning Your Vegetable Garden part II
- Urban agriculture for self-reliance : garden planning pt 1
- Why Bailouts Are Stupid (Illustrated Version)
- The Great Depression II, The Making of
- MySpace: A Place for The Damned. Part 1
- Happy Birthday, Latewire! I wrote you a song.
- The Worst Movie Ever!
- Best Long Island Iced Tea EVER
- Everyone loves a top 10 list.
- The Good Ol' Days
- I got your subject right here:
- Male members must represent, like you didn't know.
- Photo Radar: An Extravagant Way To Screw Ourselves
- The Inadequacy of Hope
- TV Companies WANT YOU... to Pirate
- The Gettin' Place
- 46 & ***
- The White Whale


Top 15 Keywords
- Alcohol (12)
- Apple (18)
- Bailouts (31)
- Bernanke (11)
- Economics (27)
- Food (22)
- Goth (13)
- History (12)
- Mac (12)
- Music (23)
- Obama (15)
- Poetry (19)
- Poison (11)
- Slavery (12)
- Snakes (29)

Links
- Latewire Latewear-Shirts&Stuff
- Snatchies Underthings
- Grief Brothers Band
Our Parked Domains:
- Latewire Video
- Poison-Free Diet
- Inflation Hell
- Policy Horn(DUPE)
- Policy Walk(DUPE)
- Policy Reader(DUPE)
- Faux Future(DUPE)
- Scarewire(DUPE)
- Urban Agriculture: The Road to Self-Reliance
- Urban Agriculture: The Road to Self-Reliance(DUPE)
- Urban Agriculture: The Road to Self-Reliance(DUPE)
- Urban Agriculture: The Road to Self-Reliance(DUPE)
- Interview With Dr. LSD
- Dr. LSD(DUPE)

cron
© 2008 Latewire.com