javascript中调用delphi函数
以下是test.htm页的内容
首先定义一个插件对象
<object id="Mapupload" name="Mapupload" width="0" height="0" classid="clsid:045FA9B9-B373-4D4C-AE76-128A19A4B6AE">
</object>
<script type="text/javascript">
//此函数打开activexform窗体并为activeform的属性赋值
function loadUploader(){
if(window.ActiveXObject){
try{
document.getElementById("Mapupload").picname='20060531'; //为对象赋值
document.getElementById("Mapupload").open(); //调用对象的open方法
}
catch(e){
}
}
else{
}
}
</script>
<TEXTAREA style="WIDTH: 400px; HEIGHT: 226px" name="" id='Content' rows=20 cols=40></TEXTAREA>
<button name="start" type="button" onclick="loadUploader();"></button>
<!-- script函数 -->
<script Language=Javascript>
function InsertHTML()
{
var UrlStr = document.getElementById("MapUpload").Content;
alert(UrlStr);
}
</script>
<!-- 定义Delphi中访问的OnCall事件对应的Script方法 -->
定义对象的OnInsertHTML事件为activeform的OninsertHTML事件,并触发页面的inserthtml方法
<SCRIPT FOR="Mapupload"
EVENT="OnInsertHTML()"
LANGUAGE="JScript">
<!-- insert script commands -->
InsertHTML();
</SCRIPT>
delphi中仅需在_TLB中声明OninsertHTML事件,Open方法,content属性即可
procedure TFeSendFrmX.open;
begin
hnd := self.handle;
FrmUpLoad := TFrmUpLoad.Create(self);
with FrmUpload do
begin
ShowModal;
 
相关文档:
像上面的一张图片我们该怎么用js 和css + div 很好的应用到我们的项目中呢?
<style>
.InpuRight{
height:20px;background:url(img/msg_bg.png) no-repeat;background-position:0px -250px;
}
.InputError{
width:20px;height:20px;background:url(img/msg_bg.png) no-repeat 0px 0px;
}
.inputLogin{
wid ......
原文地址:http://blog.zenw.org/index/view/id/8
就在刚才,使用GOOGLE查看明天的天气,看到了GOOGLE为纪念《吃豆超人》30周年而更新的《吃豆超人》JavaScript LOGO游戏。很有意思。而且还支持双打(原来的“手气不错”按钮被设置为了双打启动按钮“Insert Coin”)。来试试吧。
如下图
刚刚进入后 ......
不知道怎么回事,以前用setTimeout没出过问题,这次怎么用都错
代码:
window.onload=function(){
function x(){
alert("s");
}
setTimeout("x()",1000);
}
把window.onload=function(){}去掉就能用了,但是这样写惯了,而且去掉之后,像document.getElementById这样的方法会找不到对象, ......
String.prototype.changeQuery = function(name,value)
{
var reg = new RegExp("(^|)"+ name +"=([^&]*)(|$)");
var tmp = name + "=" + value;
if(this.match(reg) != null)
{
return this.replace(eval(reg),tmp);
}
else
{
if(this.match("[\?]"))
{
return this + ......