Interview Questions Answers.ORG
Interviewer And Interviewee Guide
Interviews
Quizzes
Home
Quizzes
Interviews Scripting language Interviews:AngularJSAngularJS DeveloperChrome FrameDojoExpert Developer JavaScriptExpert JavaScript DeveloperExt CoreEXT-GWTExt-JSFront End Developer (AngularJS)JQuery DeveloperjQuery MobileJQuery ProgrammerJQuery UIMooToolsPrototype FrameworkQooxdooScriptingSencha TouchSizzle Selector EngineSWFObjectWeb Font LoaderXMLHttpRequest
Copyright © 2018. All Rights Reserved
SWFObject Interview Question:
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
Copyright 2007-2024 by Interview Questions Answers .ORG All Rights Reserved.
https://InterviewQuestionsAnswers.ORG.
https://InterviewQuestionsAnswers.ORG.