我正在使用以下 JavaScript 函数:
<!-- Notifying message at the beginning of openning the website -->
<script language="javascript" type="text/javascript">
alert('Sorry!');
</script>
<!--End -->
Run Code Online (Sandbox Code Playgroud)
我想在警报消息中的“(抱歉!)”之后添加 URL,但我不知道如何将 URL 附加到 javascript 内的消息本身。
尝试 -
alert('Sorry!'+document.URL);
Run Code Online (Sandbox Code Playgroud)
演示 - http://jsfiddle.net/ipr101/Fg3eN/
| 归档时间: |
|
| 查看次数: |
27265 次 |
| 最近记录: |