显示警报消息

时间:2013-12-12 09:34:25

标签: javascript jquery html visualforce

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>"`.

1 个答案:

答案 0 :(得分:0)

试试这个:

Visualforce页面:

<apex:pageMessages />

Apex Controller:

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