Created
May 19, 2011 22:00
-
-
Save dwheeler/981886 to your computer and use it in GitHub Desktop.
Simple php file to show google in an iframe in SugarCRM.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); | |
?> | |
<iframe id="scGoogleSearch" src="http://www.google.com" width="750" height="400"></iframe> | |
<script> | |
//Encapsulate the call to protect the global scope. | |
(function(){ | |
var name = document.getElementById("name") || document.getElementById("full_name"); | |
var frame = document.getElementById("scGoogleSearch"); | |
var url = "http://www.google.com/#"; | |
if (name != null) | |
{ | |
if (typeof(name.value) == "string") | |
{ | |
url += "q=" + name.value; | |
} | |
else | |
{ | |
url += "q=" + name.innerText; | |
} | |
} | |
frame.src=url; | |
})(); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment