2. Juni 2010 10:38
<script src="http://maps.google.com/maps?file=api&v=2&key=GOOGLE_API_KEY" type="text/javascript"></script>
var url = "http://maps.google.com/maps?file=api&v=2&key=GOOGLE_API_KEY";
var scriptElement = document.createElement("<script src'" + url + "' language='text/javascript'>");
document.getElementsByTagName("head")[0].insertAdjacentElement("beforeEnd",scriptElement);
<script language="text/javascript" maps?file="api&v=2&key=GOOGLE_API_KEY'" maps.google.com="" src?http:=""></script>
4. Juni 2010 13:45
var head = document.getElementsByTagName('head')[0];
var url = "http://maps.google.com/maps?file=api&v=2&key=GOOGLE_API_KEY";
var script = document.createElement('script');
script.type= 'text/javascript';
script.src= url;
head.appendChild(script);
10. Juni 2010 10:54
10. Juni 2010 13:29
Genau so ist es.Ich befürchte, dass die Zeile erste eingebunden wird, wenn die Form schon geladen ist.
11. Juni 2010 08:55
11. Juni 2010 10:43
var head = document.getElementsByTagName('head')[0];
var url = "http://maps.google.com/maps?file=api&v=2&key=GOOGLE_API_KEY";
var script = document.createElement('script');
script.type= 'text/javascript';
script.src= url;
script.onreadystatechange= function () {
if (this.readyState == 'complete' || this.readyState == 'loaded')
{
document.OnLoadCode()
}
}
head.appendChild(script);
11. Juni 2010 10:51
11. Juni 2010 11:16
11. Juni 2010 13:44
11. Juni 2010 14:08
michael sulz hat geschrieben:Hallo,
gehe einmal zu diesem [lurl=viewtopic.php?f=56&t=9625]Beitrag[/eurl]. Im zweiten Teil zeige ich, wie du einer CRM-Seite Code hinzufügen kannst, der direkt beim Laden ausgeführt wird. Das sollte eigentlich genau das sein, was du benötigst.
11. Juni 2010 18:22
14. Juni 2010 10:26
<%@ Page Language="C#" %>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
<script language="javascript">
attachEvent( "onload" , OnPageLoad );
//IFrame ID
var contsGrid;
//IFrame document object
var iframeDoc;
//Views picklist
var SavedQuerySelector;
//The grid object
var crmGrid;
function OnPageLoad()
{
contsGrid = document.all.contsGrid;
var contsUrl = "http://srv04:5555" + "/_root/homepage.aspx?etc=10003";
contsGrid.src = contsUrl;
contsGrid.onreadystatechange = OnGridViewReady;
}
function OnGridViewReady()
{
if( contsGrid.readyState != "complete" )
return;
iframeDoc = contsGrid.contentWindow.document;
//make sure the selector exists
SavedQuerySelector = iframeDoc.all.SavedQuerySelector;
if( SavedQuerySelector )
iframeDoc.all.SavedQuerySelector.attachEvent( "onchange" , OnGridReadyChangeLayout );
//make sure the grid exists
crmGrid = iframeDoc.all.crmGrid;
if( crmGrid )
{
iframeDoc.all.crmGrid.attachEvent( "onrefresh" , OnGridReadyChangeLayout );
//change the layout for the first time
OnGridReadyChangeLayout();
}
}
function OnGridReadyChangeLayout()
{
if( !crmGrid.InnerGrid )
return setTimeout( OnGridReadyChangeLayout , 100 );
/* Hier die Funktionen für die Seite einbauen */
// Aktivieren und deaktivieren ausblenden
var mnuDeactivate = document.all.contsGrid.contentWindow.document.all._MIdoActioncrmGrid10003deactivate;
if (mnuDeactivate)
mnuDeactivate.style.display = "none";
var mnuActivate = document.all.contsGrid.contentWindow.document.all._MIdoActioncrmGrid10003activate;
if (mnuActivate)
mnuActivate.style.display = "none";
}
</script>
</head>
<body scroll="no" style="margin:0px">
<iframe id="contsGrid"
src="about:blank"
style="width:100%;height:100%"
frameborder="0"
scrolling="no">
</iframe>
</body>
</html>