<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Ask me Questions and get Answers ! &#187; CSS</title>
	<atom:link href="http://askmetoo.com/category/internet/web-development/css/feed" rel="self" type="application/rss+xml" />
	<link>http://askmetoo.com</link>
	<description>Ask Questions and get Answers About everything for free!</description>
	<lastBuildDate>Wed, 07 Jul 2010 15:41:05 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>How to test JavaScript in CSS?</title>
		<link>http://askmetoo.com/how-to-test-javascript-in-css.htm</link>
		<comments>http://askmetoo.com/how-to-test-javascript-in-css.htm#comments</comments>
		<pubDate>Sun, 20 Jan 2008 21:03:17 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://askmetoo.com/2008/01/20/how-to-test-javascript-in-css/</guid>
		<description><![CDATA[When Explorer and Opera parsing the CSS file,  encounter the JavaScript and execute it. Browsers execute it only once, though, so if you&#8217;d repeat the background-image: etc for another class or id, you still see one alert only.
So Lets Try this:

1
2
3
4
#Example &#123;
border: 1px solid #000000;
padding: 10px;
background-image: url&#40;'javascript:alert(\'It works\');'&#41;

or

1
background-image: url&#40;'javascript:alert('It works');'&#41;

]]></description>
			<content:encoded><![CDATA[<p>When Explorer and Opera parsing the CSS file,  encounter the JavaScript and execute it. Browsers execute it only once, though, so if you&#8217;d repeat the background-image: etc for another class or id, you still see one alert only.</p>
<p>So Lets Try this:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#Example</span> <span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#000000</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">background-image</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">'javascript:alert(<span style="color: #000099; font-weight: bold;">\'</span>It works<span style="color: #000099; font-weight: bold;">\'</span>);'</span><span style="color: #00AA00;">&#41;</span></pre></td></tr></table></div>

<p><code>or</code></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">background-image</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">'javascript:alert('</span>It works<span style="color: #ff0000;">');'</span><span style="color: #00AA00;">&#41;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://askmetoo.com/how-to-test-javascript-in-css.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
