【问题标题】:Display Alert Messages显示警报消息
【发布时间】:2014-05-29 02:13:51
【问题描述】:
var msg = '<!-- Get Used Parts Code for Mobile Website Redirection -->' + "\n";
msg += '<script type="text/javascript" src="http://www.google.com/global?accountId={!Account.Id}"></script>' + "\n";
msg += '<!-- End of Get Used Parts Code for Mobile Website Redirection -->';
alert(msg);

此消息显示在警告框中。 如何在 Visualforce 页面中显示消息。

当前在

中得到错误信息
Error: The element type "apex:page" must be terminated by the matching end-tag `"</apex:page>"`.

【问题讨论】:

    标签: javascript jquery html visualforce


    【解决方案1】:

    试试这个:

    Visualforce 页面:

    <apex:pageMessages />
    

    Apex 控制器:

    ApexPages.Message alertMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'Error Message.');
    ApexPages.addMessage(alertMsg); 
    

    【讨论】:

    • 我已修改消息。你能看看这个吗?