Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3321374
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T23:03:18+00:00 2026-05-17T23:03:18+00:00

Now that i learned how to pass values to an SWF object via flashvars

  • 0

Now that i learned how to pass values to an SWF object via flashvars, could you please guide me how can i pass values from a querystring to javascript?

What do i mean? In the following example i hard-code the xml file to load in the SWF object.

<script type="text/javascript">
    var so = new SWFObject("preview.swf", "", "100%", "100%", "9", "#ffffff");
    so.addParam("allowFullScreen", "true");
    so.addParam("scale", "noscale");
    so.addParam("menu", "false");
    so.addVariable("xmlPath", "xml/exampleData.xml");
    so.write("flashcontent");
</script>

Since the Xml file is created dynamic, the xml should be loaded from the value of a query-string. (I guess).

Supposing my url is http://www.example.com/load.aspx?XmlFile=SomeData

How can i pass it to the javascript side? Like..

  so.addVariable("xmlPath", "xml/<% SomeData %>.xml");

or whatever it needs to make it work.

UPDATE: Besides the above example, is there any way of creating the JavaScript, in server-side?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T23:03:19+00:00Added an answer on May 17, 2026 at 11:03 pm

    Try something like:

    function GetQueryString(param) 
    {
     var url = window.location.search.substring(1);
        var params = url.split("&");
        for (i=0;i<params.length;i++) 
        {
            var p = params[i].split("=");
            if (p[0] == param) 
            {
                return p[1];
            }
        }   
    }
    

    And use it like:

    so.addVariable("xmlPath", "xml/" + GetQueryString("XmlFile") + ".xml");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I just now learned of the X-Robots-Tag which can be set as part
I've learned that you should usually stick with either forking or threading to avoid
Today Recently on Stackoverflow i learned that: reintroduce is used to hide ancestor constructors
Recently i've switched to PHP 5.3+ and after that migration i learned that the
I have a BankAccount model class that contains data like account number, bank name,
I've been building an app recently that has a model Books that is a
I'm trying to make OpenGL draw the figure that I'm loading with OPENFILENAME .
I've learned scheme and quickly mastered a lot of it, then did a project
So I am currently trying to make the game Asteroids for a class. The
My question does not really have much to do with sqlalchemy but rather with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.