javascript - Best way to depend on swfObject in a library -


I am creating a Javascript library for customers so that my company's product is made in their own web pages. Could. The content is just a combination of html and flash with some javascript glue. We use SWFObject to embed our flash content.

My question is, what is the best way to manage this dependency?

Currently I'm considering two options:

1) Include a copy of swfObject.js with our distribution and end users the Sphibogs.JS script for myself Add elements.

2) Copy the source of swfObject.js into our Javascript library and hide it from our end users. # 1 It would be better to have some control over the script of those people who are using their last page (like they can update swfObject.js in a new version). I have noticed that many subscriber pages have already embedded some flash content in swfObject, so the same copy of swfObject.js would be efficient.

# 2 It seems that it will be safe for us because we can investigate against it a known swfObject version.

What are the other, better options? This is my first Javascript library attempt, how do people generally do this?

If you can properly expect your end users to add a script element yourself To be able, you may be able to get a good agreement between stability and optimization by revealing that which supports swfObject.

  google.load ("swfobject", "2.2");  

Comments

Popular posts from this blog

c# - ListView onScroll event -

PHP - get image from byte array -

Linux Terminal Problem with Non-Canonical Terminal I/O app -