Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Sep 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Adding Internal Site Search

    I'm trying to add an internal site search to my website, and it only work for some search items, not for everything. For example, if I search for Bud Light, Budweiser, Bud Light Lime, it finds them. But if I search for Stella Artois, Paulaner, or Hoegaarden, it doesn't find anything. I'm thinking there's something wrong with the javascript code, I'm just not sure how to fix it. I really appreciate any help with this!!!

    Here's the code in the head region:

    [<script type="text/javascript">

    // Google Internal Site Search script- By JavaScriptKit.com (http://www.javascriptkit.com)


    // For this and over 400+ free scripts, visit JavaScript Kit- http://www.javascriptkit.com/
    // This notice must stay intact for use
    //Enter domain of site to search.
    var domainroot="www.mhdbud.com"
    function Gsitesearch(curobj){
    curobj.q.value="www.mhdbud.com:"+domainroot+" "+curobj.qfront.value
    }

    </script>]

    Here's what I've got in the body:

    [<form action="http://www.google.com/search" method="get" onSubmit="Gsitesearch(this)">


    <input name="q" type="hidden" />
    <input name="qfront" type="text" style="width: 180px" /> <input type="submit" value="Search" />
    </form>

    You can try the site search to see what I'm talking about on this webpage:
    http://www.mhdbud.com/productsalt.html]

  • #2
    New Coder
    Join Date
    Mar 2009
    Posts
    74
    Thanks
    3
    Thanked 3 Times in 3 Posts
    I checked out your site and it looks like it could be an SEO issue. It's possible that they didn't index the whole page. You may want to add some SEO meta tags, etc., to make sure it's all indexed. Also, that script you found seems old. The format for searching a domain on google is like this:

    Paulaner site:mhdbud.com

    so the string it sends should be like this:

    curobj.q.value=curobj.qfront.value+' site:'+domainroot


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •