Google Custom Search code freezes up...

User 500247 Photo


Registered User
15 posts

For some reason the script for my google custom search engine freezes up the preview. I know this is the culprit because it works fine when I remove it.. Very frustrating when trying to preview something and it freezes up and can only be shut down by using the task manager.. Any suggestions?

Here is the code I am inserting..

<div id="cse" style="width: 735px;">Loading</div>
<script src="http://www.google.com/jsapi" type="text/javascript"></script>
<script type="text/javascript">
google.load('search', '1', {language : 'en', style : google.loader.themes.SHINY});
google.setOnLoadCallback(function() {
var customSearchControl = new google.search.CustomSearchControl('008352204384354069651:l25db1zp5zg');
customSearchControl.setResultSetSize(google.search.Search.LARGE_RESULTSET);
customSearchControl.draw('cse');
}, true);
</script>
<link rel="stylesheet" href="http://www.ruralinfo.net/cseshiny.css" type="text/css" />
User 500247 Photo


Registered User
15 posts

Sorry I forgot to add I am using Version 12 build 375... Just updated and still same issue..
User 187934 Photo


Senior Advisor
20,266 posts
Online Now

Did you try placing it after your style sheet code?
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 500247 Photo


Registered User
15 posts

Eric, yes, when I place the stylesheet code before the search box code it does not pick up my custom style and only loads the default search box and it still doesnt let me preview it.. Thanks
User 500247 Photo


Registered User
15 posts

And I have also tried all 3 available versions of IE for internal preview and none of them will let me preview a page with this code inserted..
User 187934 Photo


Senior Advisor
20,266 posts
Online Now

Mine works in the preview from the editor it just takes a while to load. The search script was the only thing on the page.:)
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 500247 Photo


Registered User
15 posts

Thanks Eric, when you say a while, like a very long while, lol. I have left it hanging for over 5 minutes and it just stayed frozen. Thanks for checking it out for me.
User 187934 Photo


Senior Advisor
20,266 posts
Online Now

For me about 40 seconds.:/
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 126492 Photo


Ambassador
1,525 posts

<link rel="stylesheet" href="http://www.ruralinfo.net/cseshiny.css" type="text/css" />


The above style sheet tag must be above your </head> tag on your page.

The way you have it means it is not loaded until after your search box is loaded.

I pasted your Google search code into a blank page and it loaded straight away.
Jim
---------------------------
User 500247 Photo


Registered User
15 posts

Thanks Jim, I tried putting the stylesheet code in my header and added the search code on a new page by itself. . It just said "loading" on the preview of the page and froze up.. And froze all of my other open pages on my computer..

Thanks for your help, I am not sure what it is, but it does not want to preview for me like it seems to for everyone else.. Very strange..

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.