Note that there are some explanatory texts on larger screens.

plurals
  1. POYouTube API, jQuery attr won't swap element attributes
    primarykey
    data
    text
    <p>JavaScript (jQuery)</p> <pre><code>function display_youtube(new_url) { $('#movie_url').removeAttr('value'); $('#embed_url').removeAttr('src'); $(document).ready(function() { $('#movie_url').attr('value', new_url); $('#embed_url').attr('src', new_url); $('#shade').css('display', 'block'); $('#youtube_player').css('display', 'block'); $('#exit_youtube').css('display', 'block'); }); } </code></pre> <p>HTML</p> <pre><code>&lt;object width="720" height="480"&gt; &lt;param id="movie_url" name="movie" value="http://www.youtube.com/v/_eaToCSn7yU?f=user_uploads&amp;app=youtube_gdata&amp;autoplay=0" /&gt; &lt;param name="allowFullScreen" value="true" /&gt; &lt;param name="allowscriptaccess" value="always" /&gt; &lt;embed id="embed_url" src="http://www.youtube.com/v/_eaToCSn7yU?f=user_uploads&amp;app=youtube_gdata&amp;autoplay=0" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="720" height="480" /&gt; &lt;/object&gt; </code></pre> <p>Hyperlink</p> <pre><code>&lt;a href="javascript:display_youtube('http://www.youtube.com/v/_eaToCSn7yU?f=user_uploads&amp;app=youtube_gdata&amp;autoplay=1');"&gt;Click Here for Fun!&lt;/a&gt; </code></pre> <p>What I've done is parsed YouTube's API for the videos on my user channel.</p> <p>The hyperlink above is php generated, meant to trigger the above JavaScript function, and swap the url from attributes contained in ids "movie_url" and "embed_url" works just like it should in FF, but IE it will only perform the .css commands. </p> <p>My guess is that IE doesn't like me assigning IDs to PARAM and EMBED.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload