<?xml version="1.0" encoding="ISO-8859-1"?>

<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
	<channel>
		<title>Dynamic Drive Forums - Blogs - molendijk</title>
		<link>http://www.dynamicdrive.com/forums/blog.php?22645-molendijk</link>
		<description>Dynamic Drive help forum</description>
		<language>en</language>
		<lastBuildDate>Sat, 25 May 2013 19:21:58 GMT</lastBuildDate>
		<generator>vBulletin</generator>
		<ttl>10</ttl>
		<image>
			<url>http://www.dynamicdrive.com/forums/images/misc/rss.jpg</url>
			<title>Dynamic Drive Forums - Blogs - molendijk</title>
			<link>http://www.dynamicdrive.com/forums/blog.php?22645-molendijk</link>
		</image>
		<item>
			<title>Automatic IE upgrades</title>
			<link>http://www.dynamicdrive.com/forums/entry.php?277-Automatic-IE-upgrades</link>
			<pubDate>Fri, 10 May 2013 19:55:07 GMT</pubDate>
			<description>A couple of days ago, I noticed that I have IE10 on my computer, although I did not install this latest IE-version myself. Apparently, Microsoft has started automatic upgrades of IE to its latest version(s). 
 
So I wanted to know how my sites looked like with IE10 (I normally use Firefox). They...</description>
			<content:encoded><![CDATA[<blockquote class="blogcontent restore">A couple of days ago, I noticed that I have IE10 on my computer, although I did not install this latest IE-version myself. Apparently, Microsoft has started automatic upgrades of IE to its latest version(s).<br />
<br />
So I wanted to know how my sites looked like with IE10 (I normally use Firefox). They looked normal, but the javascript on certain pages produced unwanted results that were not problematic until now (with IE7/8/9). <br />
<br />
At first, I was unable to find out what caused the trouble. Then I remembered having read somewhere that support for conditional comments has been removed in IE10. So I removed the comments and replaced them with (javascript browser) sniffing lines and voilą: everything was fine again.<br />
<br />
Here's the javascript I used (it seems reliable):<br />
<i>if(/*@cc_on!@*/false){} // if IE<br />
if(/*@cc_on!@*/true){} // if not IE<br />
if (ieversion==7){} // if IE7<br />
if (ieversion&gt;7){} // if IE8 and up<br />
if (ieversion&gt;=8) // if IE8 and up</i><br />
etc.<br />
<br />
For the ie-version lines I used the following script:<br />
<i>&lt;script  type=&quot;text/javascript&quot;&gt;<br />
if (/MSIE (\d+\.\d+);/.test(navigator.userAgent))<br />
{ //test for MSIE x.x;<br />
var ieversion=new Number(RegExp.$1) // capture x.x portion and store as a number<br />
}<br />
&lt;/script&gt;</i><br />
<br />
I hope this may be useful.</blockquote>

]]></content:encoded>
			<dc:creator>molendijk</dc:creator>
			<guid isPermaLink="true">http://www.dynamicdrive.com/forums/entry.php?277-Automatic-IE-upgrades</guid>
		</item>
		<item>
			<title>Things we can do with location.search</title>
			<link>http://www.dynamicdrive.com/forums/entry.php?274-Things-we-can-do-with-location-search</link>
			<pubDate>Tue, 01 Jan 2013 22:42:50 GMT</pubDate>
			<description><![CDATA[The javascript location.search propery sets / returns the query portion of a URL, including the question mark (?). This means that if we put <a onclick="location.search='this is a test'">test</a> in a file named our_file.html, the URL (our_file.html) will be replaced with our_file.html?this is a...]]></description>
			<content:encoded><![CDATA[<blockquote class="blogcontent restore">The javascript <font color="#FF0000">location.search</font> propery sets / returns the query portion of a URL, including the question mark (?). This means that if we put <i>&lt;a onclick=&quot;<font color="#FF0000">location.search</font>='this is a test'&quot;&gt;test&lt;/a&gt;</i> in a file named <i>our_file.html</i>, the URL (<i>our_file.html</i>) will be replaced with <i>our_file.html?this is a test</i> after a click on the link. Having arrived at <i>our_file.html?this is a test</i>, we can go back to <i>our_file.html</i> by using the browser's history (back) button. The content of <i>our_file.html?this is a test</i> will be identical to the content of <i>our_file.html</i>, unless we do something about it. And we should, because having two identical pages on a site is not a very useful thing.<br />
<br />
We can use the search portion of a URL containing a question mark - where the search portion is the string to the right of '?' - to pass data from one page (<i>our_file.html</i>) to another (<i>our_file.html?this is a test</i>). Here's a script that we could use for that purpose. It must be put immediately before the closing body tag of the page (here: <i><i>our_file.html</i></i>)<br />
&lt;script&gt;<br />
var data=<font color="#FF0000">location.search</font>;<br />
if(data)<br />
{<br />
data = <font color="#FF0000">location.search</font>.substring(1); // needed to remove the '?'<br />
//do something with the data<br />
data=''<br />
}<br />
&lt;/script&gt;<br />
<br />
In the above script, we can replace <i>//do something with the data</i> with some concrete javascript line using the variable<i> data</i>, like <i>document.write(data)</i> - or, if we want the data to be readable: <i>document.write(unescape(data))</i>. The result we be that a text string (<i>this is a test</i>) is passed from <i>our_file.html</i> to <i>our_file.html?this is a test</i> when we click on our link in <i>our_file.html</i> (where the link is provided by <i>&lt;a onclick=&quot;<font color="#FF0000">location.search</font>='this is a test'&quot;&gt;test&lt;/a&gt;</i>, see above).<br />
<br />
A more interesting example of passing data from one page to another using the search portion of a URL is the following, which assumes that (i) we have an iframe in <i>our_file.html: &lt;iframe name=<b>&quot;ifr</b>&quot; style=&quot;position: absolute; width: 300px; height: 300px; background: white&quot; src=&quot;some_page.html&quot;&gt;&lt;/iframe&gt;</i> and that (ii) <i>//do something with the data</i> in the script above is replaced with <i><b>ifr</b>.location.replace(data)</i>. If we now replace our original link in <i>our_file.html</i> with <i>&lt;a onclick=&quot;<font color="#FF0000"><font color="#FF0000">location.search</font></font>='some_other_page.html'&quot;&gt;some other page&lt;/a&gt;</i>, a click on the new link will take us to a new page <i>our_file.html?some_other_page.html</i> which is identical to <i>our_file.html</i> except for the content of the iframe, which loads <i>some_other_page.html</i> (in <i>our_file.html?some_other_page.html</i>). Of course, in order for this to work, we must create two pages <i>some_page.html</i> and <i>some_other_page.html</i> first.<br />
<br />
This demonstrates that <font color="#FF0000">location.search</font> can be used to (i) preserve the content of a given page (here: <i>our_file.html</i>) and, at the same time, to (ii) change the content of an iframe contained in it while going from one page to another page (here: <i>our_file.html?some_other_page.html</i>). So a navigation menu in the 'main page' (here: <i>our_file.html</i>) will be visible on all pages of a site constructed along the lines given here.<br />
IMPORTANT: <i>&lt;a onclick=&quot;<font color="#FF0000">location.search</font>='some_other_page.html'&quot;&gt;some other page&lt;/a&gt;</i> was used above in a non-iframed page to go from <i>some_page.html</i> (in an iframe) to <i>some_other_page.html</i> (in an iframe). If we want to change the iframe's content <b>from within</b> the iframe, we should do &lt;<i>a onclick=&quot;<b>parent</b>.<font color="#FF0000">location.search</font>='some_other_page.html'&quot;&gt;some other page&lt;/a&gt;</i>. <br />
<br />
Demo and explanations <a href="http://mesdomaines.nu/eendracht/include_menu_web_templates6h" target="_blank"><i><u>here</u></i></a>. The demo contains features that have nothing to do with <font color="#FF0000">location.search</font>, because I already used the files of the demo for another purpose. But I think it explains rather what I want to show.<br />
<br />
Arie.</blockquote>

]]></content:encoded>
			<dc:creator>molendijk</dc:creator>
			<guid isPermaLink="true">http://www.dynamicdrive.com/forums/entry.php?274-Things-we-can-do-with-location-search</guid>
		</item>
		<item>
			<title>New windows, new tabs and popup blockers</title>
			<link>http://www.dynamicdrive.com/forums/entry.php?271-New-windows-new-tabs-and-popup-blockers</link>
			<pubDate>Fri, 07 Dec 2012 21:33:22 GMT</pubDate>
			<description><![CDATA[*(To see and test what this is all about, you should download Safari  if you haven't already done so. After that, use the code below with popup blocker enabled AND with popup blocker disabled, using Safari)*. 
 
When a new window or tab is not explicitly requested by the visitor of a site i.e. when...]]></description>
			<content:encoded><![CDATA[<blockquote class="blogcontent restore"><b>(To see and test what this is all about, you should download <i>Safari </i> if you haven't already done so. After that, use the code below with popup blocker enabled AND with popup blocker disabled, using Safari)</b>.<br />
<br />
When a new window or tab is not explicitly requested by the visitor of a site i.e. when the window's appearance is attached to such events as <i>onload</i> or <i>onunload</i>, popup blockers (if enabled) will prevent a file from being opened. But when the window's appearance is attached to an <i>onclick</i> event on a link (and other events that can be taken to mean that a person has explicitly requested a new window, like the <i>onchange</i> in a select box, see below), the browser won't allow popup blockers to stop windows or tabs from appearing.<br />
<br />
Well, not quite so. Sometimes, browsers / popup blockers make mistakes and block windows or tabs although they are explicitly requested by the user. One such example is <i>Safari</i>'s treatment of links in the options of a select box. A simple example of a script for opening a new window or tab using the <i>onclick</i> event is the following:<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code"style="height:288px;">&lt;script&gt;
function open_in_new_window(url)
{
var wwidth=700;
var lleft=parseInt(screen.width/2)-parseInt(wwidth/2);
the_popup=window.open(url,&quot;_blank&quot;,&quot;left=&quot;+lleft+&quot;,width=&quot;+wwidth+&quot;,height=400, top=100&quot;);
}

function open_in_new_tab(url)
{window.open('','_new').location.replace(url)}
&lt;/script&gt;


&lt;select onchange=&quot;selectedIndex=0; open_in_new_window('http://www.dynamicdrive.com');&quot;&gt;
&lt;option disabled=&quot;disabled&quot; selected&gt;Destination in new window&lt;/option&gt;
&lt;option &gt;Open in new window&lt;/option&gt;
&lt;/select&gt;

&lt;select onchange=&quot;selectedIndex=0; open_in_new_tab('http://www.dynamicdrive.com')&quot;&gt;
&lt;option disabled=&quot;disabled&quot; selected&gt;Destination in new tab&lt;/option&gt;
&lt;option &gt;Open in new tab&lt;/option&gt;
&lt;/select&gt;</pre>
</div>A click on the second option of both select boxes above should open a new window (first select box) or a new tab (second select box). And that's indeed what happens in <i>IE, Firefox, Chrome</i> and <i>Opera</i> (popup blockers enabled!). But not so with <i>Safari</i>. This browser does not recognize <i>onchange=open_in_new_window(...)</i> and <i>onchange=open_in_new_tab(...)</i> as explicit requests. In this particular case, it views the <i>onchange</i> as something that is forced upon the user and that, therefore, must be prevented to happen.<br />
<br />
There may be other cases where things like this may happen (with <i>Safari</i> or with other browsers). So we must have a means to warn the user to disable his/her popup blocker in particular cases. The code is simple. We must simply verify whether or not the browser 'recognizes' or allows an event. In our example, <i>Safari</i> apparently does not recognize or allow <i>window.open</i> and <i>window.open('','_new')</i> (if blocking popups is enabled). We can use this information to modify the script given above as follows:<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code"style="height:264px;">&lt;script&gt;
function open_in_new_window(url)
{
var wwidth=700;
var lleft=parseInt(screen.width/2)-parseInt(wwidth/2);
the_popup=window.open(url,&quot;_blank&quot;,&quot;left=&quot;+lleft+&quot;,width=&quot;+wwidth+&quot;,height=400, top=100&quot;);

if (typeof(the_popup)=='undefined'){alert(&quot;Your browser tried to open:\n\n&quot;+unescape(url)+&quot;\n\nAlthough this is a safe file, your security settings prevented it from being opened in a new window. Please disable your pop-up blocker, reload the page, then click the link again.&quot;); }

}

function open_in_new_tab(url)
{

if (typeof(window.open('','_new'))=='undefined') {
alert(&quot;Your browser tried to open:\n\n&quot;+unescape(url)+&quot;\n\nAlthough this is a safe file, your security settings prevented it from being opened in a new tab. Please disable your pop-up blocker, reload the page, then click the link again.&quot;); }

window.open('','_new').location.replace(url)
}
&lt;/script&gt;</pre>
</div><br />
DEMO AND EXPLANATIONS<a href="http://mesdomaines.nu/eendracht/window_open_with_blocker/window_open_with_blocker.html" target="_blank"><b><i> here</i></b></a> (you must use <i> Safari</i>).<br />
<br />
Arie</blockquote>

]]></content:encoded>
			<dc:creator>molendijk</dc:creator>
			<guid isPermaLink="true">http://www.dynamicdrive.com/forums/entry.php?271-New-windows-new-tabs-and-popup-blockers</guid>
		</item>
		<item>
			<title>Putting text on top of a video</title>
			<link>http://www.dynamicdrive.com/forums/entry.php?266-Putting-text-on-top-of-a-video</link>
			<pubDate>Sun, 14 Oct 2012 17:45:06 GMT</pubDate>
			<description><![CDATA[In July 2010 an enhancement to the YouTube video embed capability became available through a new embed code style. This style uses <iframe> and looks like this: 
<iframe src="http://www.youtube.com/embed/VIDEO_ID?" frameborder="0"></iframe> 
 
 
After VIDEO_ID? we can add the normal parameters,...]]></description>
			<content:encoded><![CDATA[<blockquote class="blogcontent restore">In July 2010 an enhancement to the YouTube video embed capability became available through a new embed code style. This style uses &lt;iframe&gt; and looks like this:<br />
<code style="background-color: #FFFFBB"><div style="margin-left:40px"><i>&lt;iframe src=&quot;http://www.youtube.com/embed/VIDEO_ID?&quot; frameborder=&quot;0&quot;&gt;&lt;/iframe&gt;</i></div></code><br />
<br />
After VIDEO_ID? we can add the normal parameters, like this:<br />
<code style="background-color: #FFFFBB"><i><div style="margin-left:40px">&lt;iframe src=&quot;http://www.youtube.com/embed/VIDEO_ID?start=0&amp;amp;autoplay=1&amp;amp;rel=0&amp;amp;showinfo=0&amp;amp;autohide=0&amp;amp;modestbranding=1&amp;amp;vq=large&quot; frameborder=&quot;0&quot;&gt;&lt;/iframe&gt;</div></i></code><br />
and also a new parameter that only works for the new embed code style:<br />
<div style="margin-left:40px"><i>&amp;amp;wmode=opaque</i> (or: <i>wmode=transparent</i>, or: <i>wmode=window</i>).</div><br />
If we put <i>wmode=opaque</i> or<i> wmode=transparent</i>, the iframe will be transparent, allowing us to put text on it (if we use the right zIndex). The iframe will not be transparent if we choose <i>wmode=window</i>.<br />
<br />
Now, putting text on a video makes only sense if we provide the text with some background (color) and font color, since the videos don't always have the same background / font color. Not using a background and a font color for the info we want to put on the video could then result in text being invisible.<br />
<br />
So we should use a background (color) and a font color for the text we put on the video. But then some part of the video gets hidden behind the text. That may provoke certain undesired results, like the top of a video being cut off.<br />
<br />
The conclusion is that, at least in certain cases, it seems better not to use the wmode parameter at all. There are other means for adding info to a video, like putting the video (vertically) under a div containing the video info and then wrapping the info div plus the iframe in another div, like this (just an example):<br />
<code style="background-color: #FFFFBB"><i><div style="margin-left:40px">&lt;div style=&quot;position: relative; top: 40px; margin: auto; width: <font color="#FF0000">600px</font>; height: <font color="#0000FF">283px</font>; overflow: <b>hidden</b>; &quot;&gt;<br />
&lt;div style=&quot;position:<b> relative</b>; text-align: center; <font color="#0000FF">height:60px; padding: 3px</font>; overflow: <b>auto</b>; background: <b>black</b>; color: <b>white</b>; font-family: verdana; font-size: 11px&quot;&gt;Text about video here&lt;br&gt;Text about video here&lt;br&gt;Text about video here&lt;br&gt;Text about video here&lt;/div&gt;<br />
&lt;iframe style=&quot;width:<font color="#FF0000"> 600px</font>; height: <font color="#0000FF">220px</font>&quot; src=&quot;http://www.youtube.com/embed/mv4cx3C3SZ4?start=0&amp;amp;autoplay=1&amp;amp;rel=0&amp;amp;showinfo=0&amp;amp;autohide=0&amp;amp;modestbranding=1&amp;amp;vq=large&quot; frameborder=&quot;0&quot; allowfullscreen&gt;&lt;/iframe&gt;<br />
&lt;/div&gt;</div></i></code><br />
(The (outermost) container div may have absolute or relative position; the container div must have 'overflow: hidden'; the height of the container divs equals the sum of the iframe's height and the height and padding for the info div; the div with the info must have relative position, 'overflow: auto', a background color and a font color; the container div and the iframe must have the same width; the iframe may have its own individual height).<br />
<br />
If we use <a href="http://www.dynamicdrive.com/forums/entry.php?47-Stretching-an-iframe-or-an-object-with-pixel-precision&amp;bt=281#comment281" target="_blank"><b><u>this method</u></b></a> for putting an iframe on our page, we would do something like this:<br />
<code style="background-color: #FFFFBB"><i><div style="margin-left:40px">&lt;div style=&quot;<b>position: absolute; left:100px; top: 100px; right: 100px; bottom: 100px</b>; &quot;&gt;<br />
&lt;div style=&quot;position: <b>relative</b>; text-align: center; <font color="#0000FF">height: 60px; padding: 3px</font>; overflow: <b>auto</b>; background: <b>black</b>; color: <b>white</b>; font-family: verdana; font-size: 11px&quot;&gt;Text about video here&lt;br&gt;Text about video here&lt;br&gt;Text about video here&lt;br&gt;Text about video here&lt;br&gt;Text about video here&lt;/div&gt;<br />
&lt;div style=&quot;<b>position: absolute; left:0px; top: <font color="#0000FF">63px</font>; right:0px; bottom: 0px</b>&quot;&gt;<br />
&lt;iframe style=&quot;<b>position: absolute; width: 100%; height: 100%</b>&quot; src=&quot;http://www.youtube.com/embed/mv4cx3C3SZ4?start=0&amp;amp;autoplay=1&amp;amp;rel=0&amp;amp;showinfo=0&amp;amp;autohide=0&amp;amp;modestbranding=1&amp;amp;vq=large&quot; frameborder=&quot;0&quot;&gt;&lt;/iframe&gt;<br />
&lt;/div&gt;<br />
&lt;/div&gt;</div></i><br />
</code><br />
where the height for the div (directly) containing the iframe equals the sum of the height and the padding for the text of the info div.<br />
<br />
Copy the examples above, paste them in a file and experiment with the result.<br />
<br />
Arie.</blockquote>

]]></content:encoded>
			<dc:creator>molendijk</dc:creator>
			<guid isPermaLink="true">http://www.dynamicdrive.com/forums/entry.php?266-Putting-text-on-top-of-a-video</guid>
		</item>
		<item>
			<title><![CDATA[[jQuery-append] includes HTML as well as JS]]></title>
			<link>http://www.dynamicdrive.com/forums/entry.php?263-jQuery-append-includes-HTML-as-well-as-JS</link>
			<pubDate>Mon, 20 Aug 2012 00:07:11 GMT</pubDate>
			<description>1. 
Create a string that is the JS-equivant of the DD Anylink standalone menu (http://www.dynamicdrive.com/dynamicindex1/dropmenuindex.htm) (or of any standalone menu) with the help of a good HTML-to-JS-converter. Make sure that all JS and CSS are made inline before conversion. Name the string...</description>
			<content:encoded><![CDATA[<blockquote class="blogcontent restore">1.<br />
Create a string that is the JS-equivant of the<a href="http://www.dynamicdrive.com/dynamicindex1/dropmenuindex.htm" target="_blank"> DD Anylink standalone menu</a> (or of any standalone menu) with the help of a good HTML-to-JS-converter. Make sure that all JS and CSS are made inline before conversion. Name the string <font color="#FF0000">included_js</font>.<br />
2.<br />
Create a script like this:<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code"style="height:60px;">&lt;script&gt;
var <font color="#FF0000">included_js</font> = STRING, where STRING represents the string you just created.
&lt;/script&gt;</pre>
</div>(in the Anylink-case, STRING representsw <a href="http://mesdomaines.nu/eendracht/include_jquery_style/this.txt" target="_blank">THIS</a>) and put the script in a HTML-file. Put it just after the body tag. <br />
<br />
3.<br />
Add another script (to the HTML-file), after the body tag (and after the preceding script) having this:<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code"style="height:60px;">&lt;script&gt;
$(&quot;body&quot;).append(<font color="#FF0000">included_js</font>)
&lt;/script&gt;</pre>
</div>Of course, the HTML-file should also have <br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code"style="height:36px;">&lt;script src=&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js&quot;&gt;&lt;/script&gt;</pre>
</div> at the top<br />
4.<br />
Open the file. You'll notice that the HTML-file shows a well functioning menu (Anylink, in our case). This shows that jQuery-append does not only bring in HTML, but also JS (and CSS).<br />
5.<br />
If you don't want the menu to show on page load, but on click, we should not have:<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code"style="height:60px;">&lt;script&gt;
$(&quot;body&quot;).append(<font color="#FF0000">included_js</font>)
&lt;/script&gt;</pre>
</div>but:<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code"style="height:60px;">&lt;script&gt;
$(&quot;body&quot;).append('&lt;div style=&quot;display: none&quot;&gt;'+<font color="#FF0000">included_js</font>+'&lt;\/div&gt;')
&lt;/script&gt;</pre>
</div>and then lines like:<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code"style="height:48px;">&lt;a href=&quot;javascript<b></b>: void(0)&quot; onclick=&quot;$('#jquery_include').empty(); $('#jquery_include').append(<font color="#FF0000">included_js</font>); return false&quot;&gt;append string&lt;/a&gt;
&lt;div id=&quot;jquery_include&quot; style=&quot;position: relative; width:500px;&quot;&gt;&lt;/div&gt;</pre>
</div>That's what I'have done in the <a href="http://mesdomaines.nu/eendracht/include_jquery_style/jquery_include.html" target="_blank">DEMO</a> page.<br />
5.<br />
The string can be 'emptied' by doing:<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code"style="height:36px;">&lt;a href=&quot;javascript<b></b>: void(0)&quot; onclick=&quot;$('#jquery_include').empty(); return false&quot;&gt;remove string&lt;/a&gt;</pre>
</div>6.<br />
What this show is that <i>jQuery-append</i> can be forced to act like some sort of asynchronous document.write. Of course, finding an elegant way of creating STRING (other than using a HTML-to_JS-converter and without spoiling things) is another matter.<br />
===<br />
Arie.</blockquote>

]]></content:encoded>
			<dc:creator>molendijk</dc:creator>
			<guid isPermaLink="true">http://www.dynamicdrive.com/forums/entry.php?263-jQuery-append-includes-HTML-as-well-as-JS</guid>
		</item>
		<item>
			<title>News from YouTube</title>
			<link>http://www.dynamicdrive.com/forums/entry.php?258-News-from-YouTube</link>
			<pubDate>Wed, 04 Jul 2012 22:04:56 GMT</pubDate>
			<description>I wanted to post the news some time ago, but I was afraid I was wrong. So I waited.  
It seems, however, to be the truth and nothing but the truth (for the time being): YouTube have removed their ads from all videos except the ones that have http://www.youtube.com/watch?v=ID. (And even there, the...</description>
			<content:encoded><![CDATA[<blockquote class="blogcontent restore">I wanted to post the news some time ago, but I was afraid I was wrong. So I waited. <br />
It seems, however, to be the truth and nothing but the truth (for the time being): <i>YouTube</i> have removed their ads from all videos except the ones that have <i><font color="Black">ht</font>tp://www.youtube.com/watch?v=<font color="Red">ID</font></i>. (And even there, the ads are gone when we use <i>IE</i> or <i>Firefox</i>).<br />
So now we can embed <i>YouTube</i> videos - in an iframe or flash object - without resorting to all kinds of malicious means to remove the ads (which does not mean that I am willing to remove the 'kill-the-ads-script' I created for my music sites: you never know, do you?).<br />
<i>YouTube</i> also introduced a new feature allowing us to chop videos. We already had <i>&amp;amp;start=...</i>, but now we can also add <i>&amp;amp;end=...</i> to the video-url.<br />
Here's a full list of features that can be used in a <i>YouTube</i>-url. Experiment with it, by replacing '1' with '0' or the other way 'round, by filling in a value for 'start' and 'end' (in seconds, for instance: end=200) and for vq (video quality: put <i>small, medium, large, hd720</i> or <i>highres</i>):<br />
<i>&amp;amp;rel=0&amp;amp;autoplay=1&amp;amp;showinfo=0&amp;amp;start=...&amp;amp;end=...&amp;amp;autohide=0&amp;amp;controls=1&amp;amp;modestbranding=1&amp;amp;vq=...</i><br />
<br />
DEMOS:  <br />
<a href="http://www.youtube.com/v/bKZbvluHcNo?version=3&amp;amp;rel=0&amp;amp;autoplay=1&amp;amp;showinfo=0&amp;amp;start=0&amp;amp;end=133&amp;amp;autohide=0&amp;amp;controls=1&amp;amp;modestbranding=1&amp;amp;vq=highres" target="_blank">http://www.youtube.com/v/bKZbvluHcNo...amp;vq=highres</a> (no ads, high video-quality; you can use this url in an embed)<br />
<br />
<a href="http://www.youtube.com/watch?v=bKZbvluHcNo" target="_blank">http://www.youtube.com/watch?v=bKZbvluHcNo</a> (ads with Google Chrome and Opera; low default video quality).<br />
===<br />
Arie Molendijk.</blockquote>

]]></content:encoded>
			<dc:creator>molendijk</dc:creator>
			<guid isPermaLink="true">http://www.dynamicdrive.com/forums/entry.php?258-News-from-YouTube</guid>
		</item>
		<item>
			<title>Force a page to open in a new tab</title>
			<link>http://www.dynamicdrive.com/forums/entry.php?256-Force-a-page-to-open-in-a-new-tab</link>
			<pubDate>Sun, 06 May 2012 21:55:48 GMT</pubDate>
			<description><![CDATA[There's an increasing number of sites that refuse to be opened in a new window. For instance, the following doesn't work (anymore): 
 
Code: 
--------- 
<a href="java_script: void(0)" onclick="window.open('http://google.com'">open Google in new (traditional) window</a> 
--------- 
In those cases,...]]></description>
			<content:encoded><![CDATA[<blockquote class="blogcontent restore">There's an increasing number of sites that refuse to be opened in a new window. For instance, the following doesn't work (anymore):<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code"style="height:36px;">&lt;a href=&quot;javascript<b></b>: void(0)&quot; onclick=&quot;window.open('http://google.com'&quot;&gt;open Google in new (traditional) window&lt;/a&gt;</pre>
</div>In those cases, you can use the following to open the sites in a new tab:<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code"style="height:36px;">&lt;a href=&quot;javascript<b></b>: void(0)&quot; onclick=&quot;window.open('','_new').location.href='http://google.com'&quot;&gt;open Google in new tab&lt;/a&gt;</pre>
</div>===<br />
Arie.</blockquote>

]]></content:encoded>
			<dc:creator>molendijk</dc:creator>
			<guid isPermaLink="true">http://www.dynamicdrive.com/forums/entry.php?256-Force-a-page-to-open-in-a-new-tab</guid>
		</item>
		<item>
			<title>Forcing YouTube to play videos in a specific quality</title>
			<link>http://www.dynamicdrive.com/forums/entry.php?253-Forcing-YouTube-to-play-videos-in-a-specific-quality</link>
			<pubDate>Thu, 08 Mar 2012 21:58:43 GMT</pubDate>
			<description><![CDATA[I was having troubles the other day loading a YouTube-video (using Firefox). The URL:  
http://www.youtube.com/v/W13GifsFFfk?version=3 
(this url may work on your machine, but it doesn't on mine (when I use Firefox)). 
 
My guess was that the problem was caused by the video's HD-quality. So I...]]></description>
			<content:encoded><![CDATA[<blockquote class="blogcontent restore">I was having troubles the other day loading a YouTube-video (using Firefox). The URL: <br />
<a href="http://www.youtube.com/v/W13GifsFFfk?version=3" target="_blank">http://www.youtube.com/v/W13GifsFFfk?version=3</a><br />
(this url may work on your machine, but it doesn't on mine (when I use Firefox)).<br />
<br />
My guess was that the problem was caused by the video's HD-quality. So I googled around to see how we can force YouTube to play videos in a specific quality. I found that we can do it by appending the following to the YouTube-url:<br />
<b>&amp;amp;vq=small</b>: 240p; bad quality, but buffer is the fastest; or:<br />
<b>&amp;amp;vq=medium</b>: 360p; acceptable quality, buffer is fast; or:<br />
<b>&amp;amp;vq=large</b>: 480p; high quality, buffer in a good speed; or:<br />
<b>&amp;amp;vq=hd720</b>: 720p; best quality, buffer slow but it's worthy IF IT WORKS).<br />
<br />
I added <b>&amp;amp;vq=large</b> to the URL (thus forcing the video to show in non-HD) and everything was fine.<br />
<br />
You may find this useful. (It may come in handy, for instance, if you want to load a video in a small iframe or flash object and yet produce a high quality video).<br />
===<br />
Arie Molendijk.</blockquote>

]]></content:encoded>
			<dc:creator>molendijk</dc:creator>
			<guid isPermaLink="true">http://www.dynamicdrive.com/forums/entry.php?253-Forcing-YouTube-to-play-videos-in-a-specific-quality</guid>
		</item>
		<item>
			<title>Replacing iframe attributes with javascript (HTML5)</title>
			<link>http://www.dynamicdrive.com/forums/entry.php?252-Replacing-iframe-attributes-with-javascript-(HTML5)</link>
			<pubDate>Wed, 11 Jan 2012 20:12:00 GMT</pubDate>
			<description><![CDATA[I was working the other day on a script for setting the height of an iframe to match the height of its content and noticed that under certain circumstances the iframe gets its scroll bars 'back' when it shouldn't. This happens mainly when the iframe is given a very small width. Overflow: hidden...]]></description>
			<content:encoded><![CDATA[<blockquote class="blogcontent restore">I was working the other day on a script for setting the height of an iframe to match the height of its content and noticed that under certain circumstances the iframe gets its scroll bars 'back' when it shouldn't. This happens mainly when the iframe is given a very small width. <i>Overflow: hidden</i> solves the problem in Firefox (most of the time), but not in IE. This browsers needs <i>scrolling=&quot;no&quot;</i>, which also works in non-IE. However, attributes like <i>scrolling=&quot;no&quot;</i> and <i>frameborder=&quot;no&quot;</i>, among others, are not valid in HTML5.<br />
Searching the Internet for a solution, I found this script by jscheuer1 (<a href="http://www.dynamicdrive.com/forums/showthread.php?t=60454&amp;page=2):" target="_blank">http://www.dynamicdrive.com/forums/s...60454&amp;page=2):</a><br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code"style="height:204px;">&lt;script defer&gt;
(function(run){
	var f1 = document.getElementsByTagName('iframe')[0];
	if(!f1 &amp;&amp; window.addEventListener &amp;&amp; !run){
		document.addEventListener('DOMContentLoaded', arguments.callee, false);
		return;
	}
	if(!f1){setTimeout(arguments.callee, 300); return;}
	f2 = f1.cloneNode(false);
	f1.src = 'about<b></b>:blank';
	f2.frameBorder = '0';
	f2.scrolling = 'no';
	f1.parentNode.replaceChild(f2, f1);
})();
&lt;/script&gt;</pre>
</div>If you put this on a page containing one iframe, the scroll bars and frameborder are gone in both IE and non-IE.<br />
But what about pages containing more than one iframe? I tested the following and observed that it works for all the iframes on a page:<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code"style="height:252px;">&lt;script defer&gt;
(function(run){
for (i=0;i&lt;frames.length; i++) {
	var f1 = document.getElementsByTagName('iframe')[i];
	if(!f1 &amp;&amp; window.addEventListener &amp;&amp; !run){
		document.addEventListener('DOMContentLoaded', arguments.callee, false);
		return;
	}
	if(!f1){setTimeout(arguments.callee, 300); return;}
	f2 = f1.cloneNode(false);
	f1.src = 'about<b></b>: blank';
	f2.frameBorder = '0';
	f2.allowTransparency = 'yes';
	f2.scrolling = 'yes';

	f1.parentNode.replaceChild(f2, f1);
}
})();
&lt;/script&gt;</pre>
</div>Many thanks to John Scheuer, who showed how to replace iframe attributes with javascript. <br />
Important: in HTML5, scripts having 'defer' must be external in order to validate.<br />
===<br />
Arie</blockquote>

]]></content:encoded>
			<dc:creator>molendijk</dc:creator>
			<guid isPermaLink="true">http://www.dynamicdrive.com/forums/entry.php?252-Replacing-iframe-attributes-with-javascript-(HTML5)</guid>
		</item>
		<item>
			<title>Select boxes having javascript in the options</title>
			<link>http://www.dynamicdrive.com/forums/entry.php?251-Select-boxes-having-javascript-in-the-options</link>
			<pubDate>Wed, 30 Nov 2011 23:28:33 GMT</pubDate>
			<description><![CDATA[In non-IE *except Google Chrome*, we can call functions from inside a select box by putting things like the following in the options: 
<option value="bla" onclick="some_function()"></option> 
<option value="bla" onclick="window.open('http://www.google.com')"></option> 
etc. 
 
This is not possible...]]></description>
			<content:encoded><![CDATA[<blockquote class="blogcontent restore">In non-IE <b>except Google Chrome</b>, we can call functions from inside a select box by putting things like the following in the options:<br />
&lt;option value=&quot;bla&quot; <font color="Red">onclick=&quot;some_function()&quot;</font>&gt;&lt;/option&gt;<br />
&lt;option value=&quot;bla&quot; <font color="Red">onclick=&quot;window.open('http://www.google.com')&quot;</font>&gt;&lt;/option&gt;<br />
etc.<br />
<br />
This is not possible in IE and Google Chrome. In an earlier attempt to solve the problem, I created a script based on the idea that it should be possible to let the text of the values for the options determine what function (whether custom or inbuilt) should be called (see <a href="http://www.dynamicdrive.com/forums/showthread.php?t=60905" target="_blank">this</a>). So I wanted things like the following to work:<br />
&lt;option <font color="Red">value=&quot;some_function()&quot;</font> &gt;&lt;/option&gt;<br />
&lt;option <font color="Red">value=&quot;window.open('http://www.google.com')&quot; </font>&gt;&lt;/option&gt;<br />
etc.<br />
<br />
Here's the script:<br />
&lt;script type=&quot;text/javascript&quot;&gt;<br />
//This script enables execution of scripts by putting them in the options of selectboxes (if the text of a given option corresponds with the contents of a given script, then the script is executed when the option is clicked on).<br />
function load_script_container()<br />
{var div_node=document.createElement('div');<br />
div_node.setAttribute(&quot;id&quot;, &quot;script_container&quot;);<br />
document.body.appendChild(div_node);}<br />
window.onload=load_script_container<br />
<br />
function <font color="Red">javascript_in_selectbox</font>(which_box) {<br />
var optionValue=document.getElementById(which_box).options[document.getElementById(which_box).selectedIndex].value;<br />
if (optionValue==&quot;none&quot;) {}<br />
else {<br />
var script_inside_selectbox_option = document.createElement('script');<br />
script_inside_selectbox_option.type = 'text/javascript';<br />
script_inside_selectbox_option.text = optionValue;<br />
while(document.getElementById(&quot;<font color="Red">script_container</font>&quot;).firstChild)<br />
{document.getElementById(&quot;<font color="Red">script_container</font>&quot;).removeChild(document.getElementById(&quot;<font color="Red">script_container</font>&quot;).firstChild);}<br />
document.getElementById(&quot;<font color="Red">script_container</font>&quot;).appendChild(script_inside_selectbox_option);<br />
}<br />
}<br />
&lt;/script&gt;<br />
<br />
It should work in cases like the following:<br />
&lt;select name=&quot;<font color="SeaGreen">some_selectbox</font>&quot; id=&quot;<font color="SeaGreen">some_selectbox</font>&quot; onchange=&quot;<font color="Red">javascript_in_selectbox</font>('<font color="SeaGreen">some_selectbox</font>'); selectedIndex=0&quot;&gt;<br />
&lt;option value=&quot;none&quot; selected &gt;Some selectbox&lt;/option&gt;<br />
&lt;option value=&quot;window.open('http://www.google.com')&quot; &gt;Load Google in new window&lt;/option&gt;<br />
&lt;option value=&quot;location.href='http://www.dynamicdrive.com'&quot; &gt;Go to DynamicDrive in same window&lt;/option&gt;<br />
&lt;option value=&quot;alert('This is an alert')&quot; &gt;An alert&lt;/option&gt;<br />
&lt;option value=&quot;document.body.style.background='white'&quot;&gt;Make background white&lt;/option&gt;<br />
&lt;option value=&quot;background_blue()&quot;&gt;Make background blue&lt;/option&gt;<br />
&lt;/select&gt;<br />
&lt;!-- (Of course, the value given to the last option implies the existence on the page of a function called 'background_blue()'). --&gt;<br />
<br />
Unfortunately, after a while I discovered that the last versions of certain modern browsers exhibit the following behavior <i>pertaining to loading new pages in the 'same window'</i>:<br />
<b>Opera</b>:<br />
Although <i>&lt;option value=&quot;location.href=...&quot;&gt;go to some page in same window&lt;/option&gt;</i> correctly executes the function given by the text of the value for the option, it makes the browser's history button do weird things.<br />
<b>Google Chrome</b>:<br />
<i>&lt;option value=&quot;location.href=...&quot;&gt;go to some page in same window&lt;/option&gt;</i> doesn't always execute, or the new page loads very slowly.<br />
<b>Firefox</b>:<br />
Although <i>&lt;option value=&quot;location.href=...&quot;&gt;go to some page in same window&lt;/option&gt;</i> correctly executes the function given by the text of the value for the option, it COMPLETELY DESTROYS the browser's history button. This is very strange, since this does not happen when <i>loction.href=...</i> is applied to other tags (other than the option-tag) like 'a', 'div' and 'span'.<br />
<br />
THE SOLUTION:<br />
I tried several second-versions of the original script. None of them worked. I then realized that, bearing in mind what has been explained above, the following should always work for cases in which we want to go to a new page in the same window:<br />
<i>&lt;option <b>value=&quot;if(!window.opera)location.href='...';&quot; onclick=&quot;location.href='...'&quot;</b>&gt;go to some page in same window&lt;/option&gt;</i><br />
And it does! So now we have a crossbrowser way to use the options of a selectbox to execute all sorts of functions, including those that open new pages in the 'same window'. <br />
<br />
DEMO <a href="http://mesdomaines.nu/selectbox_having_javascript_in_options_new/selectbox_having_javascript_in_options.html" target="_blank">here</a>.<br />
<br />
Arie Molendijk.</blockquote>

]]></content:encoded>
			<dc:creator>molendijk</dc:creator>
			<guid isPermaLink="true">http://www.dynamicdrive.com/forums/entry.php?251-Select-boxes-having-javascript-in-the-options</guid>
		</item>
		<item>
			<title>Deferred document.write</title>
			<link>http://www.dynamicdrive.com/forums/entry.php?250-Deferred-document-write</link>
			<pubDate>Mon, 31 Oct 2011 12:13:09 GMT</pubDate>
			<description>While surfing on the Internet I found this page (http://www.cryer.co.uk/resources/javascript/script8.htm) on how to pass data from one page to another. After a while, I realized that the script used on the page actually contains a technique (implicitly) for deferring document.write. Just for the...</description>
			<content:encoded><![CDATA[<blockquote class="blogcontent restore">While surfing on the Internet I found <a href="http://www.cryer.co.uk/resources/javascript/script8.htm" target="_blank">this page</a> on how to pass data from one page to another. After a while, I realized that the script used on the page actually contains a technique (implicitly) for deferring document.write. Just for the fun of it, I modified the script so as to have some easy ways of dynamically inserting internal and external content into a given div via document.write. Here it is:<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code"style="height:372px;">&lt;script type=&quot;text/javascript&quot;&gt;
function HttpRequest(url){
var pageRequest = false //variable to hold ajax object
/*@cc_on
@if (@_jscript_version &gt;= 5)
try {
pageRequest = new ActiveXObject(&quot;Msxml2.XMLHTTP&quot;)
}
catch (e){
try {
pageRequest = new ActiveXObject(&quot;Microsoft.XMLHTTP&quot;)
}
catch (e2){
pageRequest = false
}
}
@end
@*/

if (!pageRequest &amp;&amp; typeof XMLHttpRequest != 'undefined')
pageRequest = new XMLHttpRequest()

if (pageRequest){ //if pageRequest is not false
pageRequest.open('GET', url, false) //get page synchronously
pageRequest.send(null)

external_data=pageRequest.responseText
}
}

document.write('&lt;iframe name=&quot;ifr&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position: absolute; border:0px; width:0px; height:0px&quot;&gt;&lt;\/iframe&gt;')
function GetParam(name) //Thanks to http://www.cryer.co.uk/resources/javascript/script8.htm for this function
{
var start=location.search.indexOf(&quot;?&quot;+name+&quot;=&quot;);
if (start&lt;0) start=location.search.indexOf(&quot;&amp;&quot;+name+&quot;=&quot;);
if (start&lt;0) return '';
start += name.length+2;
var end=location.search.indexOf(&quot;&amp;&quot;,start)-1;
if (end&lt;0) end=location.search.length;
var result='';
for(var i=start;i&lt;=end;i++)
{
var c=location.search.charAt(i);
result=result+(c=='+'?' ':c);
}
return unescape(result);
}
var paramCount=1; var index=location.search.indexOf('@'); while (index&gt;0)
{
paramCount++;
index=location.search.indexOf('@',++index);
}
if (location.search!='')
{
function docwrite_to_div(which)
{
document.write(GetParam(which))
}
}
function include_using_iframe(where,what)
{
location.replace('?'+where+'='+escape(frames['ifr'].document.documentElement.innerHTML))
}
function include_not_using_iframe(where,what)
{
location.replace('?'+where+'='+escape(what))
}
function load_data(url)
{
frames['ifr'].location.replace(url)
}
&lt;/script&gt;</pre>
</div><b>Usage in non-IE</b>:<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code"style="height:156px;">&lt;!--Document.writing a string, for instance: some data, to a div having id=&quot;div1&quot;. The string must be surrounded by appropriate quotation marks. To verify that this really is document.write (not innerHTML), modify the string by putting some javascript in it. You'll see that the javascript works on the page.--&gt;
&lt;a href=&quot;javascript<b></b>: void(0)&quot; onclick=&quot;include_not_using_iframe('div1','some data')&quot;&gt;include inner data&lt;/a&gt;
&lt;div id=&quot;div1&quot; style=&quot;background: silver; width: 200px&quot;&gt;&lt;script type=&quot;text/javascript&quot;&gt;docwrite_to_div('div1')&lt;/script&gt;&lt;/div&gt;

&lt;!--Document.writing an external file, for instance: <a href="http://www.dynamicdrive.com/dynamicindex1/flexdropdown.htm" target="_blank">flexmenu.html</a> (a menu offered by DynamicDrive), to a div having id=&quot;div2&quot;. Inclusion is done via Ajax. The functions in the external file are automatically transferred to the main page during inclusion, which proves that this really is document.write (not innerHTML). The placeholder for the request-string is external_data, which must not be surrounded by quotation marks (of course). We can repeatedly click on the link to include the file without losing the exernal function(s). Or we can put the external file in different divs by repeating the lines below on the page while changing the id of the div. --&gt;
&lt;a href=&quot;javascript<b></b>: void(0)&quot; onmousedown=&quot;HttpRequest('flexmenu.html')&quot; onmouseup=&quot;include_not_using_iframe('div2', external_data)&quot;&gt;include via ajax&lt;/a&gt;
&lt;div id=&quot;div2&quot; style=&quot;background: silver; width: 200px&quot;&gt;&lt;script type=&quot;text/javascript&quot;&gt;docwrite_to_div('div2')&lt;/script&gt;&lt;/div&gt;

&lt;!--Document.writing an external file, for instance: <a href="http://www.dynamicdrive.com/dynamicindex1/flexdropdown.htm" target="_blank">flexmenu.html</a>, to a div having id=&quot;div3&quot;. Inclusion is done via a hidden iframe. The functions in the external file are automatically transferred to the main page during inclusion, which proves that this really is document.write (not innerHTML). We can repeatedly click on the link to include the file without losing the exernal function(s). Or we can put the external file in different divs by repeating the lines below on the page while changing the id of the div. --&gt;
&lt;a href=&quot;javascript<b></b>: void(0)&quot; onmousedown=&quot;load_data('flexmenu.html')&quot; onmouseup=&quot;include_using_iframe('div3')&quot;&gt;include via iframe&lt;/a&gt;
&lt;div id=&quot;div3&quot; style=&quot;background: yellow; width:400px&quot;&gt;&lt;script type=&quot;text/javascript&quot;&gt;docwrite_to_div('div3')&lt;/script&gt;&lt;/div&gt;</pre>
</div><b>Usage in IE / Google Chrome</b>:<br />
Same as above, but if we have scripts in the external page(s), IE will rewrite the pages to something we cannot use (safety measure). We can solve the problem in a cross-browser way by moving the scripts written down in the head of the external page(s) to the head of the main page. If the external page(s) also have scripts in the body, there may be a problem as to where to put them in the main page. Note also that, except for document.writing strings given in the main page itself, this will not (always) work locally (on your hard disk) when you're using IE or Google Chrome. But there's no problem on the Internet.<br />
<br />
<b>Address bar</b>:<br />
This method for including content may produce very long lines in the address bar.<br />
<br />
<b>Removing the data</b>:<br />
We can remove included data by doing something like:<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code"style="height:48px;">&lt;a href=&quot;javascript<b></b>: void(0)&quot; onclick=&quot;include_not_using_iframe('remove','')&quot;&gt;Remove data&lt;/a&gt;
&lt;div id=&quot;remove&quot; style=&quot;background: silver; width: 200px&quot;&gt;&lt;script type=&quot;text/javascript&quot;&gt;docwrite_to_div('remove')&lt;/script&gt;&lt;/div&gt;</pre>
</div><b>What do we actually update</b>?<br />
If we use the technique described on this page, we don't update parts of the page but the whole page, to which content is added via the scripts and HTML above. That probably explains why adding content to a div is a little bit slow (especially in IE). But the advantage of the technique is that any external file can be repearedly added to the page. That's not always the case if we use other methods for including content. The <a href="http://www.dynamicdrive.com/dynamicindex1/flexdropdown.htm" target="_blank">flexmenu</a>, for instance, cannot repeatedly be included on the page <b>with preservation of code</b>, or even included once via a simple onclick, unless we change the flexmenu-script in a specific way, see <a href="http://www.dynamicdrive.com/forums/showthread.php?t=55727&amp;page=3" target="_blank">this thread</a>. <br />
===<br />
<font color="Red">DEMO <a href="http://mesdomaines.nu//include_deferred_document_write/include_deferred_document_write.html" target="_blank">here</a>.</font><br />
<br />
<font color="Red"><b>EDIT:<br />
W'd better replace the occurrences of <i>href=...</i> above with something like <i>style=&quot;cursor: pointer; text-decoration: underline&quot;</i> because using href mistakenly creates a new page in Firefox if used online. </b></font><br />
===<br />
Arie Molendijk</blockquote>

]]></content:encoded>
			<dc:creator>molendijk</dc:creator>
			<guid isPermaLink="true">http://www.dynamicdrive.com/forums/entry.php?250-Deferred-document-write</guid>
		</item>
		<item>
			<title>A better Iframe Shim</title>
			<link>http://www.dynamicdrive.com/forums/entry.php?249-A-better-Iframe-Shim</link>
			<pubDate>Sun, 02 Oct 2011 22:47:32 GMT</pubDate>
			<description><![CDATA[The 'iframe shim technique' lets us overlay a div over windowed elements such as flash objects, select boxes and applets. The trick is to have the div accompanied by an iframe that must have exactly the same size and position as the div, whose z-index must be higher than the iframe's z-index. The...]]></description>
			<content:encoded><![CDATA[<blockquote class="blogcontent restore">The 'iframe shim technique' lets us overlay a div over windowed elements such as flash objects, select boxes and applets. The trick is to have the div accompanied by an iframe that must have exactly the same size and position as the div, whose z-index must be higher than the iframe's z-index. The windowed element itself must have a lower z-index and <b>the iframe should have a background-color</b>. Here's an example of how to have a div overlay a flash object:<br />
<br />
<code style="background-color: #FFFFBB">&lt;iframe style=&quot;position: absolute; left: 40px; top:50px; width:100px; height:40px;z-index:2; background: white&quot;&gt;&lt;/iframe&gt;<br />
&lt;div style=&quot;position: absolute; left: 40px; top:50px; width:100px; height:40px;color:red;z-index:3;&quot;&gt;iframe shim&lt;/div&gt;<br />
&lt;object style=&quot;position: absolute; left: 10px; top:40px; width: 400px; height: 400px; z-index:1&quot; type=&quot;application/x-shockwave-flash&quot; data=&quot;http://www.youtube.com/v/jUvcyyU7UB4?version=3&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/jUvcyyU7UB4?version=3&quot;&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;&gt;&lt;param name=&quot;wmode&quot; value=&quot;window&quot;&gt;&lt;param name=&quot;flashvars&quot; value=&quot;autoplay=1&quot;&gt;&lt;param name=&quot;allowNetworking&quot; value=&quot;internal&quot;&gt;&lt;/object&gt;</code><br />
<br />
This is fairly common knowledge (except for the iframe's background-color, so it seems). What many people don't realize is that the trick doesn't work anymore in IE after we click on the flash object playing a video (and it may fail in other cases too). After the click, the div is gone. Try for yourself (in IE).<br />
<br />
There's an easy way to solve the problem. We put the following dummy div in the body:<br />
<code style="background-color: #FFFFBB">&lt;div id=&quot;dummy&quot; style=&quot;position:absolute; &quot; onblur=&quot;if (/*@cc_on!@*/false){this.style.top='-1px'};&quot; onfocus=&quot;if (/*@cc_on!@*/false){this.style.top='-2px'};&quot;&gt;&lt;/div&gt;</code><br />
<br />
and the body tag should look like this:<br />
<code style="background-color: #FFFFBB">&lt;body onmousemove=&quot;if(/*@cc_on!@*/false){document.getElementById('dummy').focus()}&quot; onload=&quot;if (/*@cc_on!@*/false){document.getElementById('dummy').focus()}&quot;&gt;</code><br />
<br />
Try it in any browser you want: it seems to work everywhere. <br />
===<br />
Arie Molendijk.</blockquote>

]]></content:encoded>
			<dc:creator>molendijk</dc:creator>
			<guid isPermaLink="true">http://www.dynamicdrive.com/forums/entry.php?249-A-better-Iframe-Shim</guid>
		</item>
		<item>
			<title>Broadcast your YouTube-playlists</title>
			<link>http://www.dynamicdrive.com/forums/entry.php?246-Broadcast-your-YouTube-playlists</link>
			<pubDate>Tue, 19 Jul 2011 19:49:15 GMT</pubDate>
			<description><![CDATA[People using YouTube-playlists do so on their YouTube-channels, most of the time. But we don't need YouTube to broadcast our YouTube-playlists. We only need YouTube to create them and to determine our playlist-number(s). If you want to broadcast your playlists outside any channel, do the following....]]></description>
			<content:encoded><![CDATA[<blockquote class="blogcontent restore">People using YouTube-playlists do so on their YouTube-channels, most of the time. But we don't need YouTube to broadcast our YouTube-playlists. We only need YouTube to create them and to determine our playlist-number(s). If you want to broadcast your playlists outside any channel, do the following.<br />
<br />
Go to <a href="http://www.youtube.com/my_videos" target="_blank">http://www.youtube.com/my_videos</a>. (You have to create a YouTube account if you are 'new').<br />
Create a playlist and add videos to it by clicking on 'add videos', or simply add new videos to an already existing playlist.<br />
There's a link on your page that allows you to manage all your playlists. Click on it.<br />
This will show your playlist(s) together with an option to edit it / them. Click on the edit button of a given playlist.<br />
Click on the 'Share' button (of the playlist) that shows up. This yiels the URL of the playlist. At the end of the URL you have 'list=some number', where some number is something like <font color="Red">PL19C52D08D0EF69FC</font>.<br />
Using this listnumber, you can play all the videos attached to it by using a (new) URL like:<br />
<code style="background-color: #FFFFBB"><i><a href="http://www.youtube.com/embed/" target="_blank">http://www.youtube.com/embed/</a><font color="Red">EYfd7HipW-Q</font>?list=<font color="Red">PL19C52D08D0EF69FC</font>&amp;amp;start=0&amp;amp;autoplay=1&amp;amp;rel=0&amp;amp;showinfo=0&amp;amp;autohide=0</i></code><br />
where <font color="Red">EYfd7HipW-Q</font> is the ID of the first video of the playlist having <font color="Red">PL19C52D08D0EF69FC</font>.<br />
You can put the (new) URL in the address-bar, you can use it as the src of an iframe, etc.<br />
Using it in an iframe would yield something like: <br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code"style="height:36px;">&lt;iframe style=&quot;width:400px; height: 400px&quot; src=&quot;http://www.youtube.com/embed/EYfd7HipW-Q?list=PL19C52D08D0EF69FC&amp;amp;start=0&amp;amp;autoplay=1&amp;amp;rel=0&amp;amp;showinfo=0&amp;amp;autohide=0&quot;&gt;&lt;/iframe&gt;</pre>
</div>Of course you can use well-known methods for changing the URL of an iframe to dynamically produce any number of playlists you want. I made a quick example <a href="http://molendijk.freei.me/include_video_yt_no_flicker_playlists/playlist.html" target="_blank">HERE</a>.<br />
===<br />
Arie.</blockquote>

]]></content:encoded>
			<dc:creator>molendijk</dc:creator>
			<guid isPermaLink="true">http://www.dynamicdrive.com/forums/entry.php?246-Broadcast-your-YouTube-playlists</guid>
		</item>
		<item>
			<title>A Strange Menu-Include</title>
			<link>http://www.dynamicdrive.com/forums/entry.php?244-A-Strange-Menu-Include</link>
			<pubDate>Tue, 24 May 2011 21:16:41 GMT</pubDate>
			<description>I was playing around with some code recently and discovered - more or less by accident - that we can include any fully functioning standalone menu by doing the following. The scripts and styles belonging to the external file will be preserved after inclusion: 
1. We put this script just before the...</description>
			<content:encoded><![CDATA[<blockquote class="blogcontent restore">I was playing around with some code recently and discovered - more or less by accident - that we can include any fully functioning standalone menu by doing the following. The scripts and styles belonging to the external file will be preserved after inclusion:<br />
1. We put this script just before the closing body-tag of the external file: <br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code"style="height:60px;">&lt;script type=&quot;text/javascript&quot;&gt;
try{top.document.getElementById('container_div').innerHTML=document.documentElement.innerHTML}
catch(err){top.document.getElementById('container_div').appendChild(document.documentElement)} &lt;/script&gt;</pre>
</div>2. We remove the scripts and styles belonging to the head of the external file and put them in the head of the document in which we want to include the file.<br />
3. We put the following in the head of the (main) document, <font color="Red">above the scripts and styles that we already put there (see 2 above)</font>: <br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code"style="height:84px;">&lt;script type=&quot;text/javascript&quot;&gt;
//Writing an iframe that loads the external file, and a div in which it will be put by the lines given in 1 above. Using DOM methods for creating the iframe and the div, or putting the iframe / div right away in the body, don't work: we need document.write for this particular case. <font color="Red">This script must be on top of all other codes.</font> The iframe is invisible. The styles for the div are just examples
document.write('&lt;iframe src=&quot;name_of_external_menu.html&quot; name=&quot;ifr&quot; style=&quot;position:absolute;left:-10000px&quot;&gt;&lt;\/iframe&gt;')
document.write('&lt;div id=&quot;container_div&quot; style=&quot;position:absolute;top:270px;bottom:250px;border:2px inset silver&quot;&gt;&lt;\/div&gt;')
&lt;/script&gt;</pre>
</div>Very strange. DEMO <a href="http://molendijk.freei.me/include_menu19/includer.html" target="_blank">here</a>.<br />
===<br />
Arie Molendijk.</blockquote>

]]></content:encoded>
			<dc:creator>molendijk</dc:creator>
			<guid isPermaLink="true">http://www.dynamicdrive.com/forums/entry.php?244-A-Strange-Menu-Include</guid>
		</item>
		<item>
			<title>The YouTube version3 player</title>
			<link>http://www.dynamicdrive.com/forums/entry.php?49-The-YouTube-version3-player</link>
			<pubDate>Mon, 29 Nov 2010 14:51:51 GMT</pubDate>
			<description><![CDATA[The player used on http://www.youtube.com/watch?v=VIDEO_ID is YouTube's version3 player. If you want to use it directly (without the watch?v= part) you can do, for instance: http://www.youtube.com/v/EUSsXdhxFIM?version=3. (You may have to press CTRL if you want this to work in IE). 
 
The advantage...]]></description>
			<content:encoded><![CDATA[<blockquote class="blogcontent restore">The player used on <i><a href="http://www.youtube.com/watch?v=VIDEO_ID" target="_blank">http://www.youtube.com/watch?v=VIDEO_ID</a></i> is YouTube's version3 player. If you want to use it directly (without the <i>watch?v= part</i>) you can do, for instance: <i><a href="http://www.youtube.com/v/EUSsXdhxFIM?version=3" target="_blank">http://www.youtube.com/v/EUSsXdhxFIM?version=3</a></i>. (You may have to press CTRL if you want this to work in IE).<br />
<br />
The advantage of the version3-player over other versions is that a click on a playing video doesn't open a new YouTube window containing all sorts of information that you may not be interested in. The click event just pauses the video.<br />
<br />
You can include a version3-video with something like:<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code"style="height:96px;">&lt;object type=&quot;application/x-shockwave-flash&quot; style=&quot;position:absolute; left:20%; top:20%; height:60%; width:60%; border:1px solid black;&quot; data=&quot;http://www.youtube.com/v/EUSsXdhxFIM?version=3&amp;amp;rel=0&amp;amp;autoplay=1&amp;amp;showinfo=0&amp;amp;start=5&quot; &gt;
&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/EUSsXdhxFIM?version=3&amp;amp;rel=0&amp;amp;autoplay=1&amp;amp;showinfo=0&amp;amp;start=5&quot; &gt;
&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot; &gt;
&lt;param name=&quot;wmode&quot; value=&quot;transparent&quot; &gt;
&lt;param name=&quot;flashvars&quot; value=&quot;autoplay=true&quot; &gt;
&lt;/object&gt;</pre>
</div>As soon as I understood this, I decided to write a script allowing us to load videos (that use the version3 player) with the help of a javascript function.<br />
Demos and explanations <a href="http://www.let.rug.nl/molendyk/include_video_youtube_version3/include_video_youtube_version3.html" target="_blank">HERE</a>.<br />
===<br />
Arie.</blockquote>

]]></content:encoded>
			<dc:creator>molendijk</dc:creator>
			<guid isPermaLink="true">http://www.dynamicdrive.com/forums/entry.php?49-The-YouTube-version3-player</guid>
		</item>
	</channel>
</rss>
