Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 08-09-2012, 11:15 PM   PM User | #1
unify
New Coder

 
Join Date: Jul 2011
Posts: 10
Thanks: 2
Thanked 0 Times in 0 Posts
unify is an unknown quantity at this point
Google CSE Help

So I have this search method, it simply uses google to search my website.
But i'd like to use my Google Custom Search Engine instead.

Here's my search engine unique id:
Search engine unique ID: 008729583548452524559:cxs7ncn4fyg

Here's my search engine code google gave me:
Code:
Paste this code in the page where you'd like the search box to appear
Code:
<!-- Put the following javascript before the closing </head> tag. -->
<script>
  (function() {
    var cx = '008729583548452524559:cxs7ncn4fyg';
    var gcse = document.createElement('script'); gcse.type = 'text/javascript'; gcse.async = true;
    gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') +
        '//www.google.com/cse/cse.js?cx=' + cx;
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(gcse, s);
  })();
</script>

<!-- Place this tag where you want the search box to render -->
<gcse:searchbox-only></gcse:searchbox-only>
Paste this code on http://, where you'd like the search results to appear.
Code:
<!-- Put the following javascript before the closing </head> tag. -->
<script>
  (function() {
    var cx = '008729583548452524559:cxs7ncn4fyg';
    var gcse = document.createElement('script'); gcse.type = 'text/javascript'; gcse.async = true;
    gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') +
        '//www.google.com/cse/cse.js?cx=' + cx;
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(gcse, s);
  })();
</script>

<!-- Place this tag where you want the search results to render -->
<gcse:searchresults-only></gcse:searchresults-only>
Can you guys help me implement it into the code below
VVVVV

Code:
<div class='menusearch'>
<div style='float:right;padding:12px 8px 0 0;'>
<form action='http://www.google.com/search' method='get' target='_blank'>
<input name='sitesearch' style='display:none;' value='http://www.pleasuresmine.net/'/>
<input id='search-box' name='q' onblur='if(this.value==&apos;&apos;)this.value=this.defaultValue;' onfocus='if(this.value==this.defaultValue)this.value=&apos;&apos;;' style='width:170px;border:none;padding:10px 10px; margin-right:5px; font:italic 12px Georgia;color:#b5b5b5; background:url(http://3.bp.blogspot.com/-q3Q6hWjYZU...earch_form.png) no-repeat;' type='text' value='Find your video...'/><input align='top' id='search-btn' src='http://2.bp.blogspot.com/-BmpnVNvHgs0/T94HNdsyt8I/AAAAAAAAG50/Jn2uw4OJOUk/s1600/search_btn.png' type='image' value='Search'/>
</form>
</div>
</div>
</div>

Here's my website if that helps:
pleasuresmine.net

If you try searching it searches a google CSE. I want it to search from my engine.
Thank you! Any help is apreciated.

Last edited by unify; 08-09-2012 at 11:33 PM..
unify is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:06 AM.


Advertisement
Log in to turn off these ads.