Here is the site I am currently working on: http://www.nbtc.org/nv/index.php
Thanks to previous help from the SO community, the buttons dynamically change the main 'content' div to whatever link the button is pointed to. They all work great except for the 'search' button at the top right.
We are using Google CSE and this is the code they gave me:
<div id="cse" style="width: 100%;">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.V2_DEFAULT});
google.setOnLoadCallback(function() {
var customSearchOptions = {}; var customSearchControl = new google.search.CustomSearchControl(
'005348393200361091503:k_xdk0rs2og', customSearchOptions);
customSearchControl.setResultSetSize(google.search.Search.FILTERED_CSE_RESULTSET);
customSearchControl.draw('cse');
}, true);
</script>
As you can see by the testing site, when you click on the button the text is loaded into the div but then nothing happens, it just says 'loading'. If you press the button again the entire website goes blank.
If you right click and open the link in a new tab it works just fine.
I figure there must be a simple solution, I have looked around but haven't found an answer for this situation. I am using jquery already to perform other functions and @nicodemus13 proposed a way to rewrite the google code in jquery as an answer to this question:
How to load Google's Custom-search-engine(CSE) JS APIs after page loads?
But the details are different for the code that google gave me and I don't know how to adapt it.
Thanks! Brenden