我从CSDN上下载了资源 <<JSocket javascriptSocket实现>>,然后放到本地上测试,调用jSocket_Init方法的时候报错,是没有找到SWF资源.是这段代码
function jSocket_Init(id){
var socket = jSocket_GetSocket(id);
var v = socket.variableTest;
// Wait until we can actually set Variables in flash
var f = function(){
var err = true;
try{
// Needs to be in the loop, early results might fail, when DOM hasn't updated yet
var m = socket.findSwf();
m.SetVariable(v, 't');
if('t' != m.GetVariable(v))
throw null;
m.SetVariable(v, '');
// Store the found movie for later use
socket.movie = m;
err=false;
}
catch(e){
window.setTimeout(f,0);
}
// Fire the event
if(!err&&socket.onReady)
socket.onReady();
}
window.setTimeout(f,0);
}
的socket.findSwf();方法没有找到对象。我下载资源的时候看大家的评论有人使用过并且没有问题。请用过的人给我说一下是怎么用的,好吗JSocketjSocket_Initflash
function jSocket_Init(id){
var socket = jSocket_GetSocket(id);
var v = socket.variableTest;
// Wait until we can actually set Variables in flash
var f = function(){
var err = true;
try{
// Needs to be in the loop, early results might fail, when DOM hasn't updated yet
var m = socket.findSwf();
m.SetVariable(v, 't');
if('t' != m.GetVariable(v))
throw null;
m.SetVariable(v, '');
// Store the found movie for later use
socket.movie = m;
err=false;
}
catch(e){
window.setTimeout(f,0);
}
// Fire the event
if(!err&&socket.onReady)
socket.onReady();
}
window.setTimeout(f,0);
}
的socket.findSwf();方法没有找到对象。我下载资源的时候看大家的评论有人使用过并且没有问题。请用过的人给我说一下是怎么用的,好吗JSocketjSocket_Initflash
解决方案 »
- prototype Ajax.Updater动态请求的页面的函数用不了
- 梅花雪树型js
- struts2控件问题(Radio)
- div中显示window.opener getElementById("Text")的返回值
- 请教javascript或者java自动生成序号的代码
- 急~~在线等。TreeView问题。
- 日期插件 Datepicker 的使用 ???
- 怎么实现在网页中点一个按钮,就可以在桌面建立快捷方式
- 请问有没有办法让一个页面打开时总是显示在最上面呢?
- 请问在IE中如何实现将F5的刷新屏蔽调。
- ·●○●关于OpenLayers的问题,不知道发到这里对不对,请高手指点
- Url.Content的问题。。在线等。。。。
jSocket.prototype.setup = function(target)
{
if(this.target!=undefined) throw 'Can only call setup on a jSocket Object once.';
this.target = target;
// Add the object to the dom
$(this.target).append("<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0\" width=\"1\" height=\"1\" id=\""+this.id+"\"><param name=\"movie\" value=\"jSocket.swf?"+this.id+"\"/><param name=\"allowScriptAccess\" value=\"always\"/><param name=\"quality\" value=\"high\"/><embed src=\"jSocket.swf?"+this.id+"\" quality=\"high\" width=\"1\" height=\"1\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\" name=\""+this.id+"\" swLiveConnect=\"true\"></embed></object>");
// document.getElementById(target).
}
这个资源
jscoket完整示例demo下载