Yes. Just ensure that you are not calling any mootools methods until you
have actually written the mootools js src to the page. I think you might
want to create DOM elements and write your mootools js in the <head> tag
rather than just dumping the js in a random place on the page however.
If you need to know when the script has loaded you can simply use
.onload=yourfunction; to set up the onload handler. Here's an example.
var headID = document.getElementsByTagName("head")[0];
var newScript = document.createElement('script');
newScript.type = 'text/javascript';
newScript.onload=scriptLoaded;
newScript.src = '
http://api.flickr.com/services/feeds/photos_public.gne?tags=sunset&format=json
';
headID.appendChild(newScript);
Now when this script has been loaded the .onload event will call a function
named scriptLoaded().
Cheers,
Aran
On Sat, May 29, 2010 at 9:42 AM, graemezee <[email protected]> wrote:
> Is it possible to create a Js that detects if flash is available If
> its not it then writes headers for alternate content
> something like this
>
> if (swfobject.hasFlashPlayerVersion("9.0.18")) {
> // has Flash
> do nothing
> }
> else {
> // no Flash
> php {
> echo('<link rel=/"stylesheet/" href=/"css/menu.css/" type=/"text/
> css/" />');
> echo('<script type=/"text/javascript/" src=/"/templates/js/
> mootools.v1.1.js/"></script>');
> }; php
>
> }
>
> Thanks
>
> --
> You received this message because you are subscribed to the Google Groups
> "SWFObject" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<swfobject%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/swfobject?hl=en.
>
>
--
You received this message because you are subscribed to the Google Groups
"SWFObject" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/swfobject?hl=en.