<?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>NewSourceMedia Blog &#187; JS Tutorials Beginner</title>
	<atom:link href="http://newsourcemedia.com/blog/category/javascripts/js-tutorials-beginner/feed/" rel="self" type="application/rss+xml" />
	<link>http://newsourcemedia.com/blog</link>
	<description>Focused on Interactive Design, Development and Marketing</description>
	<lastBuildDate>Fri, 30 Dec 2011 04:30:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Alert Boxes</title>
		<link>http://newsourcemedia.com/blog/alert-boxes/</link>
		<comments>http://newsourcemedia.com/blog/alert-boxes/#comments</comments>
		<pubDate>Mon, 29 Mar 2004 00:22:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[JS Tutorials Beginner]]></category>
		<category><![CDATA[alert boxes]]></category>
		<category><![CDATA[auto-fill]]></category>
		<category><![CDATA[autofill]]></category>
		<category><![CDATA[form]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://newsourcemedia.com/blog/2004/03/28/alert-boxes/</guid>
		<description><![CDATA[Alert boxes are small popup boxes that are triggered by user events. Here are a few good examples on how to alert your users. Alert boxes could be used to help users find mistakes, warn them of hazards, or to &#8230; <a href="http://newsourcemedia.com/blog/alert-boxes/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[Alert boxes are small popup boxes that are triggered by user events. Here are a few good examples on how to alert your users.
<span id="more-212"></span>

Alert boxes could be used to help users find mistakes, warn                        them of hazards, or to display a status of events.
<p class="contitle">1) View Alert Box</p>

<a onclick="alert('This is an alert')" href="../../Admin/updatewp#">Click here                        to see an alert!</a>

Here is the source code:
<p class="sourceCODE">&lt;a href="#" onclick="alert('This                        is an alert')"&gt;Click here to see an alert!&lt;/a&gt;</p>

You could also use the <span class="sourceCODE">onclick="alert("bla                        bla")"</span> or the <span class="sourceCODE">onChange="alert("bla                        bla")"</span> inside form elements like buttons                        and pulldown menus.
<p class="contitle">2) Other Options:</p>

You can also alert users before they enter your site by                        placing the "<span class="sourceCODE">alert</span>"                        inside the body tag like so:
<p class="sourceCODE">&lt;body onload="alert('Warning:                        this site is crazy.')"&gt;</p>
<p class="contitle">3) Confirm: Yes or Cancel Alert:</p>

JavaScript provides a function called confirm. This generates                        an alert box with two buttons, asking "Yes" or                        "Cancel". To create this alert we define our own                        function in the head of a document:

[Start of Code]

<span class="sourceCODE">&lt;script language="javascript"                        type="text/javascript"&gt;
&lt;!--
function alertURL(url) {
if(confirm("Are you sure you want to click this link"))
{
location=url
}
}
//--&gt;
&lt;/script&gt;</span>
<p class="sourceHTML">&lt;!-- The new function "<span class="sourceCODE">alertURL()</span>"                        is called once the link (below) is clicked. Notice that                        the url address below is located inside the brackets. This                        is then passed to our function and handled by the javascript                        "<span class="sourceCODE">location</span>" statement                        if the user clicks yes: --&gt;</p>
<p class="sourceCODE">&lt;a href="#" onClick="alertURL('fake_page.html')"&gt;Click                        Here!&lt;/a&gt;</p>

[End of Code]

This could be used to persuade users to stay on the page                        they are visiting. Or if the link was directed to a server                        side program that would execute code that was unchangeable                        (ex: delete a file or update data), this would be a safe                        guard.
<p class="contitle">4) Confirm: Form Submissions Yes or No                        Alert</p>

You can also use it on a form submission. This is easy.                        Just add the following code to your "form" tab:

[Code]
<p class="sourceCODE">&lt;form action="" method="get"                        <span style="color: #ff6600;">onsubmit="return confirm('Are                        you sure?')"</span>&gt;</p>

[End of Code]]]></content:encoded>
			<wfw:commentRss>http://newsourcemedia.com/blog/alert-boxes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Add to Favorites</title>
		<link>http://newsourcemedia.com/blog/add-to-favorites/</link>
		<comments>http://newsourcemedia.com/blog/add-to-favorites/#comments</comments>
		<pubDate>Wed, 24 Dec 2003 00:22:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Javascripts]]></category>
		<category><![CDATA[JS Tutorials Beginner]]></category>
		<category><![CDATA[add to favorites]]></category>
		<category><![CDATA[add-on]]></category>
		<category><![CDATA[addon]]></category>
		<category><![CDATA[Dreamweaver]]></category>
		<category><![CDATA[extensions]]></category>
		<category><![CDATA[favorites]]></category>
		<category><![CDATA[your page]]></category>

		<guid isPermaLink="false">http://newsourcemedia.com/blog/2003/12/23/add-to-favorites/</guid>
		<description><![CDATA[Add a button or link in the page that prompts visitors to add your page to their favorites. Add a button or link in the page that prompts visitors to add your page to their favorites. If they confirm, your &#8230; <a href="http://newsourcemedia.com/blog/add-to-favorites/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[Add a button or link in the page that prompts visitors to add your page to their favorites.  <span id="more-218"></span> Add a button or link in the page that prompts visitors to add your page to their favorites. If they confirm, your page is automatically added to their Favorites For the time being, this works only on Internet Explorer and will be ignored by Netscape. So there is no harm.
<pre lang="javascript">
<html>
<head>
<script language="JavaScript">
    function AddFav() {
        window.external.AddFavorite('http://www.newsourcemedia.com');
    }
</script></head>
<body>
<button onclick="AddFav();">
Click here to add www.newsourcemedia.com main page to your favorites
</button>
</body>
</html>
</pre>]]></content:encoded>
			<wfw:commentRss>http://newsourcemedia.com/blog/add-to-favorites/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->
