Skip to main content

Javascript Code for Google Custom Search Engine

 Google Custom Search Engine (CSE) is a service that allows you to create a search engine for your website, using the power of Google's search technology. You can customize the look and feel of the search results, as well as specify which websites should be included or excluded from the search.

To use Google CSE on your website, you will need to create a CSE account and obtain a search engine ID. Once you have the search engine ID, you can use the following code to embed a search box on your website:

<!-- Replace YOUR_SEARCH_ENGINE_ID with your actual search engine ID --> <div id="cse-search-form">Loading</div> <script src="https://cse.google.com/cse.js?cx=YOUR_SEARCH_ENGINE_ID"></script> <script> var searchForm = document.getElementById('cse-search-form'); var searchBox = new google.search.SearchForm(searchForm); </script>


This will create a search box on your page that users can use to search the websites you have included in your CSE. The search results will be displayed in an iframe on your website.

You can also customize the appearance and behavior of the search results by using the Google CSE API. The API allows you to specify the layout and style of the search results, as well as programmatically interact with the search results and handle search events.

Here is an example of how you can use the Google CSE API to customize the search results:

<div id="cse-search-results"></div> <script> function onLoad() { var searchForm = new google.search.SearchForm(document.getElementById('cse-search-form')); var searchControl = new google.search.SearchControl(); searchControl.addSearcher(new google.search.WebSearch()); searchControl.addSearcher(new google.search.VideoSearch()); searchControl.draw(document.getElementById('cse-search-results')); } google.setOnLoadCallback(onLoad); </script>


This code will create a search box and search results on your page, and include both web and video search results in the search results. You can customize the layout and style of the search results by modifying the CSS of the search results element.

I hope this helps! Let me know if you have any questions.


Comments

Popular posts from this blog

Hanuman Chalisa Super Fast Mp3 Download 320kbps

  Hanuman Chalisa Super Fast Hanuman Chalisa हनुमान चालीसा Hanuman Chalisa (super Fast)song 320kbps Hanuman Chalisa Super Fast Hanuman Ashtak Bajrang Baan Hanuman Chalisa is a devotional hymn dedicated to Lord Hanuman. Here are the lyrics in both Hindi and English: Hindi: श्रीगुरु चरण सरोज रज निज मनु मुकुरु सुधारि। बरनउँ रघुबर बिमल जसु जो दायकु फल चारि।। बुद्धिहीन तनु जानिके सुमिरौं पवन-कुमार। बल बुद्धि बिद्या देहु मोहिं हरहु कलेस बिकार।। जय हनुमान ज्ञान गुण सागर। जय कपीश तिहुँ लोक उजागर।। राम दूत अतुलित बल धामा। अंजनि पुत्र पवन सुत नामा।। महाबीर बिक्रम बजरंगी। कुमति निवार सुमति के संगी।। कंचन वरण विराज सुबेसा। कानन कुंडल कुञ्चित केसा।। हाथ बज्र औ ध्वजा बिराजै। काँधे मूँज जनेऊ साजै।। शंकर सुवन केसरी नंदन। तेज प्रताप महा जग बंदन।। विद्यावान गुनी अति चातुर। राम काज करिबे को आतुर।। प्रभु चरित्र सुनिबे को रसिया। राम लखन सीता मन बसिया।। सूक्ष्म रूप धरि सियहिं दिखावा। बिकट रूप धरि लंक जरावा।। भीम रूप धरि असुर संहारे। रामचंद्र के काज सवारे।। लाय संजीवन लखन जियाए। श्री रघुबी

World's Top 10 expensive Actresses

  Here's some more information about the top 10 highest-paid actresses as of September 2022: Scarlett Johansson - With earnings of $40.5 million, Johansson is currently the highest-paid actress in the world. She earned the majority of her income from her role as Black Widow in the Marvel Cinematic Universe, as well as from her executive producer credit on the film. Angelina Jolie - Jolie earned $25 million largely due to her role in the upcoming Marvel film "The Eternals". She also received compensation for her work on the action-thriller "Those Who Wish Me Dead". Gal Gadot - Gadot earned $20 million mostly from her role in the Wonder Woman franchise, as well as endorsement deals with brands like Revlon. Melissa McCarthy - McCarthy earned $18 million from her roles in films like "Thunder Force" and "The Starling", as well as her work on the HBO Max series "Superintelligence". Meryl Streep - Streep earned $18 million from her ro

Why Was There A Gap In Your Employment?

 Why Was There A Gap In Your Employment? How To Explain Gaps In Employment (with Examples) Career How To Explain Employment Gaps In An Interview Indeed.com How To Answer 'why Is There A Gap In Your Employment?' Interview Skills Why Is There A Gap In Your Employment?