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?
We had been doing some dynamically stuff with media and 2d/3d viewings and
this is the same structure we use.
-CJ
<mai...@gmail.com> wrote in message
news:1162502251.4...@k70g2000cwa.googlegroups.com...
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.
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/
Answer:It destroys the order of the conversation
Question: Why?
Answer: Top-Posting.
Question: Whats the most annoying thing on Usenet?
> That will work nicely on Firefox but not on Safari
Does Safari support createElement, appendChild and setting the .src or
.text property of that script element?
<script type="text/javascript">
function loadJSFile(){
var newScript = document.createElement('script');
newScript.type = "text/javascript";
newScript.text = "alert('It Worked');
document.getElementById('scriptDiv').appendChild(newScript);
}
window.onload = loadJSFile;
</script>
<div id="scriptDiv"></div>
When running that in Safari, do you get the alert, an error message, or
nothing?
> Michael said the following on 11/3/2006 6:21 PM:
>
> Answer:It destroys the order of the conversation
> Question: Why?
> Answer: Top-Posting.
> Question: Whats the most annoying thing on Usenet?
>
>> That will work nicely on Firefox but not on Safari
>
>
> Does Safari support createElement, appendChild and setting the .src or
> .text property of that script element?
>
> <script type="text/javascript">
> function loadJSFile(){
> var newScript = document.createElement('script');
> newScript.type = "text/javascript";
> newScript.text = "alert('It Worked');
> document.getElementById('scriptDiv').appendChild(newScript);
> }
>
> window.onload = loadJSFile;
> </script>
> <div id="scriptDiv"></div>
>
> When running that in Safari, do you get the alert, an error message, or
> nothing?
>
newScript.text = "alert('It Worked');// missing closing quote mark.
newScript.text = "alert('It Worked')";
In Safari, nothing, no error, nothing.
Mick
I remember that quote mark and obviously missed fixing it before posting :-\
> In Safari, nothing, no error, nothing.
What about this code:
<script type="text/javascript">
function loadJSFile(){
var newScript = document.createElement('script');
newScript.type = "text/javascript";
newScript.src = 'someFile.js';
document.getElementById('scriptDiv').appendChild(newScript);
}
window.onload = loadJSFile;
</script>
<div id="scriptDiv"></div>
Where someFile.js is an external file (you will have to create it) with
an alert('It worked') in it?
Also, since you have Safari, can you test this page:
<URL: http://members.aol.com/_ht_a/hikksnotathome/loadJSFile/index.html>
I don't have Safari listed there so if you could test it for me, I would
be grateful. What you should get is an initial alert when the page loads
that says "Initial File Loaded". Then there are three buttons across the
page. What happens when you click each? Also, what version of Safari and
what MAC OS you are using would be appreciated.
Anybody else that can test it and let me know OS, ver/rev browser and
what the results are so I can update it.
I may have to revisit it and change it to test for altering the script
elements .text property.
This works.
>
> Also, since you have Safari, can you test this page:
>
> <URL: http://members.aol.com/_ht_a/hikksnotathome/loadJSFile/index.html>
>
> I don't have Safari listed there so if you could test it for me, I would
> be grateful. What you should get is an initial alert when the page loads
> that says "Initial File Loaded".
This works.
Then there are three buttons across the
> page. What happens when you click each?
Create element // alerts "createElement worked"
Change innerHTML and Change Source // Nothing, no errors
Also, what version of Safari and
> what MAC OS you are using would be appreciated.
Mac OS 10.3.9, Safari 1.3.2 (v312.6)
Mick
Anything below Safari 2.0 is irrelevant for the web-development.
It is not a bias: just the plain technical true. Just to give you a
touch of how low initially was it: 1.1. (not some 0.1) was hanging up
on any attempt to use JavaScript.
P.S. Do you still want another better world, man? Go get it in 3D,
we'll try to help ye...
>> Mac OS 10.3.9, Safari 1.3.2 (v312.6)
>
>
> Anything below Safari 2.0 is irrelevant for the web-development.
>
What a stupid statement.
Mick
<snip>
> Then there are three buttons across the
>> page. What happens when you click each?
> Create element // alerts "createElement worked"
> Change innerHTML and Change Source // Nothing, no errors
>
> Also, what version of Safari and
>> what MAC OS you are using would be appreciated.
>
>
> Mac OS 10.3.9, Safari 1.3.2 (v312.6)
Thank you, I have it updated locally and will update it online sometime
tonight.
Mick, meet VK :) 99.99% of what he says falls into that category.
on Mac OS 10.4 with Safari 2.0.4, when I hit
http://members.aol.com/_ht_a/hikksnotathome/loadJSFile/index.html, I
get the following:
CreateElement : I get the alert
Change Source or innerHTML : nothing, no error, no alert
Hope that helps
Michael
On Nov 4, 1:09 pm, Randy Webb <HikksNotAtH...@aol.com> wrote:
> mick white said the following on 11/4/2006 2:48 PM:
>
> > VK wrote:
>
> >>> Mac OS 10.3.9, Safari 1.3.2 (v312.6)
>
> >> Anything below Safari 2.0 is irrelevant for the web-development.
>
> > What a stupid statement.Mick, meet VK :) 99.99% of what he says falls into that category.
It did. Do you happen to have a browser that isn't listed on that page?
The more comprehensive that I can make that list the better.
--
Randy
Chance Favors The Prepared Mind