FlashVars QueryString

社会主义新天地 提交于 2019-12-12 23:33:22

问题


I'm unclear on the proper format for passing a QueryString Value using FlashVars, this is what I'm trying

<param name="FlashVars" value="part=<%= Request.QueryString["part"] %>" />

but this causes a parse/encode error and the swf doesnt load, same if I use single quotes ie

<param name="FlashVars" value="part=<%= Request.QueryString['part'] %>" />

Any takers?

Cheers


回答1:


If you are working with HTML, use the variable itself:

<param name="FlashVars" value="part=valueOfPartGoesHere&anotherPart=anotherPartValueGoesHere" />

For embed tags (required for FF and other browsers):

<embed flashvars="part=valueOfPartGoesHere&anotherPart=anotherPartValueGoesHere" />

Fot this to be dynamic you have to run a PHP, ASP or other dynamic language/platform.

If you are using PHP, use:

<?php echo $_GET['part']; ?>

instead of

<%= Request.QueryString['part'] %>

For ASP:

<%= Request.QueryString("part") %>

And so on...




回答2:


expanding on rcdmk's answer, the value that flashvars expects is just a standard query string with keys and values a=b&c=d&so_on=so_forth.

What you have shown in your code is that you're having some engine insert some value into your HTML renderer. That's fine, but then you need to show a sample of what this substitution will produce. If it's not producing something that looks like the query above, then it won't work. And if it' producing something that has a quote in it, then obviously once it's being parsed it will choke on an incomplete tag (as your substitution will end the tag prematurely and throw everything into the crapper).



来源:https://stackoverflow.com/questions/9423826/flashvars-querystring

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!