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 8014941
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T20:06:03+00:00 2026-06-04T20:06:03+00:00

JS/JQuery Newb here! I have a value stored in variable, and I need to

  • 0

JS/JQuery Newb here!

I have a value stored in variable, and I need to plug it into a particular <parameter> element associated with an <object>. Here’s an example of what I was hoping I could do:

<script>

    function SetParam(incomingValue){
         $('#baz').value = incomingValue ;
    }

    $(document).ready (function() {

       // jquery POST happens here, which takes a second or two to complete
       // SUCCESS condition calls SetParam() with a value  

        });
</script>

<object class="foo">
    <param name="bar" value="xyzzy" />
   <param name="baz" value="" id="baz" />
</object>

No joy. The baz parameter controls how the object is visually rendered, and I see no changes to indicate I’ve successfully changed the value.

I’m not sure if:

A. My syntax is wrong in terms of addressing the “baz” parameter in SetParam()

B. My syntax is fine, but the object has already rendered by the time I hit SetParam(), so setting the value of baz does nothing useful

C. All of the above

Can anyone kick me in the right direction?

(and if my problem includes scenario “B” – is there a way to delay the loading of that <object> until I’ve actually set the value of the <parameter> that I need to?)

Here’s a “JSFiddle” of same – Just found about about this and jsbin. Woot!

http://jsfiddle.net/sPhrw/

  • 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-06-04T20:06:04+00:00Added an answer on June 4, 2026 at 8:06 pm

    You’ll need to either use plain javascript, or jQuery:

    $('#baz').val(incomingValue);
    

    or

    $('#baz')[0].value = incomingValue;
    

    or

    document.getElementById('baz').value = incomingValue; 
    

    or

    function SetParam(incomingValue){
         var $foo = $('<object class="foo"></object>'),
             $bar = $('<param name="bar" value="xyzzy" />'),
             $baz = $('<param name="baz" value="'+ incomingValue +'" id="baz" />');
             $foo.append($bar).append($baz).appendTo(someParent);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

As a newb to jQuery I'm wondering if it's possible to have both jQuery
Jquery/programming newb here. I'm trying to dynamically assign a height to a ul to
I am a jQuery newb so this is probably rudimentary. I have a test
total jquery newb here and I'm wondering what the difference in therse two types
jQuery hyperlinks - href value? text][1] I am running in to a problem using
jQuery autocomplete plugin shows results that begin with the query you type into a
I'm a jQuery newb and I've been trying to create a custom slideshow widget
I'm a newb in ajax stuff, so this is my first project with jquery
jQuery 1.7.1 - I'm using jQuery tabs widget in my JSP and have the
jQuery Mobile Docs says if we wrap form element in div containing data-role=fieldcontain proper

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.