How Do I Force An Object On The Page To PostBack or Reload?

Discussion in 'Javascript' started by pbd22, Nov 28, 2007.

  1. pbd22

    pbd22 Guest

    Hi.

    I am using xmlhttp to send a querystring to the current page.
    this returns a URL to the windows media player widget on my page:

    <object id="Player" style="border:solid 1px black; width:500px;
    height:400px;" classid="CLSID:6BF52A52-394A-11d3-B153-SD8FF79FAA6">
    <param
    name="URL" value="<% =GetPlayerUrl() %>" />
    <param
    name="AutoPlay" value="true" />
    <param
    name="stretchToFit" value="-1"/>
    <param
    name="EnableContextMenu" value="false" />
    </object>

    So, the player usually starts on postback but since this is XMLHTTP,
    how
    do I force just the player to reload so it can grab the appropriate
    url string?

    Thanks!
    pbd22, Nov 28, 2007
    #1
    1. Advertising

  2. pbd22

    Kailash Nadh Guest

    On Nov 28, 4:27 pm, pbd22 <> wrote:
    > Hi.
    >
    > I am using xmlhttp to send a querystring to the current page.
    > this returns a URL to the windows media player widget on my page:
    >
    > <object id="Player" style="border:solid 1px black; width:500px;
    > height:400px;" classid="CLSID:6BF52A52-394A-11d3-B153-SD8FF79FAA6">
    > <param
    > name="URL" value="<% =GetPlayerUrl() %>" />
    > <param
    > name="AutoPlay" value="true" />
    > <param
    > name="stretchToFit" value="-1"/>
    > <param
    > name="EnableContextMenu" value="false" />
    > </object>
    >
    > So, the player usually starts on postback but since this is XMLHTTP,
    > how
    > do I force just the player to reload so it can grab the appropriate
    > url string?
    >
    > Thanks!


    Well, you could try this (dirty) trick.
    <div id="player">
    ... <object> code ...
    </div>
    and on receiving a response just clear the innerHTML of #player and
    insert new <object> code with your new url :)

    Ps : I am sure there are straightforward methods

    --
    Kailash Nadh | http://kailashnadh.name
    Kailash Nadh, Nov 28, 2007
    #2
    1. Advertising

  3. pbd22

    pbd22 Guest

    On Nov 28, 11:38 am, Kailash Nadh <> wrote:
    > On Nov 28, 4:27 pm, pbd22 <> wrote:
    >
    >
    >
    > > Hi.

    >
    > > I am using xmlhttp to send a querystring to the current page.
    > > this returns a URL to the windows media player widget on my page:

    >
    > > <object id="Player" style="border:solid 1px black; width:500px;
    > > height:400px;" classid="CLSID:6BF52A52-394A-11d3-B153-SD8FF79FAA6">
    > > <param
    > > name="URL" value="<% =GetPlayerUrl() %>" />
    > > <param
    > > name="AutoPlay" value="true" />
    > > <param
    > > name="stretchToFit" value="-1"/>
    > > <param
    > > name="EnableContextMenu" value="false" />
    > > </object>

    >
    > > So, the player usually starts on postback but since this is XMLHTTP,
    > > how
    > > do I force just the player to reload so it can grab the appropriate
    > > url string?

    >
    > > Thanks!

    >
    > Well, you could try this (dirty) trick.
    > <div id="player">
    > ... <object> code ...
    > </div>
    > and on receiving a response just clear the innerHTML of #player and
    > insert new <object> code with your new url :)
    >
    > Ps : I am sure there are straightforward methods
    >
    > --
    > Kailash Nadh |http://kailashnadh.name


    thanks but i don't think that will pull the new url from the server.
    i don't have the URL on the client. my xmlhttp request has created
    the url string on the server and a postback would allow this code:
    "<% =GetPlayerUrl() %>" to play the new file. But, I don't want to
    postback so, how do I get "<% =GetPlayerUrl() %>" to pull the server
    value? I am thinking forcing the object tag itself to refresh but
    how do I do that?
    pbd22, Nov 28, 2007
    #3
  4. pbd22

    VK Guest

    On Nov 28, 7:27 pm, pbd22 <> wrote:
    > Hi.
    >
    > I am using xmlhttp to send a querystring to the current page.


    You cannot send a querystring "to" the page, you only can send a query
    string "from" the page, in HTTP all connections are initiated by
    client, not server. So either you did not describe the actual task
    properly or you are trying to do something beyond the capabilities of
    HTTP protocol. If the first then could you provide a bit more of
    details?
    VK, Nov 28, 2007
    #4
  5. pbd22

    Kailash Nadh Guest

    On Nov 28, 4:52 pm, pbd22 <> wrote:
    > On Nov 28, 11:38 am, Kailash Nadh <> wrote:
    >
    >
    >
    > > On Nov 28, 4:27 pm, pbd22 <> wrote:

    >
    > > > Hi.

    >
    > > > I am using xmlhttp to send a querystring to the current page.
    > > > this returns a URL to the windows media player widget on my page:

    >
    > > > <object id="Player" style="border:solid 1px black; width:500px;
    > > > height:400px;" classid="CLSID:6BF52A52-394A-11d3-B153-SD8FF79FAA6">
    > > > <param
    > > > name="URL" value="<% =GetPlayerUrl() %>" />
    > > > <param
    > > > name="AutoPlay" value="true" />
    > > > <param
    > > > name="stretchToFit" value="-1"/>
    > > > <param
    > > > name="EnableContextMenu" value="false" />
    > > > </object>

    >
    > > > So, the player usually starts on postback but since this is XMLHTTP,
    > > > how
    > > > do I force just the player to reload so it can grab the appropriate
    > > > url string?

    >
    > > > Thanks!

    >
    > > Well, you could try this (dirty) trick.
    > > <div id="player">
    > > ... <object> code ...
    > > </div>
    > > and on receiving a response just clear the innerHTML of #player and
    > > insert new <object> code with your new url :)

    >
    > > Ps : I am sure there are straightforward methods

    >
    > > --
    > > Kailash Nadh |http://kailashnadh.name

    >
    > thanks but i don't think that will pull the new url from the server.
    > i don't have the URL on the client. my xmlhttp request has created
    > the url string on the server and a postback would allow this code:
    > "<% =GetPlayerUrl() %>" to play the new file. But, I don't want to
    > postback so, how do I get "<% =GetPlayerUrl() %>" to pull the server
    > value? I am thinking forcing the object tag itself to refresh but
    > how do I do that?


    hm, that is confusing. Can't you get a javascript routine (client
    side, using xmlhttprequest) to fetch the url from the server,
    construct the <object>.. code with the url and insert the code snippet
    into place, as I mentioned earlier?

    http://www.w3schools.com/ajax/ajax_server.asp

    --
    Kailash Nadh | http://kailashnadh.name
    Kailash Nadh, Nov 29, 2007
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Sia Jai Sung

    Force reload of ASP page after processing

    Sia Jai Sung, Jan 2, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    8,168
  2. UJ
    Replies:
    6
    Views:
    75,951
    pcpgmr
    Mar 23, 2010
  3. tshad

    no-cache to force reload new page

    tshad, Jul 27, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    822
    tshad
    Jul 27, 2006
  4. Nige

    Force reload of changed page?

    Nige, Nov 14, 2003, in forum: Javascript
    Replies:
    3
    Views:
    134
    Thomas 'PointedEars' Lahn
    Nov 18, 2003
  5. Mark Anderson
    Replies:
    4
    Views:
    176
    Mark Anderson
    Mar 2, 2005
Loading...

Share This Page