<?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; Javascripts</title>
	<atom:link href="http://newsourcemedia.com/blog/category/javascripts/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>Javascript Enabled Warning Message</title>
		<link>http://newsourcemedia.com/blog/javascript-enabled-warning-message/</link>
		<comments>http://newsourcemedia.com/blog/javascript-enabled-warning-message/#comments</comments>
		<pubDate>Tue, 30 Nov 1999 06:00:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Browser Information]]></category>
		<category><![CDATA[block]]></category>
		<category><![CDATA[desabled]]></category>
		<category><![CDATA[enabled]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[message]]></category>
		<category><![CDATA[nonscript]]></category>
		<category><![CDATA[redirect]]></category>
		<category><![CDATA[warning]]></category>

		<guid isPermaLink="false">http://newsourcemedia.com/blog/1969/12/31/javascript-enabled-warning-message/</guid>
		<description><![CDATA[How to detect if a browser's javascript is enabled or disabled and display a message. If javascript is not enabled on your visitor's browser, here is a tip on how to warn them to turn it on or to use &#8230; <a href="http://newsourcemedia.com/blog/javascript-enabled-warning-message/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[How to detect if a browser's javascript is enabled or disabled and display a message.
<span id="more-167"></span>

If javascript is not enabled on your visitor's browser, here is a tip on how   to warn them to turn it on or to use the latest browsers.

Place your warning message between the tags &lt;NOSCRIPT&gt; and &lt;/NOSCRIPT&gt;.   Here is an example:

<code>&lt;NOSCRIPT&gt;
&lt;font color=red&gt;
&lt;H3&gt;This page uses JavaScript&lt;/H3&gt;
&lt;ul&gt;
&lt;li&gt;Please use Netscape Navigator 3  or Internet Explorer 3
&lt;li&gt;Make sure that JavaScript is enabled in your browser.
&lt;/ul&gt;
&lt;/font&gt;
&lt;/NOSCRIPT&gt;</code>

JavaScript enabled web browsers will ignore all of the text between &lt;NOSCRIPT&gt; ...and..&lt;/NOSCRIPT&gt;.   Browsers that can't execute JavaScript will display your warning message in   the location that you have placed the nonscrip message.]]></content:encoded>
			<wfw:commentRss>http://newsourcemedia.com/blog/javascript-enabled-warning-message/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Javascript Non Alphanumeric Characters Regex</title>
		<link>http://newsourcemedia.com/blog/javascript-non-alphanumeric-characters-regex/</link>
		<comments>http://newsourcemedia.com/blog/javascript-non-alphanumeric-characters-regex/#comments</comments>
		<pubDate>Fri, 29 Dec 2006 00:22:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Javascripts]]></category>
		<category><![CDATA[JS Forms]]></category>
		<category><![CDATA[alph]]></category>
		<category><![CDATA[alpha]]></category>
		<category><![CDATA[alphabetic]]></category>
		<category><![CDATA[alphanumeric]]></category>
		<category><![CDATA[alphnumeric]]></category>
		<category><![CDATA[and]]></category>
		<category><![CDATA[hyper]]></category>
		<category><![CDATA[hypertext]]></category>
		<category><![CDATA[javascript examples]]></category>
		<category><![CDATA[js]]></category>
		<category><![CDATA[language]]></category>
		<category><![CDATA[letters]]></category>
		<category><![CDATA[markup]]></category>
		<category><![CDATA[numbers]]></category>
		<category><![CDATA[numeral]]></category>
		<category><![CDATA[numeric]]></category>
		<category><![CDATA[only]]></category>
		<category><![CDATA[text]]></category>

		<guid isPermaLink="false">http://newsourcemedia.com/blog/2006/12/28/javascript-non-alphanumeric-characters-regex/</guid>
		<description><![CDATA[Using javascript regular expressions to stop users from entering non-aphanumeric characters or white spaces Say you want to stop users from entering non-aphanumeric characters or white spaces. Using regular expressions would be the easiest method: Here is my javascript code: &#8230; <a href="http://newsourcemedia.com/blog/javascript-non-alphanumeric-characters-regex/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[Using javascript regular expressions to stop users from entering non-aphanumeric characters or white spaces
<span id="more-175"></span>

Say you want to stop users from entering non-aphanumeric characters or white   spaces.

Using regular expressions would be the easiest method:

Here is my javascript code:

<code>&lt;script language="Javascript"&gt;
function alphaNumericCheck(){
var regex=/^[0-9A-Za-z]+$/; //^[a-zA-z]+$/
if(regex.test(document.add_data.password.value)){
alert("Good")
return true;
} else {
alert("Please fix: password")
return false;
}
}
&lt;/script&gt; </code>
For numbers only use /^[0-9]+$/

For mixed text and numbers, with spaces /^[0-9a-zA-Zs]+$/

Here are more useful regular expressions:

<code>[a-zA-Z] any letter
d any number; same as [0-9]
D any NOT number; same as [^0-9]
w any alphanumeric character; same as [a-zA-Z-0-9_]
W any NON-alphanumeric character; same as [^a-zA-Z0-9_]
s any whitespace (tab, space, newline, etc...)
S any NON-whitespace
n newline
t tab</code>

To view a full html sample of the above code click the links below using regular   expressions in JavaScript]]></content:encoded>
			<wfw:commentRss>http://newsourcemedia.com/blog/javascript-non-alphanumeric-characters-regex/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Javascript Email Validation Form</title>
		<link>http://newsourcemedia.com/blog/javascript-email-validation-form/</link>
		<comments>http://newsourcemedia.com/blog/javascript-email-validation-form/#comments</comments>
		<pubDate>Fri, 29 Dec 2006 00:22:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Javascripts]]></category>
		<category><![CDATA[JS Forms]]></category>
		<category><![CDATA[address]]></category>
		<category><![CDATA[check]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[form]]></category>
		<category><![CDATA[ie]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jscript]]></category>
		<category><![CDATA[save.]]></category>
		<category><![CDATA[using]]></category>
		<category><![CDATA[validation]]></category>

		<guid isPermaLink="false">http://newsourcemedia.com/blog/2006/12/28/javascript-email-validation-form/</guid>
		<description><![CDATA[Check user email address forms to make sure they are valid using JavaScript before saving their info. The JavaScript code is provided here. The function below checks if the content has the general syntax of an email. This means that &#8230; <a href="http://newsourcemedia.com/blog/javascript-email-validation-form/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[Check user email address forms to make sure they are valid using JavaScript before saving their info. The JavaScript code is provided here.
<span id="more-177"></span>

The function below checks if the content has the general syntax of an email.

This means that the input data must contain at least an @ sign and a dot (.). Also, the @ must not be the first character of the email address, and the last dot must at least be one character after the @ sign:

<pre lang="javascript"><script language="Javascript">
function checksubmit()
{
apos=document.add_data.email.value.indexOf("@")
dotpos=document.add_data.email.value.lastIndexOf(".")
if (document.add_data.email.value == "" || apos<1 || dotpos-apos<2)
{
alert("Please fix: email")
document.add_data.email.focus()
return false
}
return true
}
</script> </pre>]]></content:encoded>
			<wfw:commentRss>http://newsourcemedia.com/blog/javascript-email-validation-form/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Javascript Go Back to Previous Page Button Link</title>
		<link>http://newsourcemedia.com/blog/javascript-go-back-to-previous-page-button-link/</link>
		<comments>http://newsourcemedia.com/blog/javascript-go-back-to-previous-page-button-link/#comments</comments>
		<pubDate>Fri, 29 Dec 2006 00:22:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Navagation]]></category>
		<category><![CDATA[back]]></category>
		<category><![CDATA[button]]></category>
		<category><![CDATA[go]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[link]]></category>
		<category><![CDATA[page]]></category>
		<category><![CDATA[previous]]></category>
		<category><![CDATA[to]]></category>

		<guid isPermaLink="false">http://newsourcemedia.com/blog/2006/12/28/javascript-go-back-to-previous-page-button-link/</guid>
		<description><![CDATA[Go Back javascript history button links to allow visitors to go back to previous page. Here the free javascript code. Want to add a back button navigation to your web page links. Here is how to do this using javascript &#8230; <a href="http://newsourcemedia.com/blog/javascript-go-back-to-previous-page-button-link/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[Go Back javascript history button links to allow visitors to go back to previous page. Here the free javascript code.
<span id="more-176"></span>
Want to add a back button navigation to your web page links. Here is how to   do this using javascript and html links.

The code we'll use look a bit like this: "javascript:history.go(-1)" .

With that code we are telling the browser to go back -1 page. You can change   the -1 number to any page history like -2 or -5. So if you choose go back -3,   you will send the visitor three pages back in their browser history.

Here's the source code:

<pre lang="html"><a href="javascript:history.go(-1)">Go Back One Page </a></pre>

Click here to try the code: <a href="javascript:history.go(-1)">Go back one page</a>]]></content:encoded>
			<wfw:commentRss>http://newsourcemedia.com/blog/javascript-go-back-to-previous-page-button-link/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Javascript Center Popup Window</title>
		<link>http://newsourcemedia.com/blog/center-popup-window/</link>
		<comments>http://newsourcemedia.com/blog/center-popup-window/#comments</comments>
		<pubDate>Sun, 25 Jul 2004 00:22:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Browser Window]]></category>
		<category><![CDATA[javascript pop up window generator]]></category>
		<category><![CDATA[pop up window]]></category>
		<category><![CDATA[pop up windows]]></category>
		<category><![CDATA[popup window]]></category>

		<guid isPermaLink="false">http://newsourcemedia.com/blog/2004/07/24/center-popup-window/</guid>
		<description><![CDATA[How to center a chromeless pop-up window in most browsers. Now create a link with a hash in the href attribute and add the javascript call on a onClick command. Popup Be sure to change the url "freepennysaver.com" to your &#8230; <a href="http://newsourcemedia.com/blog/center-popup-window/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[How to center a chromeless pop-up window in most browsers.
<span id="more-188"></span>
<pre lang="html">
<script language="javascript" type="text/javascript">
var win= null;
function OpenNewWindow(mypage,w,h,myname){
var winl = (screen.width-w)/2;
var wint = (screen.height-h)/2;
settings='height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars=no,toolbar=no'
win=window.open(mypage,myname,settings)
if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
}
// end script here -->
</script>
</pre>

Now create a link with a hash in the href attribute and add the javascript call on a onClick command.
<pre lang="html">
<a href="#" onclick="OpenNewWindow('http://freepennysaver.com/','710','548','Loading');" > Popup </a></pre>


Be sure to change the url "freepennysaver.com" to your url.]]></content:encoded>
			<wfw:commentRss>http://newsourcemedia.com/blog/center-popup-window/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Popup Chromeless Window</title>
		<link>http://newsourcemedia.com/blog/popup-chromeless-window/</link>
		<comments>http://newsourcemedia.com/blog/popup-chromeless-window/#comments</comments>
		<pubDate>Wed, 26 May 2004 00:22:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Browser Window]]></category>
		<category><![CDATA[Javascripts]]></category>
		<category><![CDATA[chromeless]]></category>
		<category><![CDATA[easy]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[popup]]></category>
		<category><![CDATA[window]]></category>

		<guid isPermaLink="false">http://newsourcemedia.com/blog/2004/05/25/popup-chromeless-window/</guid>
		<description><![CDATA[An easy to use Javascript Popup Chromeless Window. Introduction: Here's a simple but flexible javascript popup function. This effect is known as a chromeless window. This usually means that the window is resized and the browser features (nav buttons, address &#8230; <a href="http://newsourcemedia.com/blog/popup-chromeless-window/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[An easy to use Javascript Popup Chromeless Window.
<span id="more-211"></span>
<span class="contitle">Introduction:</span>

<span style="font-family: Verdana,Arial,Helvetica,sans-serif; font-size: x-small;">Here's a simple                        but flexible javascript popup function. This effect is known                        as a chromeless window. This usually means that the window                        is resized and the browser features (nav buttons, address                        field, scrollbars, resize handle, and favorites) are hidden                        or altered.</span>

<span style="font-family: Verdana,Arial,Helvetica,sans-serif; font-size: x-small;"> </span>
<p class="contitle"><span style="font-family: Verdana,Arial,Helvetica,sans-serif; font-size: x-small;">Javascript Source Code:</span></p>

<span style="font-family: Verdana,Arial,Helvetica,sans-serif; font-size: x-small;"> </span>

<span class="sourceCODE"><span style="font-family: Verdana,Arial,Helvetica,sans-serif; font-size: x-small;">&lt;script language="javascript"&gt;
&lt;!--
var openwin;
function popupwin(url,myname,w,h,s)
{
settings='height=' h ',width=' w ',scrollbars=' s ',toolbar=no,location=no,status=no,menubar=no, resizable=no,dependent=no'
openwin=window.open(url,myname,settings);
}// --&gt;
&lt;/script&gt;</span></span>

<span style="font-family: Verdana,Arial,Helvetica,sans-serif; font-size: x-small;"> </span>

<span class="contitle"><span style="font-family: Verdana,Arial,Helvetica,sans-serif; font-size: x-small;">HTML Source Code:</span></span><span class="sourceCODE"></span>

<span class="sourceHTML"><span style="font-family: Verdana,Arial,Helvetica,sans-serif; font-size: x-small;">&lt;p&gt;
Click here to
&lt;a href="#" onClick="popupwin('/index.php','Loading','400','400','yes');"&gt;
Open Popup Window&lt;/a&gt; the pop up.
&lt;/p&gt; </span></span><span style="font-family: Verdana,Arial,Helvetica,sans-serif; font-size: x-small;"> </span>
<p class="contitle">Adding it to your site:</p>

First create a variable called "<span class="sourceCODE">openwin</span>".                        Next create a function called "<span class="sourceCODE">popupwin()</span>".                        This does all the work. To configure the code for your site,                        just change the values inside the javascript "<span class="sourceCODE">settings</span>"                        line and the html link "<span class="sourceHTML">onClick</span>"                        values. And that's it.

<a href="../../Tutorials/JS-Popup%20Window.html" target="_blank">Click                        here for a working sample</a>.]]></content:encoded>
			<wfw:commentRss>http://newsourcemedia.com/blog/popup-chromeless-window/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<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>overLIB</title>
		<link>http://newsourcemedia.com/blog/overlib/</link>
		<comments>http://newsourcemedia.com/blog/overlib/#comments</comments>
		<pubDate>Fri, 19 Mar 2004 00:22:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[JS Text Effects]]></category>
		<category><![CDATA[colored]]></category>
		<category><![CDATA[floating description]]></category>
		<category><![CDATA[link description]]></category>
		<category><![CDATA[popup box]]></category>
		<category><![CDATA[title]]></category>
		<category><![CDATA[tooltip]]></category>

		<guid isPermaLink="false">http://newsourcemedia.com/blog/2004/03/18/overlib/</guid>
		<description><![CDATA[overLIB is a JavaScript library created to enhance websites with small popup information boxes (tooltips) to help visitors around your website. Introduction: overLIB is a JavaScript library created to enhance websites with small popup information boxes (tooltips) to help visitors &#8230; <a href="http://newsourcemedia.com/blog/overlib/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[overLIB is a JavaScript library created to enhance websites with small popup information boxes (tooltips) to help visitors around your website.
<span id="more-206"></span>
<strong>Introduction:</strong>

<strong>overLIB</strong> is a JavaScript library created to enhance websites with small    popup information boxes (tooltips) to help visitors around your website. It    will provide the user with information about what will happen before they click    on a link as well as navigational help. Not to mention that it looks cool.

<strong>
Here is a sample of how it works:</strong>

Haven't seen overLIB in action? Take a look at these small examples. A <a onmouseover="return overlib('Nifty, ehh?');" onmouseout="return nd();" href="javascript:void(0);">plain    popup</a>, or perhaps one with <a onmouseover="return overlib('...and text here!', CAPTION, 'Caption here...');" onmouseout="return nd();" href="javascript:void(0);">a    caption</a>. You can also make them stick when you <a onclick="return overlib('This one stays around for a while!', STICKY, CAPTION, 'Sticky');" onmouseover="return overlib('Click on me!');" onmouseout="return nd();" href="javascript:void(0);">click</a>,    plus, you can place any <a onmouseover="return overlib('For example, a list:&lt;UL&gt;&lt;LI&gt;Item 1&lt;LI&gt;Item 2&lt;LI&gt;Item 3&lt;/UL&gt;');" onmouseout="return nd();" href="javascript:void(0);">html</a> you wish in them. There is lots more you can do like placing them on the <a onmouseover="return overlib('Woo, on the other side!', LEFT);" onmouseout="return nd();" href="javascript:void(0);">other    side of the mouse</a>, <a onmouseover="return overlib('This one\'s snapped to a 20 times 20 pixel grid.', SNAPX, 20, SNAPY, 20)" onmouseout="return nd();" href="javascript:void(0);">snapping    to a grid</a>, <a onmouseover="return overlib('We lock this one to position a specific position.', FIXX, 80, FIXY, 350)" onmouseout="return nd();" href="javascript:void(0);">fixating    the position</a> (you might need to scroll up to see it), having background    images and lots lots more.

Make sure you download JavaScript code by <a href="http://www.bosrup.com/web/overlib/download.html" target="_blank">clicking    here</a>.]]></content:encoded>
			<wfw:commentRss>http://newsourcemedia.com/blog/overlib/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Delete Warning</title>
		<link>http://newsourcemedia.com/blog/delete-warning/</link>
		<comments>http://newsourcemedia.com/blog/delete-warning/#comments</comments>
		<pubDate>Sat, 28 Feb 2004 00:22:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Javascripts]]></category>
		<category><![CDATA[Navagation]]></category>
		<category><![CDATA[administration.]]></category>
		<category><![CDATA[alert]]></category>
		<category><![CDATA[asp]]></category>
		<category><![CDATA[buttom]]></category>
		<category><![CDATA[button]]></category>
		<category><![CDATA[copy and paste]]></category>
		<category><![CDATA[custom message]]></category>
		<category><![CDATA[delete]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[warning]]></category>

		<guid isPermaLink="false">http://newsourcemedia.com/blog/2004/02/27/delete-warning/</guid>
		<description><![CDATA[Javascript that alert users when clicking on sensitive links (like delete or update links). You can customize the message with option to continue or cancel. Works great with PHP, ASP, and Perl administration sites. Introduction: This javascript registers an event &#8230; <a href="http://newsourcemedia.com/blog/delete-warning/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[Javascript that alert users when clicking on sensitive links (like delete or update links). You can customize the message with option to continue or cancel. Works great with PHP, ASP, and Perl administration sites.
<span id="more-217"></span><span class="contitle">Introduction:</span>
<p class="content">This javascript                        registers an event handler to a link on a page. When users                        click a link, the code executes a pop-up alert window asks                        them to confirm that this is the link they wanted to click.                        This is perfect for server side programs that delete files                        on a server or modify data in a database. (<a href="http://newsourcemedia.com/Tutorials/JS-Warning Link2.php">View</a> the test page.)</p>
<p class="contitle">Source Code:</p>

<span class="sourceCODE">&lt;script&gt;
function confirmDelete(delUrl,name_cat) {
if (confirm("Are you sure you want to delete \nrow                        number \""   name_cat   "\"\nfrom the                        database")) {
document.location = delUrl;
}
}
&lt;/script&gt;</span>

<span class="sourceCODE">&lt;!-- now the html link --&gt;</span>

<span class="sourceCODE">&lt;a href="javascript:confirmDelete('yourpage.php?delete=293','293')"&gt;Delete&lt;/a&gt;</span>
<p class="contitle">Adding it to your site:</p>

There are just a few areas you will need to change to customize                        the code for your use. Number one is the message inside                        of the javascript event handler (<span class="sourceCODE">"Are                        you sure you want to delete \nrow number \""                          name_cat   "\"\nfrom the database"</span>).                        Notice I used (<span class="sourceCODE">\n</span>) for a new                        line and (<span class="sourceCODE">\"</span>) for quotes.                        You can delete them if you like. You can also delete or                        move around the (<span class="sourceCODE">"   name_cat                          "</span>) inside the message.

The second thing you will have to modify is the link values                        (<span class="sourceCODE">'yourpage.php?delete=293','293'</span>).                        Change the file name to your serverside program file path                        and change the id row numbers (<span class="sourceCODE">'293'</span>)                        to the id row number of your database rows.]]></content:encoded>
			<wfw:commentRss>http://newsourcemedia.com/blog/delete-warning/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Source Include</title>
		<link>http://newsourcemedia.com/blog/source-include/</link>
		<comments>http://newsourcemedia.com/blog/source-include/#comments</comments>
		<pubDate>Sat, 28 Feb 2004 00:22:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Javascripts]]></category>
		<category><![CDATA[auto include]]></category>
		<category><![CDATA[custom programming]]></category>
		<category><![CDATA[java script]]></category>
		<category><![CDATA[javascript programming]]></category>
		<category><![CDATA[speed]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://newsourcemedia.com/blog/2004/02/27/source-include/</guid>
		<description><![CDATA[Learn how to save time and money by using the javascript src() function to including local or remote document like headers, footers, css, images, and flash files. Introduction: With Javascript, you can save time and money by using the ("src") &#8230; <a href="http://newsourcemedia.com/blog/source-include/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[Learn how to save time and money by using the javascript src() function to including local or remote document like headers, footers, css, images, and flash files.
<span id="more-215"></span>

<span class="contitle">Introduction:</span>

With Javascript, you can save time and money by using the                        ("src") to include remote or local documents.                        For example, you may have a web site serving 20 web pages.                        All 20 pages display the same header and footer item like                        site name, logos and links. However, if you were to change                        the header text, you would have to apply those changes all                        20 pages manualy. That's not fun. Here is a faster way (<a href="../../Tutorials/JS-Include%20Javascript.html" target="_blank">View</a> the test page.)

<span class="contitle">Source Code of included header file (JS-IncludeB.js):</span>

<span class="sourceCODE">&lt;!--
document.writeln('&lt;center&gt;');
document.writeln('&lt;h2&gt;Top: This was included by js&lt;/h2&gt;');
document.writeln('&lt;/center&gt;');
// --&gt;</span>

<span class="contitle">Source Code of included footer file                        (JS-IncludeB.js):</span>

<span class="sourceCODE">&lt;!--
document.writeln('&lt;center&gt;');
document.writeln('&lt;h2&gt;Top: This was included by js&lt;/h2&gt;');
document.writeln('&lt;/center&gt;');
// --&gt;</span>

<span class="contitle">Source Code of main page:</span>

<span class="sourceCODE">&lt;table width="100%" border="0"                        cellpadding="0" cellspacing="0"&gt;
&lt;tr&gt;
&lt;td width="100%" height="42" valign="top"                        bgcolor="#66CCFF"&gt;
&lt;script language="JavaScript" src="JS-IncludeT.js"&gt;
&lt;/script&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td valign="top" height="49" bgcolor="#FFFFFF"&gt;
&lt;script language="JavaScript" src="JS-IncludeB.js"&gt;
&lt;/script&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td height="175"&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;</span>]]></content:encoded>
			<wfw:commentRss>http://newsourcemedia.com/blog/source-include/feed/</wfw:commentRss>
		<slash:comments>2</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! -->
