使用javascript块更新div并导致重新执行此javascript块? [英] Updating a div with a block of javascript and causing reexecution of this javascript block?

查看:53
本文介绍了使用javascript块更新div并导致重新执行此javascript块?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我使用AC_Quicktime库得到以下情况。

Apple建议使用Javascript调用来生成OBJECT标签

http://developer.apple.com/internet /ieembedprep.html)


我正在存储表示div的innerHTML的字符串条目,我将在运行时更新
。 />
因此,其中一些字符串条目实际上像以下一样:

< script language =" JavaScript" type =" text / javascript">

QT_WriteOBJECT_XHTML(''sample.mov'','''320'',''256'','''',

''autoplay'',''true'',

''emb #bgcolor'',''black'',

''align'' ,''中'');

< / script>

而不是那样:

< object classid =" clsid :02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"

width =" 320" height =" 256"


codebase =" http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0"

align =" middle" >

< param name =" src"值= QUOT; sample.mov" />

< param name =" autoplay"值= QUOT;真" />

< embed src =" sample.mov"宽度= QUOT; 320" height =" 256"

pluginspage = http://www.apple.com/quicktime/download/

align =" middle"自动播放= QUOT;真" BGCOLOR = QUOT;黑色" < / embed>

< / object>

现在我的问题是,当我通过Javascript更新tmy div时,我会更换

div.innerHTML由我检索的字符串条目。

因为在某些情况下这些条目是Javascript块,我想要

它们执行但是它们只是替换innerHTML时不是。

显然,因为这些是动态条目,我无法从我的javascript函数执行

QT_Javascript方法调用。


有没有办法强制重新执行这个javascript块?


谢谢


Michael


任何想法?

解决方案

只需动态创建''包装''div,并替换这个包装器,

与当前的一个,然后将javascript的输出写入

新的包装器div应该可以完成这项工作。这实际上创造了一个''重置''。


我们一直在用媒体和2d / 3d视图做一些动态的东西和

这是相同的结构我们使用。


-CJ


< ma ***** @ gmail.comwrote in message

新闻:11 ********************** @ k70g2000cwa.googlegr oups.com ...





我使用AC_Quicktime库得到以下情况。

Apple建议使用Javascript调用生成OBJECT标签

http://developer.apple.com/internet/ ieembedprep.html)


我正在存储表示div的innerHTML的字符串条目,我将在运行时更新它们。

结果,其中一些字符串条目实际上像以下一样:

< script language =" JavaScript" type =" text / javascript">

QT_WriteOBJECT_XHTML(''sample.mov'','''320'',''256'','''',

''autoplay'',''true'',

''emb #bgcolor'',''black'',

''align'' ,''中'');

< / script>

而不是那样:

< object classid =" clsid :02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"

width =" 320" height =" 256"


codebase =" http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0"

align =" middle" >

< param name =" src"值= QUOT; sample.mov" />

< param name =" autoplay"值= QUOT;真" />

< embed src =" sample.mov"宽度= QUOT; 320" height =" 256"

pluginspage = http://www.apple.com/quicktime/download/

align =" middle"自动播放= QUOT;真" BGCOLOR = QUOT;黑色" < / embed>

< / object>

现在我的问题是,当我通过Javascript更新tmy div时,我会更换

div.innerHTML由我检索的字符串条目。

因为在某些情况下这些条目是Javascript块,我想要

它们执行但是它们只是替换innerHTML时不是。

显然,因为这些是动态条目,我无法从我的javascript函数执行

QT_Javascript方法调用。


有没有办法强制重新执行这个javascript块?


谢谢


Michael


有什么想法吗?




ma ***** @ gmail.com 写道:


我使用AC_Quicktime库得到以下情况。

Apple建议使用Javascript调用生成OBJECT标签


fn EOLAS问题我猜...



< http://groups.google.com/group/comp .lang.javascript / msg / dedadd8801c863d7>


也可以在这个特定的问题中随意使用document.write和任何你需要的其他durty编码。


ma ***** @ gmail.com 在2006年11月2日4:17发表以下内容:





我得到以下情况使用AC_Quicktime库。

Apple建议使用Javascript调用生成OBJECT标签

http://developer.apple.com/internet/ieembedprep.html)



是的,它是相同的解决方案由MS提供的

EOLAS诉讼。


< snip>


现在我的问题是当我通过Javascript更新tmy div时,我用我检索到的字符串条目替换了div.innerHTML

因为在某些情况下这些条目是Javascript块,我想要它们执行但是它们不是在替换innerHTML时它们。

显然,因为这些是动态条目,我无法执行

QT_来自我的javascript函数的Javascript方法调用。



创建一个新的脚本块并动态创建脚本元素。

在档案中搜索createJSFile()的函数名称和你可以

找到许多解释它的线程。


-

兰迪

机会喜欢准备好的心灵

comp.lang.javascript常见问题 - http:// jibbering .com / faq

Javascript最佳实践 - http ://www.JavascriptToolbox.com/bestpractices/


Hi,

I got the following situation using the AC_Quicktime library.
Apple recommend to use a Javascript call to generate the OBJECT tag
(http://developer.apple.com/internet/ieembedprep.html).

I am storing String entries representing the innerHTML of a div that I
will update at runtime.
As a result, some of these string entries are actually loooking like:
<script language="JavaScript" type="text/javascript">
QT_WriteOBJECT_XHTML(''sample.mov'', ''320'', ''256'', '''',
''autoplay'', ''true'',
''emb#bgcolor'', ''black'',
''align'', ''middle'');
</script>
and not like that:
<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"
width="320" height="256"

codebase="http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0"
align="middle" >
<param name="src" value="sample.mov" />
<param name="autoplay" value="true" />
<embed src="sample.mov" width="320" height="256"
pluginspage=http://www.apple.com/quicktime/download/
align="middle" autoplay="true" bgcolor="black" </embed>
</object>

Now my problem is that when I update tmy div via Javascript, I replace
the div.innerHTML by the string entry that I have retrieved.
Since in some cases these entries are Javascript blocks, I would want
them to execute but they are not when just replacing the innerHTML.
Obviously, because these are dynamic entries, I could not execute the
QT_ Javascript method call from my javascript function.

Is there any way to force reexecution of this block of javascript?

Thanks

Michael

Any idea?

解决方案

Simply dynamically creating a ''wrapper'' div, and replacing this wrapper,
with the current one and then writing the output of the javascript into the
new wrapper div should do the job. This essentially creates a ''reset''.

We had been doing some dynamically stuff with media and 2d/3d viewings and
this is the same structure we use.

-CJ

<ma*****@gmail.comwrote in message
news:11**********************@k70g2000cwa.googlegr oups.com...

Hi,

I got the following situation using the AC_Quicktime library.
Apple recommend to use a Javascript call to generate the OBJECT tag
(http://developer.apple.com/internet/ieembedprep.html).

I am storing String entries representing the innerHTML of a div that I
will update at runtime.
As a result, some of these string entries are actually loooking like:
<script language="JavaScript" type="text/javascript">
QT_WriteOBJECT_XHTML(''sample.mov'', ''320'', ''256'', '''',
''autoplay'', ''true'',
''emb#bgcolor'', ''black'',
''align'', ''middle'');
</script>
and not like that:
<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"
width="320" height="256"

codebase="http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0"
align="middle" >
<param name="src" value="sample.mov" />
<param name="autoplay" value="true" />
<embed src="sample.mov" width="320" height="256"
pluginspage=http://www.apple.com/quicktime/download/
align="middle" autoplay="true" bgcolor="black" </embed>
</object>

Now my problem is that when I update tmy div via Javascript, I replace
the div.innerHTML by the string entry that I have retrieved.
Since in some cases these entries are Javascript blocks, I would want
them to execute but they are not when just replacing the innerHTML.
Obviously, because these are dynamic entries, I could not execute the
QT_ Javascript method call from my javascript function.

Is there any way to force reexecution of this block of javascript?

Thanks

Michael

Any idea?




ma*****@gmail.com wrote:

I got the following situation using the AC_Quicktime library.
Apple recommend to use a Javascript call to generate the OBJECT tag

fn EOLAS issue I guess...
see
<http://groups.google.com/group/comp.lang.javascript/msg/dedadd8801c863d7>

also in this particular issue feel free to use document.write and any
other durty coding you want.


ma*****@gmail.com said the following on 11/2/2006 4:17 PM:

Hi,

I got the following situation using the AC_Quicktime library.
Apple recommend to use a Javascript call to generate the OBJECT tag
(http://developer.apple.com/internet/ieembedprep.html).

Yes, and it is the same "solution" provided by MS as a result of the
EOLAS suit.

<snip>

Now my problem is that when I update tmy div via Javascript, I replace
the div.innerHTML by the string entry that I have retrieved.
Since in some cases these entries are Javascript blocks, I would want
them to execute but they are not when just replacing the innerHTML.
Obviously, because these are dynamic entries, I could not execute the
QT_ Javascript method call from my javascript function.

Create a new script block and create the script element on the fly.
Search the archives for a function name of createJSFile() and you can
find many threads where it is explained.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/


这篇关于使用javascript块更新div并导致重新执行此javascript块?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆