How to pass URIs or HTML code as a value using flashvars?
Submitted by: AdministratorSpecial characters and the symbols = and & cannot directly be used inside flashvars values (the latter because they are used to stack the flashvars themselves).
You can workaround this issue by escaping these characters before passing them as flashvar values. An example:
encodeURIComponent("&trade") will become %26trade
The values will be available in your swf already unencoded, so no unescaping is needed inside your swf.
Note that encodeURIComponent is not available in all browsers, but is available in all of the common modern versions. If you need full backwards compatibility, you can use escape() instead, but note that escape() does not work well with double-byte characters (like Chinese).
You can also escape these characters manually by using:
%3D instead of =
%26 instead of &
Submitted by: Administrator
You can workaround this issue by escaping these characters before passing them as flashvar values. An example:
encodeURIComponent("&trade") will become %26trade
The values will be available in your swf already unencoded, so no unescaping is needed inside your swf.
Note that encodeURIComponent is not available in all browsers, but is available in all of the common modern versions. If you need full backwards compatibility, you can use escape() instead, but note that escape() does not work well with double-byte characters (like Chinese).
You can also escape these characters manually by using:
%3D instead of =
%26 instead of &
Submitted by: Administrator
Read Online SWFObject Job Interview Questions And Answers
Top SWFObject Questions
☺ | How to avoid Active Server Pages error ASP 0139 when using static publishing and Microsoft IIS? |
☺ | Tell me why does Internet Explorer 6 and 7 show the error message J.parentNode is null or not an object? |
☺ | Explain why can we see memory usage increase on every page refresh in Internet Explorer? |
☺ | Tell us why does Firefox report Permission denied to call method Location.toString in the error console? |
☺ | Do you know why does Firefox load my SWF twice? |
Top Scripting language Categories
☺ | AngularJS Interview Questions. |
☺ | Ext-JS Interview Questions. |
☺ | Dojo Interview Questions. |
☺ | Expert Developer JavaScript Interview Questions. |
☺ | jQuery Mobile Interview Questions. |