2009-01-21

How to close window without prompt. JavaScript.

For most of browsers work code like this:


window.opener = top;
window.close();


But for IE7 will work this code:

<script language=javascript>
function CloseWindow()
{
window.open('','_self','');
window.close();
}
</script>

<input type=button name="closebutton" value="Close" class="Button" onclick="CloseWindow()"/>

Передача нескольких параметров JavaSript в XML

In ISV.Config I was needed a <Button> with JavaScript on it for open modal dialog with 2 or more parameters. In the dialog I'll calculate some sums for displayed opportunities.

So this is example:

<Button JavaScript="var url='http://localhost/CalcTotals.aspx';var paramStr = 'viewid=' + crmGrid.GetParameter('viewid'); if (crmGrid.GetParameter('filterDisplay') != null) paramStr += '&amp;' + 'filter=' + crmGrid.GetParameter('filterDisplay');if (crmGrid.GetParameter('quickfind') != null) paramStr += '&amp;' + 'quickfind=' + crmGrid.GetParameter('quickfind'); url= url + '?' + paramStr; showModalDialog(url , '','status:no;dialogWidth:610px;dialogHeight:210px;dialogHide:true;help:no;scroll:no');" AccessKey="в" WinMode="1" PassParams="1">;

The character "&" must be replaced with "&amp;".

An XML comment cannot contain '--', and '-' cannot be the last character.

The most possible reason of this error is in your web.config or in your custom XML file.
There is great likelihood that is in AppSettings section.