重庆分公司,新征程启航
为企业提供网站建设、域名注册、服务器等服务
给你JS,这个是用在opera下的手写输入,按住ctrl+鼠标左键呼出
10年积累的网站制作、网站设计经验,可以快速应对客户对网站的新想法和需求。提供各种问题对应的解决方案。让选择我们的客户得到更好、更有力的网络服务。我虽然不认识你,你也不认识我。但先做网站设计后付款的网站建设流程,更有南芬免费网站建设让你可以放心的选择与我们合作。
——————————————————————————————
// ==UserScript==
// ==/UserScript==
SWFObject = function($) {
this.cfg = $;
this.swfId = $.fid;
this.asObjects = {};
this.onLoadInit = null;
SWFObject.instances[this.swfId] = this
};
SWFObject.prototype.load = function() {
Utils.f(this.cfg)
};
SWFObject.prototype.getASObject = function($) {
return this.asObjects[$.asoId]
};
SWFObject.prototype.registerASObject = function(A) {
var _ = A.asoId,
$ = this.swfId;
return this.asObjects[_] = new ASObject({
asoId: _,
swfId: $
})
};
SWFObject.prototype.getASObjectProperty = function($) {
if (this.swf == null) this.swf = Utils.g(this.swfId);
return this.swf.getASObjectProperty($)
};
SWFObject.prototype.setASObjectProperty = function($) {
if (this.swf == null) this.swf = Utils.g(this.swfId);
this.swf.setASObjectProperty($)
};
SWFObject.prototype.callASObjectMethod = function($) {
if (this.swf == null) this.swf = Utils.g(this.swfId);
return this.swf.callASObjectMethod($)
};
SWFObject.instances = {};
SWFObject.getSWFObject = function($) {
return SWFObject.instances[$.swfId]
};
SWFObject.dispatchASObjectEvent = function(B) {
var _ = B.swfId,
A = B.asoId,
F = B.type,
E = B.data,
C = SWFObject.getSWFObject({
swfId: _
}),
$ = (A == undefined) ? C: C.getASObject({
asoId: A
}),
D = "on" + F.substr(0, 1).toUpperCase() + F.substr(1);
if ($[D] != null) $[D](E)
};
SWFObject.registerASObject = function(A) {
var $ = A.swfId,
_ = A.asoId,
B = SWFObject.getSWFObject(A);
B.registerASObject(A)
};
ASObject = function($) {
this.swfId = $.swfId;
this.asoId = $.asoId;
this.swfObject = SWFObject.getSWFObject($);
if (ASObject.instances[this.swfId] == null) ASObject.instances[this.swfId] = {};
ASObject.instances[this.swfId][this.asoId] = this
};
ASObject.prototype.get = function($) {
return this.swfObject.getASObjectProperty({
asoId: this.asoId,
property: $
})
};
ASObject.prototype.set = function(_, $) {
this.swfObject.setASObjectProperty({
asoId: this.asoId,
property: _,
value: $
})
};
ASObject.prototype.call = function($, _) {
return this.swfObject.callASObjectMethod({
asoId: this.asoId,
method: $,
parameters: _
})
};
ASObject.instances = {};
Utils = {
g: function($) {
return document.getElementById($)
},
f: function(_) {
var $ = 'embed id="#{fid}" name="#{fid}" src="#{movie}" flashVars="#{flashVars}" width="#{width}" height="#{height}" align="#{align}" type="application/x-shockwave-flash" pluginspage="" wmode="#{wmode}" scale="#{scale}" salign="#{salign}" allownetworking="#{allownetworking}" allowscriptaccess="#{allowscriptaccess}" /',
A = 'object id="#{fid}" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="#{width}" height="#{height}" align="#{align}"param name="movie" value="#{movie}" /param name="flashVars" value="#{flashVars}" /param name="wmode" value="#{wmode}" /param name="scale" value="#{scale}" /param name="salign" value="#{salign}" /param name="allownetworking" value="#{allownetworking}" /param name="allowscriptaccess" value="#{allowscriptaccess}" //object';
this.g(_.cid).innerHTML = this.fm(this.b.isIE ? A: $, _)
},
fm: function($, _) {
if (arguments.length) if (typeof(_) == "object") $ = $.replace(/#\{([^\{\}]+)\}/g,
function(A, B) {
var $ = _[B];
if (typeof $ == "function") $ = $(B);
return typeof($) == "undefined" ? "": $
});
else if (typeof(_) != "undefined") for (var A = arguments.length - 2; A -1; A--) $ = $.replace(new RegExp("#\\{" + A + "\\}", "g"), arguments[A + 1]);
return $
},
b: {
isIE: /msie/i.test(navigator.userAgent),
isFF: /firefox/i.test(navigator.userAgent),
isMaxthon: (function() {
var $ = false;
try {
$ = external.max_version
} catch(_) {}
return $
})()
},
mo: function() {
var $ = {},
B = arguments.length;
for (var C = 0; C B; C++) {
var A = arguments[C];
for (var _ in A) {
if ($[_] != null) continue;
$[_] = arguments[C][_]
}
}
return $
}
};
HWR = {
loaded: false
};
HWR.load = function(E, C, D) {
HWR.tid = C;
var $ = D ? ("serviceUrl=" + D) : "",
B = {
cid: E,
fid: E + "_flash",
width: 410,
height: 290,
movie: "",
align: "middle",
salign: "lt",
wmode: "window",
scale: "noscale",
allowscriptaccess: "always",
allownetworking: "all",
flashVars: $
},
A = new SWFObject(B);
HWR.so = A;
var _;
A.onLoadInit = function($) {
HWR.ao = _ = A.asObjects.handWrite;
_.onCloseClick = function($) {
HWR._onCloseClick()
};
_.onCharSelect = function($) {
HWR._onCharSelect($["char"])
}
};
A.load()
};
HWR._onCharSelect = function(A) {
var $ = HWR.tid;
var G = $.selectionStart;
var H = $.selectionEnd;
$.value = $.value.substring(0,G) + A + $.value.substring(H,$.value.length);
$.selectionStart = G + A.length;
$.selectionEnd = G + A.length;
};
HWR._onCloseClick = function() {
if (HWR.onCloseClick) HWR.onCloseClick()
};
HWR.onCloseClick = null;
HWR.clear = function() {
HWR.ao.call("clear", [])
};
function getFlashVersion() {
var B = navigator;
if (B.plugins B.mimeTypes.length) {
var A = B.plugins["Shockwave Flash"];
if (A A.description) return A.description.replace(/([a-zA-Z]|\s)+/, "").replace(/(\s)+r/, ".") + ".0"
} else if (window.ActiveXObject !window.opera) for (var C = 10; C = 2; C--) {
try {
var _ = new ActiveXObject("ShockwaveFlash.ShockwaveFlash." + C);
if (_) {
return C + ".0.0";
break
}
} catch($) {}
}
return "0"
}
function addStyle(A, $) {
var _ = document.styleSheets[0];
if (_.addRule) _.addRule(A, $);
else if (_.insertRule) _.insertRule(A + " { " + $ + " }", _.cssRules.length)
}
function penControl() {
var $ = parseInt(getFlashVersion());
if ($ 9) addStyle("#penControl", "display:none")
}
function stopClosePen($) {
$ = $ || window.event;
if ($.stopPropagation) $.stopPropagation();
else $.cancelBubble = true
}
var enablePen = false;
function openPen($) {
if (!enablePen) {
var A = document.getElementById(HWR.so.cfg.cid);
A.className = "hwr_visible_ujs";
enablePen = true
}
$ = $ || event;
var _ = $.target || $.srcElement;
_.blur();
stopClosePen($)
}
HWR.onCloseClick = function() {
HWR.clear();
var _ = document.getElementById(HWR.so.cfg.cid);
_.className = "hwr_hidden_ujs";
enablePen = false
};
function closePen($) {
var B = document.getElementById(HWR.so.cfg.cid);
$ = $ || event;
var A = $.target || $.srcElement;
if (enablePen) {
HWR.clear();
B.className = "hwr_hidden_ujs";
enablePen = false
}
}
function findPos(obj) {
var curleft = curtop = 0;
do {
curleft += obj.offsetLeft;
curtop += obj.offsetTop;
} while (obj = obj.offsetParent);
return [curleft, curtop];
}
function scrollDist() {
var html = document.getElementsByTagName('html')[0];
if (html.scrollTop document.documentElement.scrollTop) {
return [html.scrollLeft, html.scrollTop];
} else if (html.scrollTop || document.documentElement.scrollTop) {
return [html.scrollLeft + document.documentElement.scrollLeft, html.scrollTop + document.documentElement.scrollTop];
} else if (document.body.scrollTop)
return [document.body.scrollLeft, document.body.scrollTop];
return [0, 0];
}
function innerDimensions() {
if (self.innerHeight) {
return [self.innerWidth, self.innerHeight];
} else if (document.documentElement document.documentElement.clientHeight) {
return [document.documentElement.clientWidth, document.documentElement.clientHeight];
} else if (document.body)
return [document.body.clientWidth, document.body.clientHeight];
return [0, 0];
}
document.addEventListener('DOMContentLoaded',
function() {
hwrcss = '#hwr_div_ujs{position:absolute;}.hwr_hidden_ujs{display:none;}.hwr_visible_ujs{display:block;}';
var hwrstyle = document.createElement('style');
hwrstyle.setAttribute('type', 'text/css');
hwrstyle.textContent = hwrcss;
document.getElementsByTagName('head')[0].appendChild(hwrstyle);
hwrdiv = document.createElement('div');
hwrdiv.id = "hwr_div_ujs";
hwrdiv.className = "hwr_hidden_ujs";
document.body.appendChild(hwrdiv);
},
false);
document.documentElement.addEventListener('click',
function(e) {
if (e.ctrlKey !e.shiftKey !e.altKey) {
if (e.target.nodeName == "TEXTAREA" || e.target.type == "text" || e.target.type == "password") {
var tPos = findPos(e.target), wDim = innerDimensions(), sDis = scrollDist();
if (tPos[1] + 293 + e.target.offsetHeight - sDis[1] - wDim[1] 0) {
hwr_div_ujs.style.top = tPos[1] - 293 + "px";
} else {
hwr_div_ujs.style.top = tPos[1] + e.target.offsetHeight + 3 + "px";
}
hwr_div_ujs.style.left = Math.max(0, Math.min(tPos[0], wDim[0] - 430)) + "px";
hwr_div_ujs.className = "hwr_visible_ujs";
penControl();
HWR.load("hwr_div_ujs", e.target, "");
}
} else {
hwr_div_ujs.className = "hwr_hidden_ujs";
}
},
false);
TMD!
浏览器输入:
打开网页后右键选择浏览源代码
把源代码拷出来 新建一个index.html的文件 用记事本打开,源码复制进去 保存关闭
你想功能多一点的
页面更丰富 这样岂不是更好
document.getElementsById("文本框id").onblur=方法名如:=doit;//方法名不要加();把这个写到onload事件中,
function doit()
{
}
1.官方提供了一个designer软件,可以直接托控件设计界面,直接生成js代码,但是这个是必须购买授权的,299美元-5395美元的license
2.可以换用ext-gwt,开发完全java化,js文件有gwt动态生成,会减轻很多负担
究竟使用哪种的话,还是要看你自己抉择,相关名词可以百度一下,有问题可以hi我
JS文件用什么编辑器都是可以写的,不要说
dreamweaver了,就是记事本都可以,高手不会总是用什么工具的,都是手写代码。
你的问题不幼稚,并且非常经典。
VISUAL STUDIO能拿到世界级的编译器大奖,不是徒有虚名的。
为什么一直削弱多JavaScript支持呢?
因为,微软强调的是生产力,推荐你使用服务端控件自动生成JavaScript,
以达到尽可能符合各种浏览器的标准,而你自己手写脚本或者样式,
一来生产力很低,而来,你不敢保证代码的严谨。
-----------
SO,不光Visual Studio一直不太提倡手写JavaScript,
连IE浏览器以及以后的版本,也尽可能的削弱JavaScript的支持。
取而代之的,是使用DX来渲染页面。