<?xml version="1.0" encoding="utf-8" ?><?xml-stylesheet type="text/xsl" href="http://www.daniweb.com/js/rss.xsl"?><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>DaniWeb IT Discussion Community
			 - JavaScript / DHTML / AJAX					</title>
		<link>http://www.daniweb.com/web-development/javascript-dhtml-ajax/117</link>
		<description>Our JS / DHTML / AJAX forum is the place for Q&amp;A-style discussions related to clientside scripting languages (that are executed by a web browser instead of on the server's end). Note we have a separate HTML and CSS forum, within our Web Design sub-category, for markup languages.</description>
		<language>en-US</language>
		<ttl>60</ttl>
		<!-- PubSubHubbub Discovery -->
		<link rel="hub" href="http://daniweb.superfeedr.com/" xmlns="http://www.w3.org/2005/Atom" />
		<link rel="hub" href="http://pubsubhubbub.superfeedr.com/" xmlns="http://www.w3.org/2005/Atom" />
		<link rel="hub" href="http://pubsubhubbub.appspot.com/" xmlns="http://www.w3.org/2005/Atom" />
		<link rel="self" href="http://www.daniweb.com/rss/pull/117" xmlns="http://www.w3.org/2005/Atom" />
		<!-- End Of PubSubHubbub Discovery -->
				<item>
			<title>JavaScript Not Working When Included Elsewhere</title>
			<link>http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/456961/javascript-not-working-when-included-elsewhere</link>
			<pubDate>Tue, 18 Jun 2013 22:00:28 +0000</pubDate>
			<description>I have a script which is a simple HTML/JS contact form. The site is based on Joomla. Specifically, one of the YooTheme Templates. It is also running WidgetKit. I have had issues before which have been solved on here which were to do with my script including JS and WidgetKit ...</description>
			<content:encoded><![CDATA[ <p>I have a script which is a simple HTML/JS contact form. The site is based on Joomla. Specifically, one of the YooTheme Templates. It is also running WidgetKit.</p>

<p>I have had issues before which have been solved on here which were to do with my script including JS and WidgetKit including JS.</p>

<p>I removed my JS inclusion.</p>

<p>However, now the JS does not actually work on my script. The form gets emailed without validation.</p>

<p>The script works when not put into Joomla, IE, in its own PHP file so i know the code is ok.</p>

<p>It just does not work when added to Joomla. I suspect its some kind of conflict.</p>

<p>What i need is for the JS to validate the form AND send the email. At the moment it just sends the email.</p>

<p>Here is the code i have at the moment:</p>

<pre><code class="language-js">&lt;!DOCTYPE HTML&gt;
&lt;html xmlns="<a href="http://www.w3.org/1999/xhtml" rel="nofollow">http://www.w3.org/1999/xhtml</a>"&gt;
&lt;head&gt;

&lt;meta charset="utf-8" /&gt;

&lt;link href='<a href="http://fonts.googleapis.com/css?family=PT+Sans+Narrow" rel="nofollow">http://fonts.googleapis.com/css?family=PT+Sans+Narrow</a>' rel='stylesheet' type='text/css'&gt;
&lt;link href='<a href="http://fonts.googleapis.com/css?family=Droid+Sans" rel="nofollow">http://fonts.googleapis.com/css?family=Droid+Sans</a>' rel='stylesheet' type='text/css'&gt;
&lt;link rel="stylesheet" href="rppalmer12/style.css"&gt;


&lt;script type="text/javascript"&gt;
//$.noConflict();
$(document).ready(function() {

function isInt(n) {
return typeof n === 'number' &amp;&amp; n % 1 == 0;
}

// Form validation
$(".darkBtn").click(function(e) {
e.preventDefault();
var email_check = /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,6}$/i;
var email = $("form.form_contact .email").val();

var zipCheck = /[A-Z]{1,2}[0-9R][0-9A-Z]? [0-9][ABD-HJLNP-UW-Z]{2}/i;
var zip = $("form.form_contact .zipcode").val();

var phoneCheck = /^\d+$/;
var phone = $("form.form_contact .phone").val();

var error = "";

if(!email_check.test(email))
{
error = "Please give a valid email address.";
}

if(!zipCheck.test(zip))
{
error = "Please give a valid postcode.";
}

if(!phoneCheck.test(phone) || phone.length != 11)
{
error = "Please give a valid phone number.";
}

// Check if all is filled
if($(".gender").val() == 0 || $(".title").val() == 0 || $(".fname").val() == "" || $(".sname").val() == "" || $(".phone").val() == "" || $(".email").val() == "" || $(".zipcode").val() == "" || $(".dday").val() == 0 || $(".dmonth").val() == 0 || $(".dyear").val() == 0 || $(".insurance").val() == 0 || $(".sday").val() == 0 || $(".smonth").val() == 0 || $(".syear").val() == 0 || $(".hear").val() == 0) {
error = "Please fill in all the form.";
}

// No error ? -&gt; Submit
if(error == "")
{

$("form#contact_form").submit();$(".form_error").hide();
} else {
$(".form_error").empty().text(error);
$(".form_error").show();
}
});
});
&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;&lt;?php  if (isset($_POST['action'])) {     $to = "test@test.com";  $emailfrom = "test@test.com";   $subject = "Insurance Quote";   $message = "\r\n Title:" . $_POST['title'] . "\r\n First Name:" . $_POST['fname'] . "\r\n Surname:" . $_POST['sname'] . "\r\n Gender:" . $_POST['gender'] . "\r\n Number: " . $_POST['number'] . "\r\n Email: " . $_POST['email'] . "\r\n Post: " . $_POST['post'] . "\r\n DOB:Day: " . $_POST['dobday'] . "\r\n DOB:Month: " . $_POST['dobmonth'] . "\r\n DOB:Year:" . $_POST['dobyear'] . "\r\n Hear: " . $_POST['hear'] . "\r\n Insurance Type:" . $_POST['type'] . "\r\n START:Day:" . $_POST['startday'] . "\r\n START:Month:" . $_POST['startmonth'] . "\r\n START:Year:" . $_POST['startyear'];  $headers = "From:" . $emailfrom;        if (mail($to, $subject, $message, $headers)) {      echo "Thankyou for using B";    }   echo "done";} else {    ?&gt;
&lt;div class="menu_contact"&gt;
&lt;h3&gt;Get A Quote&lt;/h3&gt;
&lt;hr /&gt;
&lt;form action="" method="POST" class="form_contact" id="contact_form"&gt;

&lt;label&gt;Title:&lt;/label&gt;
&lt;select class="input title" name="title"&gt;
&lt;option value="0"&gt;Please select&lt;/option&gt;
&lt;option value="Mr"&gt;Mr&lt;/option&gt;
&lt;option value="Mrs"&gt;Mrs&lt;/option&gt;
&lt;option value="Miss"&gt;Miss&lt;/option&gt;
&lt;option value="Ms"&gt;Ms&lt;/option&gt;
&lt;/select&gt;
&lt;label&gt;First name:&lt;/label&gt;
&lt;input type="text" class="input fname" placeholder="John" name="fname"/&gt;
&lt;label&gt;Surname:&lt;/label&gt;
&lt;input type="text" class="input sname" placeholder="Doe" name="sname" /&gt;
&lt;label&gt;Gender:&lt;/label&gt;
&lt;select class="input gender" name="gender"&gt;
&lt;option value="0"&gt;Please select&lt;/option&gt;
&lt;option&gt;Male&lt;/option&gt;
&lt;option&gt;Female&lt;/option&gt;
&lt;/select&gt;
&lt;label&gt;Contact Number:&lt;/label&gt;
&lt;input type="text" class="input phone" placeholder="Your number" name="number" /&gt;
&lt;label&gt;Email:&lt;/label&gt;
&lt;input type="email" class="input email" placeholder="something@domain.com" name="email"/&gt;
&lt;label&gt;Postcode:&lt;/label&gt;
&lt;input type="text" class="input zipcode" placeholder="CW3 9SS" name="post"/&gt;
&lt;label&gt;Date of birth:&lt;/label&gt;
&lt;select class="input dateDay bday" name="dobday"&gt;
&lt;option value="0"&gt;Day&lt;/option&gt;
&lt;option value="1"&gt;1&lt;/option&gt;
&lt;option value="2"&gt;2&lt;/option&gt;
&lt;option value="3"&gt;3&lt;/option&gt;
&lt;option value="4"&gt;4&lt;/option&gt;
&lt;option value="5"&gt;5&lt;/option&gt;
&lt;option value="6"&gt;6&lt;/option&gt;
&lt;option value="7"&gt;7&lt;/option&gt;
&lt;option value="8"&gt;8&lt;/option&gt;
&lt;option value="9"&gt;9&lt;/option&gt;
&lt;option value="10"&gt;10&lt;/option&gt;
&lt;option value="11"&gt;11&lt;/option&gt;
&lt;option value="12"&gt;12&lt;/option&gt;
&lt;option value="13"&gt;13&lt;/option&gt;
&lt;option value="14"&gt;14&lt;/option&gt;
&lt;option value="15"&gt;15&lt;/option&gt;
&lt;option value="16"&gt;16&lt;/option&gt;
&lt;option value="17"&gt;17&lt;/option&gt;
&lt;option value="18"&gt;18&lt;/option&gt;
&lt;option value="19"&gt;19&lt;/option&gt;
&lt;option value="20"&gt;20&lt;/option&gt;
&lt;option value="21"&gt;21&lt;/option&gt;
&lt;option value="22"&gt;22&lt;/option&gt;
&lt;option value="23"&gt;23&lt;/option&gt;
&lt;option value="24"&gt;24&lt;/option&gt;
&lt;option value="25"&gt;25&lt;/option&gt;
&lt;option value="26"&gt;26&lt;/option&gt;
&lt;option value="27"&gt;27&lt;/option&gt;
&lt;option value="28"&gt;28&lt;/option&gt;
&lt;option value="29"&gt;29&lt;/option&gt;
&lt;option value="30"&gt;30&lt;/option&gt;
&lt;option value="31"&gt;31&lt;/option&gt;
&lt;/select&gt;
&lt;select class="input dateMonth bmonth" name="dobmonth"&gt;
&lt;option value="0"&gt;Month&lt;/option&gt;
&lt;option value="January"&gt;January&lt;/option&gt;
&lt;option value="February"&gt;February&lt;/option&gt;
&lt;option value="March"&gt;March&lt;/option&gt;
&lt;option value="April"&gt;April&lt;/option&gt;
&lt;option value="May"&gt;May&lt;/option&gt;
&lt;option value="June"&gt;June&lt;/option&gt;
&lt;option value="July"&gt;July&lt;/option&gt;
&lt;option value="August"&gt;August&lt;/option&gt;
&lt;option value="September"&gt;September&lt;/option&gt;
&lt;option value="October"&gt;October&lt;/option&gt;
&lt;option value="November"&gt;November&lt;/option&gt;
&lt;option value="December"&gt;December&lt;/option&gt;
&lt;/select&gt;
&lt;select class="input dateYear byear" name="dobyear"&gt;
&lt;option value="0"&gt;Year&lt;/option&gt;
&lt;option value="1996"&gt;1996&lt;/option&gt;
&lt;option value="1995"&gt;1995&lt;/option&gt;
&lt;option value="1994"&gt;1994&lt;/option&gt;
&lt;option value="1993"&gt;1993&lt;/option&gt;
&lt;option value="1992"&gt;1992&lt;/option&gt;
&lt;option value="1991"&gt;1991&lt;/option&gt;
&lt;option value="1990"&gt;1990&lt;/option&gt;
&lt;option value="1989"&gt;1989&lt;/option&gt;
&lt;option value="1988"&gt;1988&lt;/option&gt;
&lt;option value="1987"&gt;1987&lt;/option&gt;
&lt;option value="1986"&gt;1986&lt;/option&gt;
&lt;option value="1985"&gt;1985&lt;/option&gt;
&lt;option value="1984"&gt;1984&lt;/option&gt;
&lt;option value="1983"&gt;1983&lt;/option&gt;
&lt;option value="1982"&gt;1982&lt;/option&gt;
&lt;option value="1981"&gt;1981&lt;/option&gt;
&lt;option value="1980"&gt;1980&lt;/option&gt;
&lt;option value="1979"&gt;1979&lt;/option&gt;
&lt;option value="1978"&gt;1978&lt;/option&gt;
&lt;option value="1977"&gt;1977&lt;/option&gt;
&lt;option value="1976"&gt;1976&lt;/option&gt;
&lt;option value="1975"&gt;1975&lt;/option&gt;
&lt;option value="1974"&gt;1974&lt;/option&gt;
&lt;option value="1973"&gt;1973&lt;/option&gt;
&lt;option value="1972"&gt;1972&lt;/option&gt;
&lt;option value="1971"&gt;1971&lt;/option&gt;
&lt;option value="1970"&gt;1970&lt;/option&gt;
&lt;option value="1969"&gt;1969&lt;/option&gt;
&lt;option value="1968"&gt;1968&lt;/option&gt;
&lt;option value="1967"&gt;1967&lt;/option&gt;
&lt;option value="1966"&gt;1966&lt;/option&gt;
&lt;option value="1965"&gt;1965&lt;/option&gt;
&lt;option value="1964"&gt;1964&lt;/option&gt;
&lt;option value="1963"&gt;1963&lt;/option&gt;
&lt;option value="1962"&gt;1962&lt;/option&gt;
&lt;option value="1961"&gt;1961&lt;/option&gt;
&lt;option value="1960"&gt;1960&lt;/option&gt;
&lt;option value="1959"&gt;1959&lt;/option&gt;
&lt;option value="1958"&gt;1958&lt;/option&gt;
&lt;option value="1957"&gt;1957&lt;/option&gt;
&lt;option value="1956"&gt;1956&lt;/option&gt;
&lt;option value="1955"&gt;1955&lt;/option&gt;
&lt;option value="1954"&gt;1954&lt;/option&gt;
&lt;option value="1953"&gt;1953&lt;/option&gt;
&lt;option value="1952"&gt;1952&lt;/option&gt;
&lt;option value="1951"&gt;1951&lt;/option&gt;
&lt;option value="1950"&gt;1950&lt;/option&gt;
&lt;option value="1949"&gt;1949&lt;/option&gt;
&lt;option value="1948"&gt;1948&lt;/option&gt;
&lt;option value="1947"&gt;1947&lt;/option&gt;
&lt;option value="1946"&gt;1946&lt;/option&gt;
&lt;option value="1945"&gt;1945&lt;/option&gt;
&lt;option value="1944"&gt;1944&lt;/option&gt;
&lt;option value="1943"&gt;1943&lt;/option&gt;
&lt;option value="1942"&gt;1942&lt;/option&gt;
&lt;option value="1941"&gt;1941&lt;/option&gt;
&lt;option value="1940"&gt;1940&lt;/option&gt;
&lt;option value="1939"&gt;1939&lt;/option&gt;
&lt;option value="1938"&gt;1938&lt;/option&gt;
&lt;option value="1937"&gt;1937&lt;/option&gt;
&lt;option value="1936"&gt;1936&lt;/option&gt;
&lt;option value="1935"&gt;1935&lt;/option&gt;
&lt;option value="1934"&gt;1934&lt;/option&gt;
&lt;option value="1933"&gt;1933&lt;/option&gt;
&lt;option value="1932"&gt;1932&lt;/option&gt;
&lt;option value="1931"&gt;1931&lt;/option&gt;
&lt;option value="1930"&gt;1930&lt;/option&gt;
&lt;option value="1929"&gt;1929&lt;/option&gt;
&lt;option value="1928"&gt;1928&lt;/option&gt;
&lt;option value="1927"&gt;1927&lt;/option&gt;
&lt;option value="1926"&gt;1926&lt;/option&gt;
&lt;option value="1925"&gt;1925&lt;/option&gt;
&lt;option value="1924"&gt;1924&lt;/option&gt;
&lt;option value="1923"&gt;1923&lt;/option&gt;
&lt;option value="1922"&gt;1922&lt;/option&gt;
&lt;option value="1921"&gt;1921&lt;/option&gt;
&lt;option value="1920"&gt;1920&lt;/option&gt;
&lt;option value="1919"&gt;1919&lt;/option&gt;
&lt;option value="1918"&gt;1918&lt;/option&gt;
&lt;option value="1917"&gt;1917&lt;/option&gt;
&lt;option value="1916"&gt;1916&lt;/option&gt;
&lt;option value="1915"&gt;1915&lt;/option&gt;
&lt;option value="1914"&gt;1914&lt;/option&gt;
&lt;option value="1913"&gt;1913&lt;/option&gt;
&lt;/select&gt;
&lt;label&gt;Insurance Type:&lt;/label&gt;
&lt;select class="input insurance" name="type"&gt;
&lt;option value="0"&gt;Please select&lt;/option&gt;
&lt;option&gt;Type 1&lt;/option&gt;
&lt;option&gt;Type 2&lt;/option&gt;
&lt;/select&gt;
&lt;label&gt;Start Date:&lt;/label&gt;
&lt;select class="input dateDay sday" name="startday"&gt;
&lt;option value="0"&gt;Day&lt;/option&gt;
&lt;option value="1"&gt;1&lt;/option&gt;
&lt;option value="2"&gt;2&lt;/option&gt;
&lt;option value="3"&gt;3&lt;/option&gt;
&lt;option value="4"&gt;4&lt;/option&gt;
&lt;option value="5"&gt;5&lt;/option&gt;
&lt;option value="6"&gt;6&lt;/option&gt;
&lt;option value="7"&gt;7&lt;/option&gt;
&lt;option value="8"&gt;8&lt;/option&gt;
&lt;option value="9"&gt;9&lt;/option&gt;
&lt;option value="10"&gt;10&lt;/option&gt;
&lt;option value="11"&gt;11&lt;/option&gt;
&lt;option value="12"&gt;12&lt;/option&gt;
&lt;option value="13"&gt;13&lt;/option&gt;
&lt;option value="14"&gt;14&lt;/option&gt;
&lt;option value="15"&gt;15&lt;/option&gt;
&lt;option value="16"&gt;16&lt;/option&gt;
&lt;option value="17"&gt;17&lt;/option&gt;
&lt;option value="18"&gt;18&lt;/option&gt;
&lt;option value="19"&gt;19&lt;/option&gt;
&lt;option value="20"&gt;20&lt;/option&gt;
&lt;option value="21"&gt;21&lt;/option&gt;
&lt;option value="22"&gt;22&lt;/option&gt;
&lt;option value="23"&gt;23&lt;/option&gt;
&lt;option value="24"&gt;24&lt;/option&gt;
&lt;option value="25"&gt;25&lt;/option&gt;
&lt;option value="26"&gt;26&lt;/option&gt;
&lt;option value="27"&gt;27&lt;/option&gt;
&lt;option value="28"&gt;28&lt;/option&gt;
&lt;option value="29"&gt;29&lt;/option&gt;
&lt;option value="30"&gt;30&lt;/option&gt;
&lt;option value="31"&gt;31&lt;/option&gt;
&lt;/select&gt;
&lt;select class="input dateMonth smonth" name="startmonth"&gt;
&lt;option value="0"&gt;Month&lt;/option&gt;
&lt;option value="January"&gt;January&lt;/option&gt;
&lt;option value="February"&gt;February&lt;/option&gt;
&lt;option value="March"&gt;March&lt;/option&gt;
&lt;option value="April"&gt;April&lt;/option&gt;
&lt;option value="May"&gt;May&lt;/option&gt;
&lt;option value="June"&gt;June&lt;/option&gt;
&lt;option value="July"&gt;July&lt;/option&gt;
&lt;option value="August"&gt;August&lt;/option&gt;
&lt;option value="September"&gt;September&lt;/option&gt;
&lt;option value="October"&gt;October&lt;/option&gt;
&lt;option value="November"&gt;November&lt;/option&gt;
&lt;option value="December"&gt;December&lt;/option&gt;
&lt;/select&gt;
&lt;select class="input dateYear syear" name="startyear"&gt;
&lt;option value="0"&gt;Year&lt;/option&gt;
&lt;option value='2013'&gt;2013&lt;/option&gt;
&lt;option value='2014'&gt;2014&lt;/option&gt;

&lt;/select&gt;
&lt;label&gt;Where did you hear about us:&lt;/label&gt;
&lt;select class="input hear" name="hear"&gt;
&lt;option value="0"&gt;Please select&lt;/option&gt;
&lt;option value="google"&gt;Google&lt;/option&gt;
&lt;option value="recommendation"&gt;Recommendation&lt;/option&gt;
&lt;option value="email"&gt;Email&lt;/option&gt;
&lt;option value="Magazine"&gt;Magazine&lt;/option&gt;
&lt;option value="Facebook"&gt;Facebook&lt;/option&gt;
&lt;option value="Other"&gt;Other&lt;/option&gt;
&lt;/select&gt;
&lt;div class="form_error" style="display:none;color:red;text-align:center;text-shadow:none;width:278px;"&gt;&lt;/div&gt;&lt;input type="hidden" name="action" value="postform" /&gt;
&lt;input class="darkBtn submit" type="submit" value="Get A Quote &gt;" name="test"&gt;
&lt;/form&gt;
&lt;/div&gt;&lt;?php } ?&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>I have tried the "var $j = jQuery.noConflict();" Trick but to no avail.</p>

<p>Any help would be appreciated.</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/javascript-dhtml-ajax/117">JavaScript / DHTML / AJAX</category>
			<dc:creator>rosstafarian</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/456961/javascript-not-working-when-included-elsewhere</guid>
		</item>
				<item>
			<title>More/Less menu</title>
			<link>http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/456933/moreless-menu</link>
			<pubDate>Tue, 18 Jun 2013 12:44:42 +0000</pubDate>
			<description>I want vertical menu with More or Less option same like in http://www.bayt.com/en/international/jobs/ I tried to find out.. but no luck..</description>
			<content:encoded><![CDATA[ <p>I want vertical menu with More or Less option same like in <a href="http://www.bayt.com/en/international/jobs/" rel="nofollow">http://www.bayt.com/en/international/jobs/</a></p>

<p>I tried to find out..  but no luck..</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/javascript-dhtml-ajax/117">JavaScript / DHTML / AJAX</category>
			<dc:creator>edwin.thomson1</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/456933/moreless-menu</guid>
		</item>
				<item>
			<title>It almost like a memory leak. Not sure what is going on!</title>
			<link>http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/456749/it-almost-like-a-memory-leak.-not-sure-what-is-going-on</link>
			<pubDate>Sun, 16 Jun 2013 03:38:05 +0000</pubDate>
			<description>When I try to use the token data it acts like it is out of scope or it leaked. I have tested this in firefox and cannot figure out what is happening. If you could help me understand why it fails to return the token please feel free to reply. ...</description>
			<content:encoded><![CDATA[ <p>When I try to use the token data it acts like it is out of scope or it leaked. I have tested this in firefox and cannot figure out what is happening. If you could help me understand why it fails to return the token please feel free to reply.</p>

<p>the code that retreives the token:</p>

<pre><code class="language-js">$(function() {
    var request = $.ajax({
        type: "GET",
        cache: false,
        data: {v: 1, r: 'requestToken', apikey: 'root', secret: 'root'},
        url: "/vdesktop/deskapi/",
        dataType: "json",

    });
    request.done(function(data) {
        if (data.statusCode == 1) {
                $token = data.response;
                $(document.body).data("token", data.response);
            } else{
                alert("Error: ("+data.statusCode+") "+data.response);
            }
    });
    request.fail(function(jqXHR, textStatus) {
        alert("Error: "+textStatus);
    });
    alert($(document.body).data("token"));
});
</code></pre>

<p>An example resultset from the server:<br /><code>{"statusCode": 1, "response": "1fa8997a0cb5062144b25c1ff917a5f293bee88b62cd4f99aca26fda12515372" }</code></p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/javascript-dhtml-ajax/117">JavaScript / DHTML / AJAX</category>
			<dc:creator>matthewl6970</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/456749/it-almost-like-a-memory-leak.-not-sure-what-is-going-on</guid>
		</item>
				<item>
			<title>Problem with ajax requests multiplying when just clicked once.</title>
			<link>http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/456707/problem-with-ajax-requests-multiplying-when-just-clicked-once</link>
			<pubDate>Sat, 15 Jun 2013 08:37:11 +0000</pubDate>
			<description>I have a page with a list of users. Every time i click on a username a div will be loaded via ajax, and this div will contain the user details plus another ajax link that will be used to display a floating div that will contain a form to ...</description>
			<content:encoded><![CDATA[ <p>I have a page with a list of users. Every time i click on a username a div will be loaded via ajax, and this div will contain the user details plus another ajax link that will be used to display a floating div that will contain a form to send a message to the user.<br />
The first time i load the user everything will be going just fine, and when i click on the "send a private message to the user" link just one request will be triggered.<br />
If i load then another user (or the same user) when i click on the "send a message" link two request will be triggered, and then 3, and then 4 and so on. Please, i'm a new poster and posting on mobile cos its urgent so the code wont be easy to post. But i hope the problem has been well explained. Please people help!</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/javascript-dhtml-ajax/117">JavaScript / DHTML / AJAX</category>
			<dc:creator>Olyboy16</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/456707/problem-with-ajax-requests-multiplying-when-just-clicked-once</guid>
		</item>
				<item>
			<title>jQuery not finding control id&#039;s</title>
			<link>http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/456703/jquery-not-finding-control-ids</link>
			<pubDate>Sat, 15 Jun 2013 07:45:13 +0000</pubDate>
			<description>Hey guys, I've been tearing my hair out for some time trying to figure out why my jquery has suddenly stopped working. The jquery script that I have written is fairly simple: $(document).ready(function () { $(&quot;#pTab&quot;).addClass(&quot;active&quot;); $(&quot;#pBtn&quot;).click(function () { $(&quot;#pTab&quot;).addClass(&quot;active&quot;); $(&quot;#gTab&quot;).removeClass(&quot;active&quot;); }); $(&quot;#gBtn&quot;).click(function () { $(&quot;#gTab&quot;).addClass(&quot;active&quot;); $(&quot;#pTab&quot;).removeClass(&quot;active&quot;); }); }); I ...</description>
			<content:encoded><![CDATA[ <p>Hey guys,</p>

<p>I've been tearing my hair out for some time trying to figure out why my jquery has suddenly stopped working. The<br />
jquery script that I have written is fairly simple:</p>

<pre><code class="language-js">$(document).ready(function () {
    $("#pTab").addClass("active");

    $("#pBtn").click(function () {
        $("#pTab").addClass("active");
        $("#gTab").removeClass("active");
    });

    $("#gBtn").click(function () {
        $("#gTab").addClass("active");
        $("#pTab").removeClass("active");
    });
});
</code></pre>

<p>I reference this file as such:</p>

<pre><code class="language-js">&lt;%@ Page Title="" Language="C#" MasterPageFile="~/Site1.Master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="project.Default" %&gt;
&lt;asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server"&gt;
    &lt;script type="text/javascript" src="Scripts/CustomScripts/Default.js"&gt;&lt;/script&gt;
    &lt;title&gt; Home &lt;/title&gt;
&lt;/asp:Content&gt;
&lt;asp:Content ID="Content2" ContentPlaceHolderID="body" runat="server"&gt;
    &lt;div class="containerCustom"&gt;
        &lt;ul class="navCustom nav-tabsCustom"&gt;
            &lt;li id="pTab" runat="server"&gt;
                &lt;a id="pBtn" runat="server" href="#"&gt;Tab 1&lt;/a&gt;
            &lt;/li&gt;
            &lt;li id="gTab" runat="server"&gt;
                &lt;a id="gBtn" runat="server" href="#"&gt;Tab 2&lt;/a&gt;
            &lt;/li&gt;
        &lt;/ul&gt;
    &lt;/div&gt;
&lt;/asp:Content&gt;
</code></pre>

<p>There are no errors when parsing firebug and the thing that really throws me off is that I have jquery working fine on a different page for the same project. I've doubled checked my file path for the js file and double checked the id's. I have no idea what else it could be, if you could help it would be much appreciated. Thank you for your time and help regarding this matter.</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/javascript-dhtml-ajax/117">JavaScript / DHTML / AJAX</category>
			<dc:creator>while(!success)</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/456703/jquery-not-finding-control-ids</guid>
		</item>
				<item>
			<title>A little and simple help required please</title>
			<link>http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/456671/a-little-and-simple-help-required-please</link>
			<pubDate>Fri, 14 Jun 2013 22:01:53 +0000</pubDate>
			<description>Hello I need a little animation on my websitewith jquery I have two text divs (Text 1 and Text 2) of same size now i want to animate them I want to display the Text 1 for 10 seconds and then it will fade out permanently and only display Text ...</description>
			<content:encoded><![CDATA[ <p>Hello</p>

<p>I need a little animation on my websitewith jquery</p>

<p>I have two text divs (Text 1 and Text 2) of same size now i want to animate them</p>

<p>I want to display the Text 1 for 10 seconds and then it will fade out permanently and only display Text 2 permanently with Fadein function how it will be possible?</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/javascript-dhtml-ajax/117">JavaScript / DHTML / AJAX</category>
			<dc:creator>hallianonline</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/456671/a-little-and-simple-help-required-please</guid>
		</item>
				<item>
			<title>Problem with Isotope.js</title>
			<link>http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/456565/problem-with-isotope.js</link>
			<pubDate>Thu, 13 Jun 2013 12:28:58 +0000</pubDate>
			<description>Hello, I’m trying to make a infinite scrolling gallery. I’ve managed to get the data trough ajax and the infinite-part works perfectly. Only when I apply Isotope http://isotope.metafizzy.co/index.html to make it look good it won’t apply the css and the pictures just come behind the ones that are already there. ...</description>
			<content:encoded><![CDATA[ <p>Hello,<br />
I’m trying to make a infinite scrolling gallery. I’ve managed to get the data trough ajax and the infinite-part works perfectly. Only when I apply Isotope <a href="http://isotope.metafizzy.co/index.html" rel="nofollow">http://isotope.metafizzy.co/index.html</a> to make it look good it won’t apply the css and the pictures just come behind the ones that are already there.<br />
My script is this:</p>

<pre><code class="language-js">    $(document).ready(function(){
  var page = 1;
  $('#result').isotope();
  $(window).scroll(function(){
    if($(window).scrollTop() + $(window).height() &gt; $(document).height() - 100) {
       $.get(baseurl + "gallerij/getAfbeeldingen/" + page ,  function(data){

          $('#result').append(data).isotope('appended', data);



        }); 
   }

  });




});
</code></pre>

<p>The html blocks I get from ajax looks like this:</p>

<pre><code class="language-js">         &lt;div class="grid"&gt;
                &lt;div class="imgholder"&gt;
                &lt;img src="img1.jpg"/&gt;
                &lt;/div&gt;
                &lt;strong&gt;Testje&lt;/strong&gt;
              &lt;/div&gt;          
</code></pre>

<p>I’ve tried to do $(‘#result’).isotope(“reLayout”); but it won’t work</p>

<p>getAfbeeldingen:</p>

<pre><code class="language-js">public function getAfbeeldingen($page)
        {


        $requested_page = $this-&gt;input-&gt;post('page_num');
        p($page, 'bartjeeuhh');
        $limit = (($page - 1) * 12);
        $offset = 12;
        $afbeeldingen = $this-&gt;gallerij_model-&gt;getAfbeeldingen($offset, $limit);


        $html = '';
        foreach($afbeeldingen as $afbeelding)
        {
            $html .= "&lt;div class='grid'&gt;&lt;div class='imgholder'&gt;";
            $html .= "&lt;img src='". base_url('uploads/afbeeldingen/'. $afbeelding-&gt;Pad) ."'/&gt;";
            $html .= "&lt;/div&gt;&lt;strong&gt;Testje&lt;/strong&gt;&lt;/div&gt;";
        }

        $this-&gt;output-&gt;set_output($html);


    }
</code></pre>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/javascript-dhtml-ajax/117">JavaScript / DHTML / AJAX</category>
			<dc:creator>dekimpebart</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/456565/problem-with-isotope.js</guid>
		</item>
				<item>
			<title>add a link to selected datepicker date</title>
			<link>http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/456510/add-a-link-to-selected-datepicker-date</link>
			<pubDate>Wed, 12 Jun 2013 21:07:52 +0000</pubDate>
			<description>Hello, 1. Selecting date is working fine. 2. When I select a date, I want another link to come up. For example, If I select September 2020, I want to see page1.html, If I select September 2019, I want to see page2.html. It is not working. Please help. &lt;!DOCTYPE html ...</description>
			<content:encoded><![CDATA[ <p>Hello,</p>

<ol><li>Selecting date is working fine. </li>
<li>When I select a date, I want another link to come up. For example, If I select September 2020, I want to see page1.html, If I select September 2019, I want to see page2.html. </li>
</ol>

<p>It is not working. Please help.</p>

<pre><code class="language-js">        &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "<a href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" rel="nofollow">http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd</a>"&gt;
        &lt;html xmlns="<a href="http://www.w3.org/1999/xhtml" rel="nofollow">http://www.w3.org/1999/xhtml</a>" xml:lang="en" lang="en"&gt;
        &lt;head&gt;
            &lt;script src="<a href="http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.js" rel="nofollow">http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.js</a>"&gt;&lt;/script&gt;
            &lt;script type="text/javascript" src="<a href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.min.js" rel="nofollow">http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.min.js</a>"&gt;&lt;/script&gt;
            &lt;link rel="stylesheet" type="text/css" media="screen" href="<a href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/base/jquery-ui.css" rel="nofollow">http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/base/jquery-ui.css</a>"&gt;

            &lt;style&gt;
            .ui-datepicker-calendar {
                display: none;
                }
            &lt;/style&gt;
        &lt;/head&gt;
        &lt;body&gt;

        &lt;input type="button" id="june2013only" style="display: none;" value="CLICK" /&gt;

        &lt;a href="javascript:GetMyColor()"&gt;Click here for my color&lt;/a&gt;

            &lt;script type="text/javascript"&gt;
            $(function() {
                $('.date-picker').datepicker( {
                    changeMonth: true,
                    changeYear: true,
                    showButtonPanel: true,
                    dateFormat: 'MM yy',
                    onClose: function(dateText, inst) { 
                        var month = $("#ui-datepicker-div .ui-datepicker-month :selected").val();
                        var year = $("#ui-datepicker-div .ui-datepicker-year :selected").val();
                        $(this).datepicker('setDate', new Date(year, month, 1));
                    },
                    beforeShow : function(input, inst) {
                        if ((datestr = $(this).val()).length &gt; 0) {

          if (datestr == 'September 2020') {
           function GetMyColor()
        {
           window.location.href = "page1.html";

        }
        }


         else if (datestr == 'September 2019') {
            function GetMyColor()
        {
           window.location.href = "page2.html";

        }
        }

        else  {
           var g = 0;}

                            year = datestr.substring(datestr.length-4, datestr.length);
                            month = jQuery.inArray(datestr.substring(0, datestr.length-5), $(this).datepicker('option', 'monthNames'));
                            $(this).datepicker('option', 'defaultDate', new Date(year, month, 1));
                            $(this).datepicker('setDate', new Date(year, month, 1));
                        }
                    }
                });
            });




            &lt;/script&gt;


            &lt;label for="startDate"&gt;Date :&lt;/label&gt;
            &lt;input name="startDate" id="startDate" class="date-picker" /&gt;
        &lt;/body&gt;
        &lt;/html&gt; 
</code></pre>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/javascript-dhtml-ajax/117">JavaScript / DHTML / AJAX</category>
			<dc:creator>coderBie</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/456510/add-a-link-to-selected-datepicker-date</guid>
		</item>
				<item>
			<title>Disable zoom in javascript</title>
			<link>http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/456509/disable-zoom-in-javascript</link>
			<pubDate>Wed, 12 Jun 2013 21:05:11 +0000</pubDate>
			<description>Hi, I am creating a website using a predesigned template. There is some javascript that enables the user to zoom in on an image. I dont know javascript, and I want to know how to disable the zoom for some images. This is the link to my site:[http://www.suavedesign.net/works.html](http://www.suavedesign.net/works.html) Please go ...</description>
			<content:encoded><![CDATA[ <p>Hi,<br />
I am creating a website using a predesigned template.<br />
There is some javascript that enables the user to zoom in on an image. I dont know javascript, and I want to know how to disable the zoom for some images.<br />
This is the link to my site:<a href="http://www.suavedesign.net/works.html" rel="nofollow">http://www.suavedesign.net/works.html</a><br />
Please go to logos- there i want to disable the zoom, but keep it enabled for the images I will put under other tabs in the portfolio.<br />
This is the code for the js:</p>

<pre><code>&lt;script type="text/javascript"&gt;
$(document).ready(function(){
portfoliohover();
var $container = $('#isotope_content_wrapper');
$container.isotope({
    filter: '.Bedroom',
    animationOptions: {
     duration: 750,
     easing: 'linear',
     queue: false,
   }
});

$('#nav a').click(function(){
  var selector = $(this).attr('data-filter');
    $container.isotope({ 
    filter: selector,
    animationOptions: {
     duration: 750,
     easing: 'linear',
     queue: false,

   }
  });
  return false;
});

});

// Fancybox for portfolio items
jQuery(document).ready(function(){

    jQuery("a.example6").fancybox({
        'titlePosition'     : 'outside',
        'overlayColor'      : '#000',
        'overlayOpacity'    : 0.9
    }); 
    }); 

function portfoliohover(){
"use strict";
    jQuery(function() {
        // OPACITY OF BUTTON SET TO 0%
jQuery(".portfolio_item img").css("opacity","1");
            // ON MOUSE OVER
        jQuery(".portfolio_item  img").hover(function (){
            // SET OPACITY TO 70%
        jQuery(this).stop().animate({
        opacity:0.5
        }, "slow");
    },

// ON MOUSE OUT
    function (){
    // SET OPACITY BACK TO 50%
    jQuery(this).stop().animate({
    opacity: 1
    }, "slow");
    });
    });}
jQuery(document).ready(function(){
"use strict";
});

&lt;/script&gt;
</code></pre>

<p>What part of the code do I change to disable the zoom?<br />
Thanks.</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/javascript-dhtml-ajax/117">JavaScript / DHTML / AJAX</category>
			<dc:creator>suavedesign</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/456509/disable-zoom-in-javascript</guid>
		</item>
				<item>
			<title>Google Maps Removing All Markers/Clusters</title>
			<link>http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/456506/google-maps-removing-all-markersclusters</link>
			<pubDate>Wed, 12 Jun 2013 19:51:59 +0000</pubDate>
			<description>I am brand new to web development just moved over from the database side and I am having a bear of a time trying to remove clusters in google maps. I've probably spent roughly 12 hours trying to research what is going on. Attached is my code all help is ...</description>
			<content:encoded><![CDATA[ <p>I am brand new to web development just moved over from the database side and I am having a bear of a time trying to remove clusters in google maps. I've probably spent roughly 12 hours trying to research what is going on. Attached is my code all help is welcome. Can someone please take my attached code and actually write out the function to delete all markers?</p>

<pre><code class="language-js">&lt;!DOCTYPE html&gt;
&lt;html&gt;
  &lt;head&gt;
    &lt;title&gt;Remove an overlay&lt;/title&gt;
    &lt;link href="/maps/documentation/javascript/examples/default.css" rel="stylesheet"&gt;
     &lt;title&gt;Google Maps V3 API Sample&lt;/title&gt;
    &lt;script src="<a href="https://maps.googleapis.com/maps/api/js?v=3.exp&amp;sensor=false" rel="nofollow">https://maps.googleapis.com/maps/api/js?v=3.exp&amp;sensor=false</a>"&gt;&lt;/script&gt;
    &lt;script type="text/javascript"&gt;
    &lt;script src="<a href="http://maps.google.com/maps/api/js?sensor=false" rel="nofollow">http://maps.google.com/maps/api/js?sensor=false</a>" type="text/javascript"&gt;&lt;/script&gt;
    &lt;script type="text/javascript" src="<a href="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" rel="nofollow">http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js</a>"&gt;&lt;/script&gt;
    &lt;script type="text/javascript" src="<a href="http://maps.google.com/maps/api/js?sensor=false" rel="nofollow">http://maps.google.com/maps/api/js?sensor=false</a>"&gt;&lt;/script&gt;
    &lt;script src="<a href="http://google-maps-utility-library-v3.googlecode.com/svn/trunk/markerclusterer/src/markerclusterer.js" rel="nofollow">http://google-maps-utility-library-v3.googlecode.com/svn/trunk/markerclusterer/src/markerclusterer.js</a>" type="text/javascript"&gt;&lt;/script&gt;
    &lt;script&gt;

      var cityCircle;
      var map;
      var mapDiv;
      var markers = [];
      var infowindow = new google.maps.InfoWindow();

var locations = [
[1,42.59245,-87.822897],
[2,43.016695,-88.002726],
[3,42.717798,-87.797771],
[4,43.132656,-88.00595],
[5,43.107632,-87.9988],
[6,42.638115,-88.288572],
[7,42.581885,-87.855592],
[8,42.996331,-87.955759],
[9,43.089223,-88.003647],
[10,44.261833,-88.40967],
[11,43.183415,-88.004478],
[12,43.012298,-87.920453],
[13,42.959172,-87.922683],
[14,43.08411,-87.947087],
[15,43.007613,-88.221172],
[16,43.074878,-87.922854],
[17,43.028325,-87.909419],
[18,43.08841,-87.957117],
[19,42.575145,-88.200015],
[20,43.20548,-88.156139],
[21,43.089919,-87.952578],
[22,42.578313,-87.835552],
[23,44.475564,-88.855955],
[24,43.033751,-87.908375],
[25,43.018233,-87.983427],
[26,42.708372,-87.791437],
[27,43.605657,-88.521556],
[28,43.068039,-87.984644],
[29,43.120069,-88.02597],
[30,42.512295,-88.118546],
[31,43.021978,-87.909791],
[32,42.593017,-87.852616],
[33,43.089969,-88.011355],
[34,43.339912,-88.452006],
[35,43.027063,-87.907785],
[36,43.077829,-87.953848],
[37,43.177641,-88.022388],
[38,44.261815,-88.412594],
[39,44.326611,-88.35331],
[40,43.053911,-87.962394],
[41,43.091591,-87.95496],
[42,42.566298,-87.865203],
[43,43.207754,-87.924199],
[44,42.705527,-87.793668],
[45,43.092967,-87.980383],
[46,44.363728,-88.352264],
[47,42.494728,-87.952389],
[48,43.071944,-87.964419],
[49,42.697769,-87.88184],
[50,43.078664,-87.940991],
[51,42.715975,-87.79911],
[52,43.086218,-87.971484],
[53,42.702547,-87.826294],
[54,42.718037,-87.792728],
[55,42.694136,-87.95684],
[56,43.018534,-87.933081],
[57,43.067932,-87.960194],
[58,43.112797,-87.963677],
[59,42.558324,-87.83517],
[60,43.078406,-88.066639],
[61,42.999371,-87.969281],
[62,43.083689,-87.968481],
[63,42.579651,-88.227255],
[64,43.369989,-88.277766],
[65,43.082976,-87.967119],
[66,43.112341,-88.066992],
[67,44.260256,-88.418418],
[68,43.010448,-88.127216],
[69,43.018224,-87.983474],
[70,42.94975,-87.980284],
[71,43.070435,-87.92673],
[72,43.083683,-87.922254],
[73,42.741287,-88.705762],
[74,43.074175,-87.942338],
[75,43.008135,-87.936727],
[76,42.959172,-87.922662],
[77,43.111085,-87.982471],
[78,42.988342,-88.226055],
[79,42.988342,-88.226006],
[80,42.516522,-88.098194],
[81,42.705161,-87.792516],
[82,43.123478,-88.022011],
[83,44.262178,-88.378612],
[84,42.930038,-87.862314],
[85,43.105973,-87.947359],
[86,42.93572,-88.16294],
[87,43.013454,-87.91983],
[88,44.24285,-88.345014],
[89,43.065295,-87.982045],
[90,43.008542,-88.192821],
[91,42.829648,-87.950726],
[92,43.049032,-87.959585],
[93,43.050897,-87.957625],
[94,43.060625,-87.961481],
[95,42.922744,-87.908478],
[96,43.086681,-88.031995],
[97,43.021394,-87.961822],
[98,43.079494,-87.918495],
[99,43.079805,-87.915113],
[100,43.002426,-87.926019]];

var citymap = {};
citymap['#167417 '] = {center: new google.maps.LatLng(43.115275,-87.333823),population: 1}; //Green
citymap['#E97038 '] = {center: new google.maps.LatLng(43.000915,-87.658089),population: 2}; //Orange
citymap['#290CD1 '] = {center: new google.maps.LatLng(43.037409,-17.913571),    population: 2000}; //Blue



var cityCircle;

  function initialize() {{{{

        mapDiv = document.getElementById('map-canvas');

        map = new google.maps.Map(mapDiv, {

      center: new google.maps.LatLng(42.1250353571429,-88.00606),
          zoom: 7,
          mapTypeId: google.maps.MapTypeId.ROADMAP
        });

        markMultiple();
      }


  for (var city in citymap) {
    // Construct the circle for each value in citymap. 
    var populationOptions = {
      strokeColor: '#FF0000',
      strokeOpacity: 0.8,
      strokeWeight: 2,
      fillColor: city.substring(0,7),
      fillOpacity: 0.35,
      map: map,
      center: citymap[city].center,
      radius: 8046//5 Mile Radius
    };
    cityCircle = new google.maps.Circle(populationOptions);


// Remove Circles on click.

     google.maps.event.addListener(cityCircle, 'click', function() {
      this.setMap(null);
  });


  }

       var path = [


    new google.maps.LatLng(43.168487,-88.365784),
    new google.maps.LatLng(43.157469,-88.428268),
    new google.maps.LatLng(43.121394,-88.415909),
    new google.maps.LatLng(43.076271,-88.406296),
    new google.maps.LatLng(43.034627,-88.409042),
    new google.maps.LatLng(43.018062,-88.343811),
    new google.maps.LatLng(42.956784,-88.307419),
    new google.maps.LatLng(42.974370,-88.192749),
    new google.maps.LatLng(42.899971,-88.186569),
    new google.maps.LatLng(42.877332,-88.152924)


];


       var path1 = [

    new google.maps.LatLng(43.396426,-87.856293),
    new google.maps.LatLng(43.402413,-87.998428),
    new google.maps.LatLng(43.348011,-88.007355),
    new google.maps.LatLng(43.349509,-88.099365),
    new google.maps.LatLng(42.883732,-88.606110),
    new google.maps.LatLng(42.876687,-88.301239),
    new google.maps.LatLng(42.489030,-88.312225),
    new google.maps.LatLng(42.488017,-87.946930)
];


        var line = new google.maps.Polyline({
          path: path,
          strokeColor: 'FE2D2D',// Purposely blanked out
          strokeOpacity: 1.0,
          strokeWeight: 4
        });

        line.setMap(map);

   var line1 = new google.maps.Polyline({
          path: path1,
          strokeColor: '30F81E',// Purposely blanked out
          strokeOpacity: 1.0,
          strokeWeight: 4
        });

        line1.setMap(map);
         }
         }
         }

      function markMultiple(x){

        //$.getJSON('test.json', function(data) {
        //  $.each(data, function() {
        //    var latLng =  new google.maps.LatLng(data.lat,data.lng);
        //    var content = data.id + ':' + data.lat + ',' + data.lng;
        //    markMap(latLng, content);
        //  });
        //});

        for (var i = 0; i &lt; locations.length; i++) {



          var loc = locations[i];
          var latLng =  new google.maps.LatLng(loc[1],loc[2]);
          var content = loc[0] + ":" + loc[1] + "," + loc[2];
          markMap(latLng, content);
        }

       var markerCluster = new MarkerClusterer(map, markers);
      }

      function markMap(position, content){
        var marker = new google.maps.Marker({
          position: position
        });
        google.maps.event.addListener(marker, 'click', function() {
          infowindow.setContent(content);
          infowindow.open(map, marker);
        });

        markers.push(marker);
      }




// Add a marker to the map and push to the array.
function addMarker(location) {
  var marker = new google.maps.Marker({
    position: location,
    map: map
  });
  markers.push(marker);
}

// Sets the map on all markers in the array.
function setAllMap(map) {
  for (var i = 0; i &lt; markers.length; i++) {
    markers[i].setMap(map);
  }
}

// Removes the overlays from the map, but keeps them in the array.
function clearOverlays() {
  setAllMap(null);
}

// Shows any overlays currently in the array.
function showOverlays() {
  setAllMap(map);
}

// Deletes all markers in the array by removing references to them.
function deleteOverlays() {
  clearOverlays();
  markers = [];
}

google.maps.event.addDomListener(window, 'load', initialize);

    &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
    &lt;div id="panel"&gt;
      &lt;input onclick="clearOverlays();" type=button value="Hide Overlays"&gt;
      &lt;input onclick="Clear();" type=button value="Show All Overlays"&gt;
      &lt;input onclick="deleteOverlays();" type=button value="Delete Overlays"&gt;
    &lt;/div&gt;
 &lt;div id="map-canvas" style="width: 1400px; height: 1000px"&gt;&lt;/div&gt;
    &lt;p&gt;Click on the map to add markers.&lt;/p&gt;
  &lt;/body&gt;
&lt;/html&gt;
</code></pre>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/javascript-dhtml-ajax/117">JavaScript / DHTML / AJAX</category>
			<dc:creator>moone009</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/456506/google-maps-removing-all-markersclusters</guid>
		</item>
				<item>
			<title>JQuery Validation script not executing</title>
			<link>http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/456432/jquery-validation-script-not-executing</link>
			<pubDate>Tue, 11 Jun 2013 20:45:44 +0000</pubDate>
			<description>I am working with JQuery Validation plugin and am having trouble validating the form. The following is a live version of my form: http://demcode.3eeweb.com/ The following is the code for my index.php file: &lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;&gt; &lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; xml:lang=&quot;en-US&quot; lang=&quot;en-US&quot;&gt; &lt;head&gt; &lt;title&gt;DemCodeLines&lt;/title&gt; &lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; ...</description>
			<content:encoded><![CDATA[ <p>I am working with JQuery Validation plugin and am having trouble validating the form.<br />
The following is a live version of my form: <a href="http://demcode.3eeweb.com/" rel="nofollow">http://demcode.3eeweb.com/</a></p>

<p>The following is the code for my index.php file:</p>

<pre><code class="language-js">&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "<a href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" rel="nofollow">http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd</a>"&gt;
&lt;html xmlns="<a href="http://www.w3.org/1999/xhtml" rel="nofollow">http://www.w3.org/1999/xhtml</a>" xml:lang="en-US" lang="en-US"&gt;
&lt;head&gt;
&lt;title&gt;DemCodeLines&lt;/title&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"&gt;
&lt;script type="text/javascript" src="<a href="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.js" rel="nofollow">http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.js</a>"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="<a href="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js" rel="nofollow">http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js</a>"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="<a href="http://code.jquery.com/ui/1.9.2/jquery-ui.js" rel="nofollow">http://code.jquery.com/ui/1.9.2/jquery-ui.js</a>"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="<a href="http://demcode.3eeweb.com/jquery.validate.js" rel="nofollow">http://demcode.3eeweb.com/jquery.validate.js</a>"&gt;&lt;/script&gt;
&lt;link type="text/css" rel="stylesheet" href="<a href="http://demcode.3eeweb.com/jquery.validate.css" rel="nofollow">http://demcode.3eeweb.com/jquery.validate.css</a>" /&gt;
&lt;link type="text/css" rel="stylesheet" href="<a href="http://demcode.3eeweb.com/main.css" rel="nofollow">http://demcode.3eeweb.com/main.css</a>" /&gt;
&lt;script type="text/javascript"&gt;
$(document).ready(function(){
   $("#signUpHome").validate({
      rules: {
        signUpname: {
            required: true
        },
        signUppassword: {
            required: true
        },
        birthMonth: {
            required: true
        },
        birthDate: {
            required: true
        },
        birthMonth: {
            required: true
        },
        signUpemail: {
            required: true,
            email: true,
            remote: {
                url: "/validate.php",
                type: "POST",
                data: {
                    signUpemail: function(){ console.log("DONE!"); return $('#signUpemail').val(); }
                }
            }
         }
      },
      messages: {
         signUpemail: "Required Field"
      }
   });
});
&lt;/script&gt;
&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;

email in the database: test7@gmail.com

        &lt;form id="signUpHome" method="POST" action=""&gt;
            &lt;label id="frontPageSignUpName"&gt;Full Name:
                &lt;input class="text fancyText frontPageSignUpComponent" id="signUpname" name="signUpname" type="text"&gt;
            &lt;/label&gt;&lt;br&gt;
            &lt;label id="frontPageSignUpEmail"&gt;Email:
                &lt;input class="text fancyText frontPageSignUpComponent" id="signUpemail" name="signUpemail" type="text"&gt;
            &lt;/label&gt;&lt;br&gt;
            &lt;label id="frontPageSignUpPassword"&gt;Password:
                &lt;input class="text fancyText frontPageSignUpComponent" name="signUppassword" id="signUppassword" type="password"&gt;
            &lt;/label&gt;&lt;br&gt;
            &lt;label id="frontPageSignUpBirthdate"&gt;Birthday:&lt;/label&gt;
            &lt;select name="DateOfBirth_Month" id="birthMonth" style="vertical-align: bottom;margin-top:5px;"&gt;
                &lt;option value="0"&gt;Month&lt;/option&gt;
                &lt;option value="1"&gt;January&lt;/option&gt;&lt;option value="2"&gt;February&lt;/option&gt;&lt;option value="3"&gt;March&lt;/option&gt;&lt;option value="4"&gt;April&lt;/option&gt;
                &lt;option value="5"&gt;May&lt;/option&gt;&lt;option value="6"&gt;June&lt;/option&gt;&lt;option value="7"&gt;July&lt;/option&gt;&lt;option value="8"&gt;August&lt;/option&gt;
                &lt;option value="9"&gt;September&lt;/option&gt;&lt;option value="10"&gt;October&lt;/option&gt;&lt;option value="11"&gt;November&lt;/option&gt;&lt;option value="12"&gt;December&lt;/option&gt;
            &lt;/select&gt;
            &lt;select name="DateOfBirth_Day" id="birthDate"&gt;
                &lt;option value="0"&gt;Day&lt;/option&gt;
                &lt;option value="1"&gt;1&lt;/option&gt;&lt;option value="2"&gt;2&lt;/option&gt;&lt;option value="3"&gt;3&lt;/option&gt;&lt;option value="4"&gt;4&lt;/option&gt;&lt;option value="5"&gt;5&lt;/option&gt;
                &lt;option value="6"&gt;6&lt;/option&gt;&lt;option value="7"&gt;7&lt;/option&gt;&lt;option value="8"&gt;8&lt;/option&gt;&lt;option value="9"&gt;9&lt;/option&gt;&lt;option value="10"&gt;10&lt;/option&gt;
                &lt;option value="11"&gt;11&lt;/option&gt;&lt;option value="12"&gt;12&lt;/option&gt;&lt;option value="13"&gt;13&lt;/option&gt;&lt;option value="14"&gt;14&lt;/option&gt;&lt;option value="15"&gt;15&lt;/option&gt;
                &lt;option value="16"&gt;16&lt;/option&gt;&lt;option value="17"&gt;17&lt;/option&gt;&lt;option value="18"&gt;18&lt;/option&gt;&lt;option value="19"&gt;19&lt;/option&gt;&lt;option value="20"&gt;20&lt;/option&gt;
                &lt;option value="21"&gt;21&lt;/option&gt;&lt;option value="22"&gt;22&lt;/option&gt;&lt;option value="23"&gt;23&lt;/option&gt;&lt;option value="24"&gt;24&lt;/option&gt;&lt;option value="25"&gt;25&lt;/option&gt;
                &lt;option value="26"&gt;26&lt;/option&gt;&lt;option value="27"&gt;27&lt;/option&gt;&lt;option value="28"&gt;28&lt;/option&gt;&lt;option value="29"&gt;29&lt;/option&gt;&lt;option value="30"&gt;30&lt;/option&gt;
                &lt;option value="31"&gt;31&lt;/option&gt;
            &lt;/select&gt;
            &lt;select name="DateOfBirth_Year" style="margin-right:8px" id="birthYear"&gt;
                &lt;option value="0"&gt;Year&lt;/option&gt;
                &lt;option value="2004"&gt;2004&lt;/option&gt;&lt;option value="2003"&gt;2003&lt;/option&gt;&lt;option value="2002"&gt;2002&lt;/option&gt;&lt;option value="2001"&gt;2001&lt;/option&gt;
                &lt;option value="2000"&gt;2000&lt;/option&gt;&lt;option value="1999"&gt;1999&lt;/option&gt;&lt;option value="1998"&gt;1998&lt;/option&gt;&lt;option value="1997"&gt;1997&lt;/option&gt;
                &lt;option value="1996"&gt;1996&lt;/option&gt;&lt;option value="1995"&gt;1995&lt;/option&gt;&lt;option value="1994"&gt;1994&lt;/option&gt;&lt;option value="1993"&gt;1993&lt;/option&gt;
                &lt;option value="1992"&gt;1992&lt;/option&gt;&lt;option value="1991"&gt;1991&lt;/option&gt;&lt;option value="1990"&gt;1990&lt;/option&gt;&lt;option value="1989"&gt;1989&lt;/option&gt;
                &lt;option value="1988"&gt;1988&lt;/option&gt;&lt;option value="1987"&gt;1987&lt;/option&gt;&lt;option value="1986"&gt;1986&lt;/option&gt;&lt;option value="1985"&gt;1985&lt;/option&gt;
                &lt;option value="1984"&gt;1984&lt;/option&gt;&lt;option value="1983"&gt;1983&lt;/option&gt;&lt;option value="1982"&gt;1982&lt;/option&gt;&lt;option value="1981"&gt;1981&lt;/option&gt;
                &lt;option value="1980"&gt;1980&lt;/option&gt;&lt;option value="1979"&gt;1979&lt;/option&gt;&lt;option value="1978"&gt;1978&lt;/option&gt;&lt;option value="1977"&gt;1977&lt;/option&gt;
                &lt;option value="1976"&gt;1976&lt;/option&gt;&lt;option value="1975"&gt;1975&lt;/option&gt;&lt;option value="1974"&gt;1974&lt;/option&gt;&lt;option value="1973"&gt;1973&lt;/option&gt;
                &lt;option value="1972"&gt;1972&lt;/option&gt;&lt;option value="1971"&gt;1971&lt;/option&gt;&lt;option value="1970"&gt;1970&lt;/option&gt;&lt;option value="1969"&gt;1969&lt;/option&gt;
                &lt;option value="1968"&gt;1968&lt;/option&gt;&lt;option value="1967"&gt;1967&lt;/option&gt;&lt;option value="1966"&gt;1966&lt;/option&gt;&lt;option value="1965"&gt;1965&lt;/option&gt;
                &lt;option value="1964"&gt;1964&lt;/option&gt;&lt;option value="1963"&gt;1963&lt;/option&gt;&lt;option value="1962"&gt;1962&lt;/option&gt;&lt;option value="1961"&gt;1961&lt;/option&gt;
                &lt;option value="1960"&gt;1960&lt;/option&gt;&lt;option value="1959"&gt;1959&lt;/option&gt;&lt;option value="1958"&gt;1958&lt;/option&gt;&lt;option value="1957"&gt;1957&lt;/option&gt;
                &lt;option value="1956"&gt;1956&lt;/option&gt;&lt;option value="1955"&gt;1955&lt;/option&gt;&lt;option value="1954"&gt;1954&lt;/option&gt;&lt;option value="1953"&gt;1953&lt;/option&gt;
                &lt;option value="1952"&gt;1952&lt;/option&gt;&lt;option value="1951"&gt;1951&lt;/option&gt;&lt;option value="1950"&gt;1950&lt;/option&gt;&lt;option value="1949"&gt;1949&lt;/option&gt;
                &lt;option value="1948"&gt;1948&lt;/option&gt;&lt;option value="1947"&gt;1947&lt;/option&gt;&lt;option value="1946"&gt;1946&lt;/option&gt;&lt;option value="1945"&gt;1945&lt;/option&gt;
                &lt;option value="1944"&gt;1944&lt;/option&gt;&lt;option value="1943"&gt;1943&lt;/option&gt;&lt;option value="1942"&gt;1942&lt;/option&gt;&lt;option value="1941"&gt;1941&lt;/option&gt;
                &lt;option value="1940"&gt;1940&lt;/option&gt;&lt;option value="1939"&gt;1939&lt;/option&gt;&lt;option value="1938"&gt;1938&lt;/option&gt;&lt;option value="1937"&gt;1937&lt;/option&gt;
                &lt;option value="1936"&gt;1936&lt;/option&gt;&lt;option value="1935"&gt;1935&lt;/option&gt;&lt;option value="1934"&gt;1934&lt;/option&gt;&lt;option value="1933"&gt;1933&lt;/option&gt;
                &lt;option value="1932"&gt;1932&lt;/option&gt;&lt;option value="1931"&gt;1931&lt;/option&gt;&lt;option value="1930"&gt;1930&lt;/option&gt;&lt;option value="1929"&gt;1929&lt;/option&gt;
                &lt;option value="1928"&gt;1928&lt;/option&gt;&lt;option value="1927"&gt;1927&lt;/option&gt;&lt;option value="1926"&gt;1926&lt;/option&gt;&lt;option value="1925"&gt;1925&lt;/option&gt;
                &lt;option value="1924"&gt;1924&lt;/option&gt;&lt;option value="1923"&gt;1923&lt;/option&gt;&lt;option value="1922"&gt;1922&lt;/option&gt;&lt;option value="1921"&gt;1921&lt;/option&gt;
                &lt;option value="1920"&gt;1920&lt;/option&gt;&lt;option value="1919"&gt;1919&lt;/option&gt;&lt;option value="1918"&gt;1918&lt;/option&gt;&lt;option value="1917"&gt;1917&lt;/option&gt;
                &lt;option value="1916"&gt;1916&lt;/option&gt;&lt;option value="1915"&gt;1915&lt;/option&gt;&lt;option value="1914"&gt;1914&lt;/option&gt;&lt;option value="1913"&gt;1913&lt;/option&gt;
                &lt;option value="1912"&gt;1912&lt;/option&gt;&lt;option value="1911"&gt;1911&lt;/option&gt;&lt;option value="1910"&gt;1910&lt;/option&gt;&lt;option value="1909"&gt;1909&lt;/option&gt;
                &lt;option value="1908"&gt;1908&lt;/option&gt;&lt;option value="1907"&gt;1907&lt;/option&gt;&lt;option value="1906"&gt;1906&lt;/option&gt;&lt;option value="1905"&gt;1905&lt;/option&gt;
                &lt;option value="1904"&gt;1904&lt;/option&gt;&lt;option value="1903"&gt;1903&lt;/option&gt;&lt;option value="1902"&gt;1902&lt;/option&gt;&lt;option value="1901"&gt;1901&lt;/option&gt;
                &lt;option value="1900"&gt;1900&lt;/option&gt;
            &lt;/select&gt;&lt;/label&gt;&lt;br&gt;&lt;br&gt;
            &lt;input type="submit" name="signUpSub" id="signUpSub" value="Sign Up"&gt;
        &lt;/form&gt;

&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>The following is the code for my validate.php file:</p>

<pre><code class="language-js">&lt;?php
$db = new PDO('mysql:host=mysql.2freehosting.com;dbname=...', '...', '...');
$db-&gt;setAttribute(PDO::ATTR_EMULATE_PREPARES, false);
$emailInput = $_POST['signUpEmailName'];
if ($emailInput!="") {
    $result = $db-&gt;prepare('SELECT * FROM People WHERE email=?');
    $result-&gt;execute(array($emailInput));
}
echo (count($result-&gt;fetchAll()) != 0);
?&gt;
</code></pre>

<p>The submit button works regardless of whether the data entered in the form is valid or not. The validation is not executing at all. More over, the validation for whether the email exists in the DB or not isn't working either.</p>

<p>What am I doing wrong?</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/javascript-dhtml-ajax/117">JavaScript / DHTML / AJAX</category>
			<dc:creator>saurabh2007</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/456432/jquery-validation-script-not-executing</guid>
		</item>
				<item>
			<title>Dynamic rows created with checkbox, only deletes if checkbox in first colum</title>
			<link>http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/456422/dynamic-rows-created-with-checkbox-only-deletes-if-checkbox-in-first-colum</link>
			<pubDate>Tue, 11 Jun 2013 16:58:49 +0000</pubDate>
			<description>Hello to everyone, my problem is, Im creating dynamacly rows in a table with a textfield and a checkbox, but to delete the rows the checkbox must be on the first column witch I dont get it, if I move the checkbox to the last column and press it, javascript ...</description>
			<content:encoded><![CDATA[ <p>Hello to everyone, my problem is, Im creating dynamacly rows in a table with a textfield and a checkbox, but to delete the rows the checkbox must be on the first column witch I dont get it, if I move the checkbox to the last column and press it, javascript associates that the checkbox is not checked! How can this be fixed? Do I need to loop through the elements of the row ?</p>

<p>This is the code to add a row:</p>

<pre><code>&lt;script&gt;

var intTextBox=0;
  $(function(){
    var tbl = $("#Tablei");

    $("#addRowBtn").click(function(){
        intTextBox = intTextBox + 1;
        var contentID = document.getElementById('content');
        var newTBDiv = document.createElement('div');
        newTBDiv.setAttribute('id','strText'+intTextBox);
        $("&lt;tr&gt;&lt;td&gt;&lt;input type='text' name='txt[]' id='"+intTextBox+"'&gt;&lt;/td&gt;&lt;td&gt;&lt;input type='checkbox' name='chk'/&gt;&lt;/td&gt;&lt;/tr&gt;").appendTo(tbl);  
        contentID.appendChild(newTBDiv); 

        });
    });    

&lt;/script&gt;
</code></pre>

<p>This is the code to delete a row:</p>

<pre><code>&lt;script&gt;
function myFunction(){
      try {
          var table = document.getElementById('Tablei');
          // var table = x.getAttribute("id");
          var rowCount = table.rows.length;

          for(var i=0; i&lt;rowCount; i++){
              var row = table.rows[i];
              var chkbox = row.cells[0].childNodes[0];

              if(null != chkbox &amp;&amp; true == chkbox.checked) {
                  alert("a");
                  if(rowCount &lt;= 1) {
                      alert("Cannot delete all the rows.");
                      break;
                  }
                  table.deleteRow(i);
                  rowCount--;
                  i--;
              }
           }
       }
       catch(e) {
           alert(e);
       }
}
&lt;/script&gt;
</code></pre>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/javascript-dhtml-ajax/117">JavaScript / DHTML / AJAX</category>
			<dc:creator>Dimonai</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/456422/dynamic-rows-created-with-checkbox-only-deletes-if-checkbox-in-first-colum</guid>
		</item>
				<item>
			<title>Count E-mails in textarea</title>
			<link>http://www.daniweb.com/web-development/javascript-dhtml-ajax/code/456362/count-e-mails-in-textarea</link>
			<pubDate>Mon, 10 Jun 2013 23:49:20 +0000</pubDate>
			<description>1) onkeyup send textarea values to script 2) converts textarea value to array 3) loops thru the array 4) uses regex to check if its an email address 5) changes inner html of recipient div</description>
			<content:encoded><![CDATA[ <p>1) onkeyup send textarea values to script<br />
2) converts textarea value to array<br />
3) loops thru the array<br />
4) uses regex to check if its an email address<br />
5) changes inner html of recipient div</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/javascript-dhtml-ajax/117">JavaScript / DHTML / AJAX</category>
			<dc:creator>tekagami</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/javascript-dhtml-ajax/code/456362/count-e-mails-in-textarea</guid>
		</item>
				<item>
			<title>Jquery add and remove classes</title>
			<link>http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/456357/jquery-add-and-remove-classes</link>
			<pubDate>Mon, 10 Jun 2013 20:30:32 +0000</pubDate>
			<description>Hi all I am trying to add a class selected to click area and a remove class in the hide area for the below jquery/javascript. Not really undstanding how it's added. Thanks in advaance D &lt;script type=&quot;text/javascript&quot;&gt; $(document).ready(function(){ $('.partner_image').click(function() { var id =$(this).class('selected'); var id = $(this).attr('id'); id = id.replace('partner_',''); ...</description>
			<content:encoded><![CDATA[ <p>Hi all I am trying to add a class selected to click area and a remove class in the hide area for the below jquery/javascript. Not really undstanding how it's added.</p>

<p>Thanks in advaance</p>

<p>D</p>

<pre><code class="language-js">  &lt;script type="text/javascript"&gt;
        $(document).ready(function(){
            $('.partner_image').click(function() {
               var id =$(this).class('selected');
               var id = $(this).attr('id');
               id = id.replace('partner_','');
               console.log(id);

              $('.partner_description').hide();
              var description = $('#partner_description_' + id);
              $(description).show();
                });

            });

        &lt;/script&gt;
</code></pre>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/javascript-dhtml-ajax/117">JavaScript / DHTML / AJAX</category>
			<dc:creator>davidjennings</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/456357/jquery-add-and-remove-classes</guid>
		</item>
				<item>
			<title>Drop Down Menu Create.</title>
			<link>http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/456349/drop-down-menu-create</link>
			<pubDate>Mon, 10 Jun 2013 16:59:29 +0000</pubDate>
			<description>I am a new web designer of joomla . I can design a joomla site but not create a drop down menu . Pls any body help me. Thanks Faruk</description>
			<content:encoded><![CDATA[ <p>I am a new web designer of joomla . I can design a joomla site but not create a drop down menu . Pls any body help me.</p>

<p>Thanks<br />
Faruk</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/javascript-dhtml-ajax/117">JavaScript / DHTML / AJAX</category>
			<dc:creator>mdomarfaruk</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/456349/drop-down-menu-create</guid>
		</item>
				<item>
			<title>Need help with onload and hidden Iframe</title>
			<link>http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/456299/need-help-with-onload-and-hidden-iframe</link>
			<pubDate>Mon, 10 Jun 2013 06:46:17 +0000</pubDate>
			<description>Had a question before that was partially solved. I'm having trouble getting just one part of it to work. preload = new Element('iframe', { 'src': URL, 'id': mediaId, width: mediaWidth, height: mediaHeight, scrolling : 'no', 'frameborder': 0 }); preload.style.visibility = 'hidden'; startEffect(); } So my issue is the preload.style.visibility = ...</description>
			<content:encoded><![CDATA[ <p>Had a question before that was partially solved. I'm having trouble getting just one part of it to work.</p>

<pre><code class="language-js">preload = new Element('iframe', {
                    'src': URL,
                     'id': mediaId,
                     width: mediaWidth,
                     height: mediaHeight,
                     scrolling : 'no',
                     'frameborder': 0
                    });
                preload.style.visibility = 'hidden'; 
                startEffect();
            }
</code></pre>

<p>So my issue is the preload.style.visibility = hidden.<br />
I'm trying to make it so iframe is hidden until completed. I think Onload is the right command for that. So what is the equivalent to the preload.style.visibility = 'hidden';  line to get it to work? Thanks!</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/javascript-dhtml-ajax/117">JavaScript / DHTML / AJAX</category>
			<dc:creator>sonicx2218</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/456299/need-help-with-onload-and-hidden-iframe</guid>
		</item>
				<item>
			<title>jQuery Toolbar Slide</title>
			<link>http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/456289/jquery-toolbar-slide</link>
			<pubDate>Mon, 10 Jun 2013 02:55:14 +0000</pubDate>
			<description>Is there a way to make a bottom toolbar slider like on this site: http://www.complex.com/ look at the bottom bar and click the arrows and it slide is there a way to do that?</description>
			<content:encoded><![CDATA[ <p>Is there a way to make a bottom toolbar slider like on this site:<br />
<a href="http://www.complex.com/" rel="nofollow">http://www.complex.com/</a><br />
look at the bottom bar and click the arrows and it slide is there a way to do that?</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/javascript-dhtml-ajax/117">JavaScript / DHTML / AJAX</category>
			<dc:creator>Cravver</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/456289/jquery-toolbar-slide</guid>
		</item>
				<item>
			<title>jquery not working</title>
			<link>http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/456263/jquery-not-working</link>
			<pubDate>Sun, 09 Jun 2013 14:25:09 +0000</pubDate>
			<description> &lt;html&gt; &lt;head&gt; &lt;script type=&quot;text/javascript&quot; src=&quot;js/jquery-1.4.3.min.js&quot;&gt;&lt;/script&gt; &lt;script&gt;$('.countryclassinfolink').click(function(event) { event.preventDefault(); var detailinfo = $(this).parent().next().html(); $('#country_details').html(detailinfo); $('.countryclassinfolink2').click(function(event) { event.preventDefault(); $('#country_details').html(''); $('#country_details').hide(); $('#country_seminars').fadeIn(); }); $('#country_seminars').hide(); $('#country_details').fadeIn(); }); &lt;/script&gt; &lt;/head&gt;&lt;body&gt; &lt;div class=&quot;section seminars&quot;&gt; &lt;h2&gt;&lt;span&gt;USA Seminars&lt;/span&gt;&lt;/h2&gt; &lt;div id=&quot;country_seminars&quot; class=&quot;body&quot;&gt; &lt;table&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td class=&quot;practioners&quot;&gt;&lt;p&gt; &lt;span class=&quot;date&quot;&gt;06/10/2013&lt;/span&gt; Niskayuna, NY&lt;br&gt; &lt;a class=&quot;countryclassinfolink&quot; href=&quot;#&quot;&gt;Advanced DNA&lt;/a&gt; &lt;/p&gt; &lt;div style=&quot;display:none;&quot; id=&quot;classdetails26436&quot;&gt; ...</description>
			<content:encoded><![CDATA[ <pre><code class="language-js">&lt;html&gt;
&lt;head&gt;
&lt;script type="text/javascript" src="js/jquery-1.4.3.min.js"&gt;&lt;/script&gt;

&lt;script&gt;$('.countryclassinfolink').click(function(event) {
        event.preventDefault();
        var detailinfo = $(this).parent().next().html();
        $('#country_details').html(detailinfo);
        $('.countryclassinfolink2').click(function(event) {
            event.preventDefault();
            $('#country_details').html('');
            $('#country_details').hide();
            $('#country_seminars').fadeIn();
        });
        $('#country_seminars').hide();
        $('#country_details').fadeIn();
    });
&lt;/script&gt;
&lt;/head&gt;&lt;body&gt;
&lt;div class="section seminars"&gt;
  &lt;h2&gt;&lt;span&gt;USA Seminars&lt;/span&gt;&lt;/h2&gt;
  &lt;div id="country_seminars" class="body"&gt;
    &lt;table&gt;
      &lt;tbody&gt;
        &lt;tr&gt;
          &lt;td class="practioners"&gt;&lt;p&gt; &lt;span class="date"&gt;06/10/2013&lt;/span&gt; Niskayuna, NY&lt;br&gt;
              &lt;a class="countryclassinfolink" href="#"&gt;Advanced DNA&lt;/a&gt; &lt;/p&gt;
            &lt;div style="display:none;" id="classdetails26436"&gt;
              &lt;div class="searchresults result" style="border-bottom: none;width:650px;"&gt;&lt;a style="float:right;" class="countryclassinfolink2" href="#"&gt;Return&lt;/a&gt;
                &lt;div class="resultheader"&gt;
                  &lt;div style="background-image:none;float:none;" class="name"&gt;Advanced DNA&lt;/div&gt;
                  &lt;div style="background-image:none;" class="name"&gt;Anana Integre&lt;/div&gt;
                  &lt;div class="icon"&gt;&lt;img src="images/practitioner-icon.gif"&gt;&lt;/div&gt;
                  &lt;div class="icon"&gt;&lt;img src="images/instructor-icon.gif"&gt;&lt;/div&gt;
                &lt;/div&gt;
                &lt;div class="image"&gt;&lt;img border="0" alt="" src="/images/specialistImages/thumb_1294779133.jpg"&gt;&lt;/div&gt;
                &lt;div style="width: 400px;" class="info"&gt;
                  &lt;table&gt;
                    &lt;tbody&gt;
                      &lt;tr&gt;
                        &lt;td style="border:0;"&gt;Niskayuna, NY&lt;br&gt;
                          &lt;strong&gt;Phone:&lt;/strong&gt;&lt;br&gt;
                          831-246-1790&lt;br&gt;
                          &lt;strong&gt;Email:&lt;/strong&gt;&lt;br&gt;
                          &lt;a href="mailTo:miraclewrkr@gmail.com"&gt;miraclewrkr@gmail.com&lt;/a&gt;&lt;br&gt;
                          &lt;strong&gt;Website:&lt;/strong&gt;&lt;br&gt;
                          &lt;a target="_blank" href="<a href="http://www.thetahealingwitness.com" rel="nofollow">http://www.thetahealingwitness.com</a>"&gt;www.thetahealingwitness.com&lt;/a&gt;&lt;br&gt;
                          &lt;strong&gt;Cost:&lt;/strong&gt;&lt;br&gt;
                          $&amp;nbsp;575.00&lt;br&gt;
                          &lt;strong&gt;Notes:&lt;/strong&gt;&lt;br&gt;
                          &lt;br&gt;&lt;/td&gt;
                        &lt;td style="border:0;"&gt;&lt;strong&gt;Dates:&lt;/strong&gt;&lt;br&gt;
                          06/10/2013&lt;br&gt;
                          06/12/2013&lt;br&gt;&lt;/td&gt;
                      &lt;/tr&gt;
                    &lt;/tbody&gt;
                  &lt;/table&gt;
                &lt;/div&gt;
              &lt;/div&gt;
            &lt;/div&gt;
            &lt;/td&gt;
          &lt;td class="filler"&gt;&lt;/td&gt;
        &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
  &lt;div style="display: none;" id="country_details" class="body"&gt;&lt;/div&gt;
  &lt;div class="bottom"&gt;&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;/body&gt;&lt;/html&gt;
</code></pre>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/javascript-dhtml-ajax/117">JavaScript / DHTML / AJAX</category>
			<dc:creator>vishal.du123</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/456263/jquery-not-working</guid>
		</item>
				<item>
			<title>Web Server Client synchronization in javascript</title>
			<link>http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/456250/web-server-client-synchronization-in-javascript</link>
			<pubDate>Sun, 09 Jun 2013 09:53:27 +0000</pubDate>
			<description>Hello guys, I would like to know how client browser send data to server whithout refreshing the page (just like chat in facebook)? I have searched in google but I found alot of tutorials but non of them told me what is the basic idea about web server client synchronization? ...</description>
			<content:encoded><![CDATA[ <p>Hello guys, I would like to know how client browser send data to server whithout refreshing the page (just like chat in facebook)?<br />
I have searched in google but I found alot of tutorials but non of them told me what is the basic idea about web server client synchronization? what is the basic functions in javascript used to do this?<br />
I just want to know what is the functions used to send and reseive data between client browser and server.</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/javascript-dhtml-ajax/117">JavaScript / DHTML / AJAX</category>
			<dc:creator>Rasool Ahmed</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/456250/web-server-client-synchronization-in-javascript</guid>
		</item>
				<item>
			<title>backbone - getting 2 collections in one query</title>
			<link>http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/456245/backbone-getting-2-collections-in-one-query</link>
			<pubDate>Sun, 09 Jun 2013 07:55:18 +0000</pubDate>
			<description>Hello, lets say I have to collections - x and y. I know that - when first collection is updated, the second collection has new data and also needs to be updated. So I now did x.fetch and y.fetcg which generates 2 ajax queries. BUt such things when I used ...</description>
			<content:encoded><![CDATA[ <p>Hello,</p>

<p>lets say I have to collections - x and y. I know that - when first collection is updated, the second collection has new data and also needs to be updated.</p>

<p>So I now did x.fetch and y.fetcg which generates 2 ajax queries.</p>

<p>BUt such things when I used to do without backbone - I just send one quyery and it returrs 2 arrays.<br />
I think its more optimal to use one query, becuase sending takes time. Of course thats not a big issue in my case, but still its bit weird when you are forced to do things in less optimal way.</p>

<p>How do you solve this?</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/javascript-dhtml-ajax/117">JavaScript / DHTML / AJAX</category>
			<dc:creator>SPeed_FANat1c</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/456245/backbone-getting-2-collections-in-one-query</guid>
		</item>
				<item>
			<title>first statement work but second statement is not in jquery</title>
			<link>http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/456233/first-statement-work-but-second-statement-is-not-in-jquery</link>
			<pubDate>Sun, 09 Jun 2013 01:56:10 +0000</pubDate>
			<description>for class countryclassinfolink: `$(&quot;.classcard&quot;).fadeOut(&quot;slow&quot;);` is working `$(&quot;.classdetails&quot;).fadein(&quot;slow&quot;);`is not working &lt;html&gt; &lt;head&gt; &lt;style&gt; .section { background: none repeat scroll 0 0 #FFFFFF; border-radius: 10px 10px 0 0; margin: 0 0 30px; width: 725px; padding: 0 0 20px; position: relative; z-index: 100; } .section.seminars .theta_wrap { border-bottom: 1px solid #A6CBD9; float: left; ...</description>
			<content:encoded><![CDATA[ <p>for class countryclassinfolink:</p>

<p><code>$(".classcard").fadeOut("slow");</code> is working<br /><code>$(".classdetails").fadein("slow");</code>is not working</p>

<pre><code class="language-js">&lt;html&gt;
    &lt;head&gt;
    &lt;style&gt;
    .section {
        background: none repeat scroll 0 0 #FFFFFF;
        border-radius: 10px 10px 0 0;
        margin: 0 0 30px;
        width: 725px;
        padding: 0 0 20px;
        position: relative;
        z-index: 100;
    }
    .section.seminars .theta_wrap {
        border-bottom: 1px solid #A6CBD9;
        float: left;
        font-size: 13px;
        margin: 5px 15px;
        padding: 10px 3px 5px;
        width: 197px;
    }
    &lt;/style&gt;
    &lt;script type="text/javascript" src="<a href="http://code.jquery.com/jquery-1.8.0.min.js" rel="nofollow">http://code.jquery.com/jquery-1.8.0.min.js</a>"&gt;&lt;/script&gt;
    &lt;script type="text/javascript"&gt;
    $(document).ready(function(){
        $(".countryclassinfolink").click(function () {
            $(".classcard").fadeOut("slow");
            $(".classdetails").fadein("slow");
        });

        $(".countryclassinfolink2").click(function(){
            $(".classdetails").fadeOut("slow");
            $(".classcard").fadein("slow");                                            
        });
    });

    &lt;/script&gt;
    &lt;/head&gt;
    &lt;body&gt;
    &lt;div class="section seminars"&gt;
      &lt;h2&gt;&lt;span&gt;USA Seminars&lt;/span&gt;&lt;/h2&gt;
      &lt;div id="country_seminars" class="body" style="display: block;"&gt;
        &lt;div class="theta_wrap"&gt;
          &lt;div class="practioners"&gt;
            &lt;div class="classcard" id=""&gt;
              &lt;p&gt; &lt;span class="date"&gt;06/10/2013&lt;/span&gt; Niskayuna, NY&lt;br&gt;
                &lt;a class="countryclassinfolink" href="#"&gt;Advanced DNA&lt;/a&gt; &lt;/p&gt;
            &lt;/div&gt;
            &lt;div style="display:none;" class="classdetails" id=""&gt;
              &lt;div class="searchresults result" style="border-bottom: none;width:650px;"&gt;&lt;a style="float:right;" class="countryclassinfolink2" href="#"&gt;Return&lt;/a&gt;
                &lt;div class="resultheader"&gt;
                  &lt;div style="background-image:none;float:none;" class="name"&gt;Advanced DNA&lt;/div&gt;
                  &lt;div style="background-image:none;" class="name"&gt;Anana Integre&lt;/div&gt;
                  &lt;div class="icon"&gt;&lt;img src="images/practitioner-icon.gif"&gt;&lt;/div&gt;
                  &lt;div class="icon"&gt;&lt;img src="images/instructor-icon.gif"&gt;&lt;/div&gt;
                &lt;/div&gt;
                &lt;div class="image"&gt;&lt;img border="0" alt="" src="/images/specialistImages/thumb_1294779133.jpg"&gt;&lt;/div&gt;
                &lt;div style="width: 400px;" class="info"&gt;
                  &lt;div class="text_desc_div"&gt;Niskayuna, NY&lt;br&gt;
                    &lt;strong&gt;Phone:&lt;/strong&gt;&lt;br&gt;
                    831-246-1790&lt;br&gt;
                    &lt;strong&gt;Email:&lt;/strong&gt;&lt;br&gt;
                    &lt;a href="mailTo:miraclewrkr@gmail.com"&gt;miraclewrkr@gmail.com&lt;/a&gt;&lt;br&gt;
                    &lt;strong&gt;Website:&lt;/strong&gt;&lt;br&gt;
                    &lt;a target="_blank" href="<a href="http://www.thetahealingwitness.com" rel="nofollow">http://www.thetahealingwitness.com</a>"&gt;www.thetahealingwitness.com&lt;/a&gt;&lt;br&gt;
                    &lt;strong&gt;Cost:&lt;/strong&gt;&lt;br&gt;
                    $&amp;nbsp;575.00&lt;br&gt;
                    &lt;strong&gt;Notes:&lt;/strong&gt;&lt;br&gt;
                    &lt;br&gt;
                    &lt;strong&gt;Dates:&lt;/strong&gt;&lt;br&gt;
                    06/10/2013&lt;br&gt;
                    06/12/2013&lt;br&gt;
                  &lt;/div&gt;
                  &lt;!-- text desc part--&gt;
                &lt;/div&gt;
              &lt;/div&gt;
            &lt;/div&gt;
            &lt;!--Hide part--&gt;
          &lt;/div&gt;
        &lt;/div&gt;
        &lt;div class="clear"&gt;&lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;/body&gt;
    &lt;/html&gt;
</code></pre>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/javascript-dhtml-ajax/117">JavaScript / DHTML / AJAX</category>
			<dc:creator>vishal.du123</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/456233/first-statement-work-but-second-statement-is-not-in-jquery</guid>
		</item>
				<item>
			<title>Refresh Javascript RSS Feed without flickering</title>
			<link>http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/456224/refresh-javascript-rss-feed-without-flickering</link>
			<pubDate>Sat, 08 Jun 2013 19:34:09 +0000</pubDate>
			<description>Hello, I have the following RSS feed: [RSS Feed](http://rss.nuvini.com/list/feed2js/feed2js.php?src=http%3A%2F%2Frss.nuvini.com%2Fpublic.php%3Fop%3Drss%26id%3D-1027%26key%3D19a8dbb063bf0c30d5e74c5fb619f33255a027db&amp;num=15&amp;tz=+2&amp;targ=y&amp;utf=y) I load this feed like this: file: rss2.php &lt;head&gt; &lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;rss.css&quot; media=&quot;screen&quot; /&gt; &lt;/head&gt; &lt;body style=&quot;margin: 0px;&quot;&gt; &lt;div id=&quot;RSS_Feed&quot;&gt; &lt;script language=&quot;JavaScript&quot; src=&quot;http://rss.nuvini.com/list/feed2js/feed2js.php?src=http%3A%2F%2Frss.nuvini.com%2Fpublic.php%3Fop%3Drss%26id%3D-1027%26key%3D19a8dbb063bf0c30d5e74c5fb619f33255a027db&amp;num=15&amp;tz=+2&amp;targ=y&amp;utf=y&quot; charset=&quot;UTF-8&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt; &lt;/div&gt; &lt;/body&gt; Now what I want to do, is automatically refresh this page. I tried ...</description>
			<content:encoded><![CDATA[ <p>Hello,</p>

<p>I have the following RSS feed: <a href="http://rss.nuvini.com/list/feed2js/feed2js.php?src=http%3A%2F%2Frss.nuvini.com%2Fpublic.php%3Fop%3Drss%26id%3D-1027%26key%3D19a8dbb063bf0c30d5e74c5fb619f33255a027db&amp;num=15&amp;tz=+2&amp;targ=y&amp;utf=y" rel="nofollow">RSS Feed</a><br />
I load this feed like this:<br />
file: rss2.php</p>

<pre><code class="language-js">&lt;head&gt;
&lt;link rel="stylesheet" type="text/css" href="rss.css" media="screen" /&gt;
&lt;/head&gt;
&lt;body style="margin: 0px;"&gt;

&lt;div id="RSS_Feed"&gt;
&lt;script language="JavaScript" src="<a href="http://rss.nuvini.com/list/feed2js/feed2js.php?src=http%3A%2F%2Frss.nuvini.com%2Fpublic.php%3Fop%3Drss%26id%3D-1027%26key%3D19a8dbb063bf0c30d5e74c5fb619f33255a027db&amp;num=15&amp;tz=+2&amp;targ=y&amp;utf=y" rel="nofollow">http://rss.nuvini.com/list/feed2js/feed2js.php?src=http%3A%2F%2Frss.nuvini.com%2Fpublic.php%3Fop%3Drss%26id%3D-1027%26key%3D19a8dbb063bf0c30d5e74c5fb619f33255a027db&amp;num=15&amp;tz=+2&amp;targ=y&amp;utf=y</a>"  charset="UTF-8" type="text/javascript"&gt;&lt;/script&gt;
&lt;/div&gt;
&lt;/body&gt;
</code></pre>

<p>Now what I want to do, is automatically refresh this page. I tried to do this with a <a href="http://www.htmlcodetutorial.com/document/index_tagsupp_4.html" rel="nofollow">meta</a> tag, but this gives flickering when it refreshes.</p>

<p>Now what I want to do, is check for updates in the RSS feed, say, every 1 minute. If there are updates, I want it to display the latest feed, but I don't want it to flicker.<br />
I understood that the way to do this is through javascript/jquery/AJAX. My knowledge of those is pretty much nonexistant, so I googled quite a bit and found some tutorials and such, but nothing seems to work the way I want for me. In the end I think at some point I had something that did refresh fine but it didn't load the CSS so I was missing the layout.</p>

<p>Besides the rss2 file I also have rss-testing.php, this is what I have right now whilst trying, but it's not working at all for me:</p>

<pre><code class="language-js">&lt;head&gt;
&lt;link rel="stylesheet" type="text/css" href="rss.css" media="screen" /&gt;
&lt;script language="javascript"&gt;
function loadPageContents() {
  var AJAX = XMLHTTPRequest();
  AJAX.open('GET','rss2.php',true);
  AJAX.onreadystatechange = function() {
    if(this.readyState==4 &amp;&amp; this.responseText) {
      document.getElementById('RSS_Feed').innerHTML = this.responseText;
      loadingPage = setTimeout('loadPageContents()',5000);
    }
  }
  AJAX.send(null);
}
&lt;/script&gt;
&lt;/head&gt;

&lt;body style="margin: 0px;"&gt;
&lt;script language="JavaScript"&gt;
window.onload = function () {
        var loadingPage = setTimeout('loadPageContents()',5000);
}

&lt;div id="RSS_Feed"&gt;
&lt;/div&gt;




&lt;/body&gt;
</code></pre>

<p>If anyone knows how to achieve this, that would be awesome.</p>

<p>If it helps, this is the code that did some refreshing without flickering (that I could see) but it missed the CSS.</p>

<pre><code class="language-js">&lt;head&gt;
&lt;link rel="stylesheet" type="text/css" href="rss.css" media="screen" /&gt;
&lt;script language="javascript" src="js/jquery-2.0.1.min.js"&gt;&lt;/script&gt;
&lt;/head&gt;

&lt;body style="margin: 0px;"&gt;

&lt;script language="javascript"&gt;
$(function() {
    startRefresh();
});

function startRefresh() {
    setTimeout(startRefresh,5000);
    $.get('rss2.php', function(data) {
    $('#RSS_Feed').html(data);
    });
}
&lt;/script&gt;
&lt;div id="RSS_Feed"&gt;
&lt;/div&gt;




&lt;/body&gt;
</code></pre>

<p>Thanks!</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/javascript-dhtml-ajax/117">JavaScript / DHTML / AJAX</category>
			<dc:creator>KamiNuvini</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/456224/refresh-javascript-rss-feed-without-flickering</guid>
		</item>
				<item>
			<title>jQuery and CSS problem</title>
			<link>http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/456217/jquery-and-css-problem</link>
			<pubDate>Sat, 08 Jun 2013 16:49:37 +0000</pubDate>
			<description>I am a newbie at jQuery. I have a page with both a jQuery datepicker and jQuery tabs. I have changed the default settings of jQuery tabs CSS by overriding certain properties in a separate CSS file. The tabs are placed in a div (with an id = &quot;ClassTabs&quot;) and ...</description>
			<content:encoded><![CDATA[ <p>I am a newbie at jQuery. I have a page with both a jQuery datepicker and jQuery tabs. I have changed the default settings of jQuery tabs CSS by overriding certain properties in a separate CSS file. The tabs are placed in a div (with an id = "ClassTabs") and the CSS specifies that the change should only be implemented within that id. But the default settings of the jQuery datepicker is also getting changed, even though it is outside the div.</p>

<p>Here's the CSS that I am overriding :</p>

<pre><code class="language-js">   #ClassTabs {
    width:200px; padding:5px; border:1px solid #636363;
    }
    #ClassTabs .ui-widget-header {
    border:0;  font-family:Georgia; 
    }
    #ClassTabs .ui-widget-content {
    border:1px solid #000; font-size:60%;
    }
    #ClassTabs .ui-state-default, #ClassTabs .ui-widget-content .ui-state-default {
    font-size:60%;
    }
    #ClassTabs .ui-state-active, #ClassTabs .ui-widget-content .ui-state-active {
    border:1px solid #aaa; 
    }
</code></pre>

<p>Here's the Code for the jQuery tabs</p>

<pre><code class="language-js">&lt;div id="ClassTabs" style="margin-left:80px; width:90%"&gt;
        &lt;ul&gt;
            &lt;li&gt;&lt;a href="#ExtraCurri"&gt;Extracurricular&lt;/a&gt;&lt;/li&gt; 
            &lt;li&gt;&lt;a href="#Discipline"&gt;Disciplinary&lt;/a&gt;&lt;/li&gt; 
            &lt;li&gt;&lt;a href="#Leave"&gt;Leave&lt;/a&gt;&lt;/li&gt; 
            &lt;li&gt;&lt;a href="#NCC"&gt;NCC&lt;/a&gt;&lt;/li&gt; 
            &lt;li&gt;&lt;a href="#Family"&gt;Family&lt;/a&gt;&lt;/li&gt; 
            &lt;li&gt;&lt;a href="#Address"&gt;Address&lt;/a&gt;&lt;/li&gt; 
            &lt;li&gt;&lt;a href="#Guardian"&gt;Guardian&lt;/a&gt;&lt;/li&gt; 
            &lt;li&gt;&lt;a href="#PrevSchool"&gt;Previous School&lt;/a&gt;&lt;/li&gt; 
            &lt;li&gt;&lt;a href="#Misc"&gt;Miscellaneous&lt;/a&gt;&lt;/li&gt; 
        &lt;/ul&gt;
        &lt;div id="ExtraCurri"&gt;Extra Curricular Records&lt;/div&gt;
        &lt;div id="Discipline"&gt;Disciplinary Records&lt;/div&gt;
        &lt;div id="Leave"&gt;&lt;/div&gt;
        &lt;div id="NCC"&gt;&lt;/div&gt;
        &lt;div id="Family"&gt;&lt;/div&gt;
        &lt;div id="Address"&gt;&lt;/div&gt;
        &lt;div id="Guardian"&gt;&lt;/div&gt;
        &lt;div id="PrevSchool"&gt;&lt;/div&gt;
        &lt;div id="Misc"&gt;&lt;/div&gt;
    &lt;/div&gt;
    &lt;script&gt; 
        (function($){
            $("#ClassTabs").tabs();
            }                    
        )(jQuery);
    &lt;/script&gt;  
&lt;/div&gt;
</code></pre>

<p>and the code for the datepicker, which is in a table, outside the "ClassTabs" div.</p>

<pre><code class="language-js">&lt;td class="Dta"&gt;&lt;input type="text" name="dtDOA" id="dtDOA" size="12"&gt;
    &lt;script&gt;             
        (function($){
            var dtDOAOpts = {
                    changeMonth: true,
                    changeYear: true,
                    yearRange: "-19:+0",
                    dateFormat: "dd/mm/yy",
                    minDate: "-19y",
                    maxDate: new Date()
                };
            $("#dtDOA").datepicker(dtDOAOpts);                                    
        })(jQuery);
    &lt;/script&gt;
&lt;/td&gt; 
</code></pre>

<p>I think as I am specifying that the overridden styles should only affect the elements that are within the div with id "ClassTabs", the default settings of datepicker should be unaffected. Unfortunately it is getting messed up.</p>

<p>Can anyone guide me as to where I am going wrong ?</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/javascript-dhtml-ajax/117">JavaScript / DHTML / AJAX</category>
			<dc:creator>aparnesh</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/456217/jquery-and-css-problem</guid>
		</item>
				<item>
			<title>JQuery UI Datepicker</title>
			<link>http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/456215/jquery-ui-datepicker</link>
			<pubDate>Sat, 08 Jun 2013 16:37:17 +0000</pubDate>
			<description>How can I prevent the user from typing in a date or anything else in the &lt;input&gt; element connected with a jQuery datepicker ?</description>
			<content:encoded><![CDATA[ <p>How can I prevent the user from typing in a date or anything else in the &lt;input&gt; element connected with a jQuery datepicker ?</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/javascript-dhtml-ajax/117">JavaScript / DHTML / AJAX</category>
			<dc:creator>aparnesh</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/456215/jquery-ui-datepicker</guid>
		</item>
				<item>
			<title>Google Maps Jquery Json</title>
			<link>http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/456174/google-maps-jquery-json</link>
			<pubDate>Fri, 07 Jun 2013 20:16:00 +0000</pubDate>
			<description>I have tried to fix this problem but can't make it to work. I have intalled all the data in my computer, tried a json file (.php), but can't figure it out. I have also tried the CSV format, but it didn't work. Where is my mistake? This is from ...</description>
			<content:encoded><![CDATA[ <p>I have tried to fix this problem but can't make it to work. I have intalled all the data in my computer, tried  a json file (.php), but can't figure it out. I have also tried the CSV format, but it didn't work. Where is my mistake?<br />
This is from the Google <a href="http://storelocator.googlecode.com/git/examples/dynamic.html" rel="nofollow">tutorial</a>, documentation here<a href="http://storelocator.googlecode.com/git/index.html?utm_campaign=sl&amp;utm_source=youtube" rel="nofollow">Click Here</a> :</p>

<pre><code>  $.getJSON('<a href="https://storelocator-go-demo.appspot.com/query?callback=?" rel="nofollow">https://storelocator-go-demo.appspot.com/query?callback=?</a>', {
    lat: center.lat(),
    lng: center.lng(),
    n: bounds.getNorthEast().lat(),
    e: bounds.getNorthEast().lng(),
    s: bounds.getSouthWest().lat(),
    w: bounds.getSouthWest().lng(),
    audio: features.contains(audioFeature) || '',
    access: features.contains(wheelchairFeature) || ''
  }, function(resp) {
    var stores = that.parse_(resp.data);
    that.sortByDistance_(center, stores);
    callback(stores);
  });
</code></pre>

<p>I have just tried to put my .php file instead of the url above. Doesn't work (just removed above url by my 'locationsJSON.php', just like that. Could someone help me with that?<br />
Thank you so much for your time ! The CSV route is not working either. Really frurtrating.</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/javascript-dhtml-ajax/117">JavaScript / DHTML / AJAX</category>
			<dc:creator>Gloak</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/456174/google-maps-jquery-json</guid>
		</item>
				<item>
			<title>Make &lt;ul&gt; work like &lt;select&gt;</title>
			<link>http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/456173/make-ul-work-like-select</link>
			<pubDate>Fri, 07 Jun 2013 20:15:16 +0000</pubDate>
			<description>Hello, Not really sure if this is the right place to post this to but I am pretty sure I need js to accomplish this. I need to make a dropdown selection menu for my wordpress theme options, but I can't use the conventional `&lt;select&gt;` tag because I want my ...</description>
			<content:encoded><![CDATA[ <p>Hello,</p>

<p>Not really sure if this is the right place to post this to but I am pretty sure I need js to accomplish this. I need to make a dropdown selection menu for my wordpress theme options, but I can't use the conventional <code>&lt;select&gt;</code> tag because I want my options to be a list of small images and this tag does not support it. (There were suggestions to use background-image but it didnt work in chrome). The problem is not making the list, I can do that, but I need it to work like a <code>&lt;select&gt;</code> tag. Meaning that the container element must have a 'name' value, cause wordpress needs this to save the settings in database. I hope I made myself clear enough.</p>

<p>An example what it could look like:</p>

<pre><code class="language-js">&lt;ul id="infobox-img-dropdown-list" name="featured-infobox-1-img"&gt;
    &lt;li value="phpWillFill"&gt;&lt;img src="phpWillFillThis" /&gt;&lt;/li&gt;
    &lt;li value="phpWIllFill" class="selected"&gt;&lt;img src="phpWillFillThis" /&gt;&lt;/li&gt;
    &lt;li value="phpWillFill" &gt;&lt;img src="phpWillFillThis" /&gt;&lt;/li&gt;
&lt;/ul&gt;
</code></pre>

<p>It's basically &lt;select&gt; but it shows images. I need it to function like &lt;select&gt; too.</p>

<p>For those who are familiar with wordpress, I am creating options page for my theme and am currently building the callback function for add_submenu_page() to display the settings form.</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/javascript-dhtml-ajax/117">JavaScript / DHTML / AJAX</category>
			<dc:creator>Martin C++</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/456173/make-ul-work-like-select</guid>
		</item>
				<item>
			<title>how to pass array with get parameter?</title>
			<link>http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/456145/how-to-pass-array-with-get-parameter</link>
			<pubDate>Fri, 07 Jun 2013 09:43:08 +0000</pubDate>
			<description>I made a function ajax where it creates such url: http://darius.lt/lt/live_dogs/live_dogs_screen/echo_next_match_info?mac_list%5B%5D=00%3A1F%3AD0%3A6E%3A90%3AF4 But I need to creante same url without ajax. I mean i need to generate. mac_list array is simply array ( 0: mac1, 1: mac2,... ) when I use: param = {mac_list: mac_list_global}; $.getJSON(this.url, param, function(data) there is not ...</description>
			<content:encoded><![CDATA[ <p>I made a function ajax where it creates such url:</p>

<p><a href="http://darius.lt/lt/live_dogs/live_dogs_screen/echo_next_match_info?mac_list%5B%5D=00%3A1F%3AD0%3A6E%3A90%3AF4" rel="nofollow">http://darius.lt/lt/live_dogs/live_dogs_screen/echo_next_match_info?mac_list%5B%5D=00%3A1F%3AD0%3A6E%3A90%3AF4</a></p>

<p>But I need to creante same url without ajax. I mean i need to generate.</p>

<p>mac_list array is simply</p>

<p>array (<br />
 0: mac1,<br />
 1: mac2,...<br />
 )</p>

<p>when I use:</p>

<pre><code class="language-js">param = {mac_list: mac_list_global};

                $.getJSON(this.url, param, function(data) 
</code></pre>

<p>there is not problem, jquery creates it from the param object. But when I want to make mysefl, googled and tried few horus - and cannot make the same url :( how is this done?</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/javascript-dhtml-ajax/117">JavaScript / DHTML / AJAX</category>
			<dc:creator>SPeed_FANat1c</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/456145/how-to-pass-array-with-get-parameter</guid>
		</item>
				<item>
			<title>Dynamically creating new page</title>
			<link>http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/456118/dynamically-creating-new-page</link>
			<pubDate>Thu, 06 Jun 2013 20:32:13 +0000</pubDate>
			<description>For example, after I press the button to submit this thread, a new page is created for it. How does this work/what would be the right way to describe it? I'm not sure where this should belong to so apologies if it's in the wrong forum.</description>
			<content:encoded><![CDATA[ <p>For example, after I press the button to submit this thread, a new page is created for it. How does this work/what would be the right way to describe it?</p>

<p>I'm not sure where this should belong to so apologies if it's in the wrong forum.</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/javascript-dhtml-ajax/117">JavaScript / DHTML / AJAX</category>
			<dc:creator>idlackage</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/456118/dynamically-creating-new-page</guid>
		</item>
				<item>
			<title>jquery validation plugin</title>
			<link>http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/456106/jquery-validation-plugin</link>
			<pubDate>Thu, 06 Jun 2013 14:31:25 +0000</pubDate>
			<description>validations for dynamic appended text fields using jquery validation plugin..!(bassistance plugin). is this possible. please give me an idea.</description>
			<content:encoded><![CDATA[ <p>validations for dynamic appended text fields using jquery validation plugin..!(bassistance plugin). is this possible.<br />
please give me an idea.</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/javascript-dhtml-ajax/117">JavaScript / DHTML / AJAX</category>
			<dc:creator>Php_1</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/456106/jquery-validation-plugin</guid>
		</item>
				<item>
			<title>jquery: radiobutton pressed conditional</title>
			<link>http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/456101/jquery-radiobutton-pressed-conditional</link>
			<pubDate>Thu, 06 Jun 2013 13:22:44 +0000</pubDate>
			<description>http://jsfiddle.net/tearex/AXQx4/ regardless of which button is pressed, the returned value is the same. How to correct the condition?</description>
			<content:encoded><![CDATA[ <p><a href="http://jsfiddle.net/tearex/AXQx4/" rel="nofollow">http://jsfiddle.net/tearex/AXQx4/</a></p>

<p>regardless of which button is pressed, the returned value is the same. How to correct the condition?</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/javascript-dhtml-ajax/117">JavaScript / DHTML / AJAX</category>
			<dc:creator>heftor</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/456101/jquery-radiobutton-pressed-conditional</guid>
		</item>
				<item>
			<title>what is this.id in different places</title>
			<link>http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/456093/what-is-this.id-in-different-places</link>
			<pubDate>Thu, 06 Jun 2013 11:21:39 +0000</pubDate>
			<description>Hello The meaning of **this.id** is self explanatory: element with currently focused on ID, but due to the abundance of the word &quot;this&quot;, it is very difficult to find it in online js references, like w3schools. could someone post a link to the explanation of this id somewhere on the ...</description>
			<content:encoded><![CDATA[ <p>Hello</p>

<p>The meaning of <strong>this.id</strong> is self explanatory: element with currently focused on ID, but due to the abundance of the word "this", it is very difficult to find it in online js references, like w3schools.</p>

<p>could someone post a link to the explanation of this id somewhere on the net?</p>

<p>**</p>

<p>It will help me deal with a specific problem.</p>

<p>The problem is how to replace "this.id" with specific id reference. To narrow down my question, what does <strong>this.id</strong> refer to in the particular instances below and how could reference to it be made more directly, something like</p>

<p>replacethisses="#particularID"<br />
?</p>

<pre><code class="language-js">var itemlista1;
var itemlista2;

var mapa1 = { item1zest1 : itemlista1, item1zest2 : itemlista2 };

$('#item1zest1, #item1zest2').change(function(){
$("#wybierzitem1 option").remove();
[COLOR="Red"]$.each(mapa1[this.id], function(i, val) {[/COLOR]
var opcja = $("&lt;option /&gt;");
chayn1 = val
var cutted=chayn1.split("|");
var singl=cutted.slice(0,1);
opcja.appendTo($("#wybierzitem1")).text(singl);
$('#wybierzitem1').trigger("change")
});

var versionesel = $("#wybierzitem1");
var droplista = Math.floor(Math.random() * $('#wybierzitem1 option').length);
  versionesel.get(0).selectedIndex = droplista;
  versionesel.selectmenu('refresh', true);
var itemwybrany = $('#wybierzitem1').val(); 

[COLOR="Green"]  versioneFOR1=(mapa1[this.id][droplista]); [/COLOR]

$("label[for='itempick1'] .ui-btn-text").html(itemwybrany);
});


$('#wybierzitem1').change(function(){

var itemwybrany = $('#wybierzitem1').val();   
$("label[for='itempick1'] .ui-btn-text").html(itemwybrany);
var itemwybrakowany = $('#wybierzitem1')[0].selectedIndex;
</code></pre>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/javascript-dhtml-ajax/117">JavaScript / DHTML / AJAX</category>
			<dc:creator>heftor</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/456093/what-is-this.id-in-different-places</guid>
		</item>
				<item>
			<title>ajax call and window.location</title>
			<link>http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/456090/ajax-call-and-window.location</link>
			<pubDate>Thu, 06 Jun 2013 10:50:05 +0000</pubDate>
			<description>Hi guys, I'm working on a shopping cart and I'm having some difficulties with a concept. Basicly, I remove two articles in a certain condition and it works perfectly. My problem is that I want to redirect the user instantly if these two articles are removed from the cart. When ...</description>
			<content:encoded><![CDATA[ <p>Hi guys,</p>

<p>I'm working on a shopping cart and I'm having some difficulties with a concept.</p>

<p>Basicly, I remove two articles in a certain condition and it works perfectly.<br />
My problem is that I want to redirect the user instantly if these two articles are removed from the cart.<br />
When I enter the window.location, it is refreshing the page but it's not updating the cart from the ajax call.</p>

<p>So what I want to achieve is that after these two ajax calls, i want to be redirected but also, the ajax call should do their things in the <code>delete_item.php</code> :)</p>

<p>I'm using jQuery inside a normal javascript file on a certain function.</p>

<pre><code class="language-js">    function deleted(id, pozitie) {
        var msg = 0;
        $(document).ready(function(){                    
            $('.' + id).each(function() { 
                $(this).remove();
                $('.sm').remove();
                ajaxpage("delete_item.php?id="+pozitie+"&amp;ord="+ordrno,"error");
                ajaxpage("delete_item.php?id="+(pozitie+1)+"&amp;ord="+ordrno,"error");
                window.location="<a href="http://mypage.com/offer" rel="nofollow">http://mypage.com/offer</a>";
                msg = 1;
            });
        });
</code></pre>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/javascript-dhtml-ajax/117">JavaScript / DHTML / AJAX</category>
			<dc:creator>szabizs</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/456090/ajax-call-and-window.location</guid>
		</item>
				<item>
			<title>Jquery image move</title>
			<link>http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/456085/jquery-image-move</link>
			<pubDate>Thu, 06 Jun 2013 09:17:02 +0000</pubDate>
			<description>Hi all want to change the animate property of jquery now it is animating from left to right but i want to fade in effect to replace function which i use function goto(id, t){ $('#swiper').animate({&quot;left&quot;: -($(id).position().left)}, 2000); }</description>
			<content:encoded><![CDATA[ <p>Hi all want to change the animate property of jquery now it is animating from left to right but i want to fade in effect to replace</p>

<p>function which i use</p>

<pre><code class="language-js">function goto(id, t){

    $('#swiper').animate({"left": -($(id).position().left)}, 2000); 

}   
</code></pre>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/javascript-dhtml-ajax/117">JavaScript / DHTML / AJAX</category>
			<dc:creator>thilipdilip</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/456085/jquery-image-move</guid>
		</item>
				<item>
			<title>Some pointers on javascript style?</title>
			<link>http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/456072/some-pointers-on-javascript-style</link>
			<pubDate>Thu, 06 Jun 2013 05:15:33 +0000</pubDate>
			<description>I'm not much of a javascript developer right now, as I just recently found the need to learn it. I'm using jQuery, and Javascript (sometimes stupidly, like when I find out jQuery already &quot;abstracted out&quot; something I wrote a 20 line function for). My question is about style though, with ...</description>
			<content:encoded><![CDATA[ <p>I'm not much of a javascript developer right now, as I just recently found the need to learn it. I'm using jQuery, and Javascript (sometimes stupidly, like when I find out jQuery already "abstracted out" something I wrote a 20 line function for). My question is about style though, with all the anonymous functions wrapped in jQuery functions, I get lost some times looking for the missing } or ) or ; (i like to use the ; even though I think it's not needed in some places). I had to get a little open-source .js file for part of my site, and when I looked at it, the author had written all the functions to be wrapped in a kind of namespace (using a dictionary i think). It looked like this:</p>

<pre><code class="language-js">var myLibrary = { myFunction1 : function () {
                        // code for this function here
                        return true
                        },
                  myFunction2 : function (i) {
                         var s = i + 1;
                         return s + "px"
                         }
                 }
</code></pre>

<p>This allows the functions to be called like this:  <code>myLibrary.myFunction1()</code></p>

<p>I thought that was neat, so I used it for my own library. But as the file grew (again, partly because I was re-writing stuff that I really didn't have to), it got quite messy. Especially with all the indentation of jQuery calls with settings that take anonymous functions, which may have functions inside of them. So for another small project I'm working on, I adopted the straight-forward approach like this:</p>

<pre><code class="language-js">function myFunction1() {
    //do stuff
    return true
}

function myFunction2 (i) {
    var s = i + 1;
    return s + "px"
}
</code></pre>

<p>But then I have to make sure I'm not overriding any existing functions, which I think I'm not, but still.<br />
My question is, what is the current trend? What do every-day-javascript-developers use?</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/javascript-dhtml-ajax/117">JavaScript / DHTML / AJAX</category>
			<dc:creator>chriswelborn</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/456072/some-pointers-on-javascript-style</guid>
		</item>
				<item>
			<title>first div selection pushes the second div element to the right on expanding</title>
			<link>http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/456035/first-div-selection-pushes-the-second-div-element-to-the-right-on-expanding</link>
			<pubDate>Wed, 05 Jun 2013 14:01:58 +0000</pubDate>
			<description>Hi all I am trying to resolve an issue when I select an expanding div, the first div selection pushes the second div element to the right. is there css fix or other to get this not to push div element to the right Thanks in advance D &lt;!DOCTYPE html ...</description>
			<content:encoded><![CDATA[ <p>Hi all I am trying to resolve an issue when I select an expanding div, the first div selection pushes the second div element to the right. is there css fix or other to get this not to push div element to the right</p>

<p>Thanks in advance</p>

<p>D</p>

<pre><code class="language-js">&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "<a href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" rel="nofollow">http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd</a>"&gt;
&lt;html xmlns="<a href="http://www.w3.org/1999/xhtml" rel="nofollow">http://www.w3.org/1999/xhtml</a>"&gt;
&lt;head&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /&gt;
&lt;title&gt;Papermashup.com | Show Hide Plugin&lt;/title&gt;
&lt;link href="../style.css" rel="stylesheet" type="text/css" /&gt;
&lt;style&gt;

body{
font-family:Verdana, Geneva, sans-serif;
font-size:14px;}
#display { float:left;}
#slidingDiv, #slidingDiv_2{ height:100px;padding:20px;margin-top:10px;display:none;}
&lt;/style&gt;
&lt;/head&gt;

&lt;body&gt;
&lt;script src="<a href="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js" rel="nofollow">https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js</a>" type="text/javascript"&gt;&lt;/script&gt;
&lt;script src="showHide.js" type="text/javascript"&gt;&lt;/script&gt;
&lt;script type="text/javascript"&gt;

$(document).ready(function(){

   $('.show_hide').showHide({            
        speed: 300,  // speed you want the toggle to happen 
        //easing: '',  // the animation effect you want. Remove this line if you dont want an effect and if you haven't included jQuery UI
        changeText: 0, // if you dont want the button text to change, set this to 0
        //showText: 'View',// the button text to show when a div is closed
        //hideText: 'Close' // the button text to show when a div is open

    }); 

});

&lt;/script&gt;
&lt;div id="display"&gt;
 &lt;a href="#" class="show_hide" rel="#slidingDiv"&gt;&lt;img src="click.png"&gt;&lt;/a&gt;
    &lt;div id="slidingDiv" &gt;
       &lt;p&gt; Fill this space with really interesting content.&lt;/p&gt;
    &lt;/div&gt;
&lt;/div&gt;
&lt;div id="display"&gt;
  &lt;a href="#" class="show_hide" rel="#slidingDiv_2"&gt;&lt;img src="click.png"&gt;&lt;/a&gt;
    &lt;div id="slidingDiv_2"&gt;
       &lt;p&gt;Fill this space with really interesting content.&lt;/p&gt;
    &lt;/div&gt; 
 &lt;/div&gt; 
&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>`</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/javascript-dhtml-ajax/117">JavaScript / DHTML / AJAX</category>
			<dc:creator>davidjennings</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/456035/first-div-selection-pushes-the-second-div-element-to-the-right-on-expanding</guid>
		</item>
				<item>
			<title>Jquery dialog box modifications</title>
			<link>http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/456011/jquery-dialog-box-modifications</link>
			<pubDate>Wed, 05 Jun 2013 09:27:46 +0000</pubDate>
			<description>Hi All - I am trying to modify the below script. Currently on page load the page will display the click image and the message in the dialog box. What I want to do is do it the opposite and just have the click image display and on click the ...</description>
			<content:encoded><![CDATA[ <p>Hi All - I am trying to modify the below script. Currently on page load the page will display the click image and the message in the dialog box.</p>

<p>What I want to do is do it the opposite and just have the click image display and on click the dialog box displays the content message.<br />
I would also like to have multiple images that when clicked independently the will open the dialog box of your selection</p>

<p>Thanks inadvance</p>

<p>D</p>

<pre><code class="language-js">&lt;html lang="en"&gt;
&lt;head&gt;
&lt;meta charset="utf-8" /&gt;
&lt;title&gt;jQuery UI Effects - Toggle Demo&lt;/title&gt;
&lt;link rel="stylesheet" href="<a href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" rel="nofollow">http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css</a>" /&gt;
&lt;script src="<a href="http://code.jquery.com/jquery-1.9.1.js" rel="nofollow">http://code.jquery.com/jquery-1.9.1.js</a>"&gt;&lt;/script&gt;
&lt;script src="<a href="http://code.jquery.com/ui/1.10.3/jquery-ui.js" rel="nofollow">http://code.jquery.com/ui/1.10.3/jquery-ui.js</a>"&gt;&lt;/script&gt;
&lt;link rel="stylesheet" href="/resources/demos/style.css" /&gt;
&lt;style&gt;
.toggler {
width: 500px;
height: 200px;
}
#button {
padding: .5em 1em;
text-decoration: none;
}
#effect {
position: relative;
width: 540px;
height: 135px;
padding: 0.4em;
}
#effect h3 {
margin: 0;
padding: 0.4em;
text-align: center;
}
.ui-widget-header {
    border: 1px solid #aaaaaa;
    background: #cccccc url(images/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x;
    color: #222222;
    font-weight: bold;
}
.ui-widget-content .ui-state-default,
.ui-widget-header .ui-state-default {
    border: 1px solid #d3d3d3;
    background: #e6e6e6 url(images/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x;
    font-weight: normal;
    color: #555555;
}
&lt;/style&gt;
&lt;script&gt;
$(function() {
// run the currently selected effect
function runEffect() {
// get effect type from
var selectedEffect = $( "#effectTypes" ).val();
// most effect types need no options passed by default
var options = {};
// some effects have required parameters
if ( selectedEffect === "scale" ) {
options = { percent: 0 };
} else if ( selectedEffect === "size" ) {
options = { to: { width: 200, height: 60 } };
}
// run the effect
$( "#effect" ).toggle( selectedEffect, options, 500 );
};
// set effect from select menu value
$( "#button" ).click(function() {
runEffect();
return false;
});
});
&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;a href="#" id="button"&gt;&lt;img src="click.png"&gt;&lt;/a&gt;
&lt;div class="toggler"&gt;
&lt;div id="effect" class="ui-widget-content ui-corner-all"&gt;
&lt;p&gt;
Etiam libero neque, luctus a, eleifend nec, semper at, lorem. Sed pede. Nulla lorem metus, adipiscing ut, luctus sed, hendrerit vitae, mi.
&lt;/p&gt;

&lt;a href="#" id="button"&gt;&lt;img src="click.png"&gt;&lt;/a&gt;
&lt;div class="toggler"&gt;
&lt;div id="effect" class="ui-widget-content ui-corner-all"&gt;
&lt;p&gt;
Etiam libero neque, luctus a, eleifend nec, semper at, lorem. Sed pede. Nulla lorem metus, adipiscing ut, luctus sed, hendrerit vitae, mi.
&lt;/p&gt;

&lt;/div&gt;
&lt;/div&gt;
&lt;!--&lt;select name="effects" id="effectTypes"&gt;
&lt;option value="blind"&gt;Blind&lt;/option&gt;
&lt;option value="bounce"&gt;Bounce&lt;/option&gt;
&lt;option value="clip"&gt;Clip&lt;/option&gt;
&lt;option value="drop"&gt;Drop&lt;/option&gt;
&lt;option value="explode"&gt;Explode&lt;/option&gt;
&lt;option value="fold"&gt;Fold&lt;/option&gt;
&lt;option value="highlight"&gt;Highlight&lt;/option&gt;
&lt;option value="puff"&gt;Puff&lt;/option&gt;
&lt;option value="pulsate"&gt;Pulsate&lt;/option&gt;
&lt;option value="scale"&gt;Scale&lt;/option&gt;
&lt;option value="shake"&gt;Shake&lt;/option&gt;
&lt;option value="size"&gt;Size&lt;/option&gt;
&lt;option value="slide"&gt;Slide&lt;/option&gt;
&lt;/select&gt;--&gt;

&lt;/body&gt;
&lt;/html&gt;
</code></pre>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/javascript-dhtml-ajax/117">JavaScript / DHTML / AJAX</category>
			<dc:creator>davidjennings</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/456011/jquery-dialog-box-modifications</guid>
		</item>
				<item>
			<title>Jquery Drag Objects</title>
			<link>http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455996/jquery-drag-objects</link>
			<pubDate>Wed, 05 Jun 2013 07:26:27 +0000</pubDate>
			<description>Hi, I am facing when I drag object in jquery. Description: I have a Div Maindiv in this div there is mupltiple divs inside it as inner content with absolute position and z-index. Problem is this when i drag any object the dragged object goes some divs upper and shows ...</description>
			<content:encoded><![CDATA[ <p>Hi,</p>

<p>I am facing when I drag object in jquery.</p>

<p>Description:<br />
I have a Div Maindiv in this div there is mupltiple divs inside it as inner content with absolute position and z-index.<br />
Problem is this when i drag any object  the dragged object goes some divs upper and shows some div dehind.</p>

<p>according to their Z-index property.</p>

<p>Now I want that when I drag any object in the Maindiv the drag object should always show in front of other objects on Maindiv.</p>

<p>The drag object should not go behind the other obects.</p>

<p>Thanks &amp; Regards,</p>

<p>Abhishek</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/javascript-dhtml-ajax/117">JavaScript / DHTML / AJAX</category>
			<dc:creator>abhishek5783</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455996/jquery-drag-objects</guid>
		</item>
				<item>
			<title>Hiding page while loading in javascript</title>
			<link>http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455982/hiding-page-while-loading-in-javascript</link>
			<pubDate>Wed, 05 Jun 2013 04:26:54 +0000</pubDate>
			<description>So I'm using mediabox which creates lightbox Iframes. I've modded it quite a bit, and there's just ONE last thing I want to accomplish. When the &quot;popup&quot; occurs, my site is still loading in the iframe; the process looks unproffesional. I have 2 key pieces of code, and I was ...</description>
			<content:encoded><![CDATA[ <p>So I'm using mediabox which creates lightbox Iframes. I've modded it quite a bit, and there's just ONE last thing I want to accomplish. When the "popup" occurs, my site is still loading in the iframe; the process looks unproffesional. I have 2 key pieces of code, and I was wondering how I could manage having the app wait a little bit before showing the iframe site, so it has a headstart on loading?</p>

<p>This states the duration of the effect, but the page waits until it is finished to start loading.</p>

<pre><code class="language-js">resizeOpening: true,            // Determines if box opens small and grows (true) or starts at larger size (false)
resizeDuration: 200,            // Duration of each of the box resize animations (in milliseconds)
resizeTransition: false,        // Mootools transition effect (false leaves it at the default)
</code></pre>

<p>This here basically sets up the iframe. I'm wondering if I can put the preload before everything else and I'd get the result I'm after. Please let me know.</p>

<pre><code class="language-js">else {
                mediaType = 'url';
                mediaWidth = mediaWidth || "638px";
                mediaHeight = mediaHeight || "1000px";
                mediaId = "mediaId_"+new Date().getTime();  // Safari may not update iframe content with a static id.
                preload = new Element('iframe', {
                    'src': URL,
                     'id': mediaId,
                     width: mediaWidth,
                     height: mediaHeight,
                     scrolling : 'no',
                     'frameborder': 0
                    });
                startEffect();
            }
</code></pre>

<p>This loads the iframe in the lightbox.</p>

<pre><code class="language-js">else if (mediaType == "url") {
            image.setStyles({backgroundImage: "none", display: ""});
            preload.inject(image);
        }
</code></pre>

<p>Any help with this dilemna is appreciated, but I understand that it's not simple.</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/javascript-dhtml-ajax/117">JavaScript / DHTML / AJAX</category>
			<dc:creator>sonicx2218</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455982/hiding-page-while-loading-in-javascript</guid>
		</item>
				<item>
			<title>How to Check if a Button has been Pressed or not.</title>
			<link>http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455978/how-to-check-if-a-button-has-been-pressed-or-not</link>
			<pubDate>Wed, 05 Jun 2013 03:52:37 +0000</pubDate>
			<description>Hi. Not sure where to put this but basically I have a form. There are two buttons. One says submit and the other says print form. How do I make sure that the user has clicked the print form button before the form gets submitted. For example, a user fills ...</description>
			<content:encoded><![CDATA[ <p>Hi. Not sure where to put this but basically I have a form. There are two buttons. One says submit and the other says print form.</p>

<p>How do I make sure that the user has clicked the print form button before the form gets submitted.</p>

<p>For example, a user fills out my form and then hits submit. If they didn't click submit first, a javascript error will pop up and say "print form". If they did print the form befor hitting submit, it will allow the form to pass on to the proper page.</p>

<p>Heres what I was thinking of using but not sure how to code it correctly.</p>

<pre><code>$('#Submit, #Print').click(function () {
    if (this.id == 'Submit') {
        alert('Print the Form First!');
    }
    else if (this.id == 'Print') {
        //Continue Form action.
    }
});
</code></pre>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/javascript-dhtml-ajax/117">JavaScript / DHTML / AJAX</category>
			<dc:creator>ahudson</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455978/how-to-check-if-a-button-has-been-pressed-or-not</guid>
		</item>
				<item>
			<title>Local csv file to table dynamically</title>
			<link>http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455975/local-csv-file-to-table-dynamically</link>
			<pubDate>Wed, 05 Jun 2013 03:16:23 +0000</pubDate>
			<description>I was wondering if anyone could provide me a complete example with html tags and all of javascript or jquery that can load an html table with local files directly on my c drive? Sorry Ive been searching online all night and could not find anything.</description>
			<content:encoded><![CDATA[ <p>I was wondering if anyone could provide me a complete example with html tags and all of javascript or jquery that can load an html table with local files directly on my c drive? Sorry Ive been searching online all night and could not find anything.</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/javascript-dhtml-ajax/117">JavaScript / DHTML / AJAX</category>
			<dc:creator>moone009</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455975/local-csv-file-to-table-dynamically</guid>
		</item>
				<item>
			<title>jcarousel issue in mozilla firefox</title>
			<link>http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455937/jcarousel-issue-in-mozilla-firefox</link>
			<pubDate>Tue, 04 Jun 2013 11:39:04 +0000</pubDate>
			<description>hello, I use jcarousel in my (opencart)website for slideshow.slideshow shows perfect in google chrome but, not working in mozilla . So, Please Someone help me solve this problem link : http://dejavutrends.com/ thanks in Advance</description>
			<content:encoded><![CDATA[ <p>hello,</p>

<p>I use jcarousel in my (opencart)website for slideshow.slideshow shows perfect in google chrome but, not working in mozilla . So, Please Someone help me solve this problem</p>

<p>link : <a href="http://dejavutrends.com/" rel="nofollow">http://dejavutrends.com/</a></p>

<p>thanks in Advance</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/javascript-dhtml-ajax/117">JavaScript / DHTML / AJAX</category>
			<dc:creator>NitsPatel</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455937/jcarousel-issue-in-mozilla-firefox</guid>
		</item>
				<item>
			<title>calendar in Java script</title>
			<link>http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455893/calendar-in-java-script</link>
			<pubDate>Mon, 03 Jun 2013 19:27:16 +0000</pubDate>
			<description>Hello, I am trying to have a calendar in my site which should have below functionality: 1. Select a year from 2013 to 2023 from a given calendar. 2. Once a year is selected (ex-2013), 12 links displayed as Jan, Feb, Mar, Apr.... Dec. 3. Once a month is clicked ...</description>
			<content:encoded><![CDATA[ <p>Hello,</p>

<p>I am trying to have a calendar in my site which should have below functionality:</p>

<ol><li><p>Select a year from 2013 to 2023 from a given calendar.</p></li>
<li><p>Once a year is selected (ex-2013), 12 links displayed as Jan, Feb, Mar, Apr.... Dec.</p></li>
<li><p>Once a month is clicked (ex-Jan), Jan page is displayed in the web site.</p></li>
</ol>

<p>How can i do it in Javascript or I should other language? I am new to JS if you could provide me some tips as for how to do it, it would be great.</p>

<p>Many Thanks.</p>

<p>-P</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/javascript-dhtml-ajax/117">JavaScript / DHTML / AJAX</category>
			<dc:creator>Junior Coder</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455893/calendar-in-java-script</guid>
		</item>
				<item>
			<title>Horizontal axis scrolling : &#039;no&#039;, equivalent?</title>
			<link>http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455835/horizontal-axis-scrolling-no-equivalent</link>
			<pubDate>Mon, 03 Jun 2013 03:27:28 +0000</pubDate>
			<description>I have a Js program where I want to hide ONLY the horizontal axis. scrolling : 'no', is the only command that seems to hide the scrollbars, but I want only the x to be hidden. Is there any x axis equivalent to this code? Thanks</description>
			<content:encoded><![CDATA[ <p>I have a Js program where I want to hide ONLY the horizontal axis. scrolling : 'no', is the only command that seems to hide the scrollbars, but I want only the x to be hidden. Is there any x axis equivalent to this code?<br />
Thanks</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/javascript-dhtml-ajax/117">JavaScript / DHTML / AJAX</category>
			<dc:creator>sonicx2218</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455835/horizontal-axis-scrolling-no-equivalent</guid>
		</item>
				<item>
			<title>backbbone collection fetch overriding - does not trigger model change</title>
			<link>http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455793/backbbone-collection-fetch-overriding-does-not-trigger-model-change</link>
			<pubDate>Sun, 02 Jun 2013 06:47:59 +0000</pubDate>
			<description>Hello, there is overridden collection fetch function. fetch: function() { var collection = this; $.getJSON(this.url, function(data) { // do some processing to data here collection.reset(data); }); }, I need to do processing when I get data, so thats why overrride. But the thing - is - the models change event ...</description>
			<content:encoded><![CDATA[ <p>Hello,</p>

<p>there is overridden collection fetch function.</p>

<pre><code class="language-js">fetch: function() {

        var collection = this;

       $.getJSON(this.url, function(data) {


              // do some processing to data here


          collection.reset(data);
       });
    },
</code></pre>

<p>I need to do processing when I get data, so thats why overrride. But the thing - is - the models change event is not triggered, here ,so models do not see and do not render.</p>

<p>I could call proably render method in the getJSON callback but its not they way it should be I guess. How to make here model change event?</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/javascript-dhtml-ajax/117">JavaScript / DHTML / AJAX</category>
			<dc:creator>SPeed_FANat1c</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455793/backbbone-collection-fetch-overriding-does-not-trigger-model-change</guid>
		</item>
				<item>
			<title>JavaScript string.replace *</title>
			<link>http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455792/javascript-string.replace-</link>
			<pubDate>Sun, 02 Jun 2013 05:23:54 +0000</pubDate>
			<description>So I have a string of the English alphabet for example. But I don't know the alphabet very well but I do know that it starts with &quot;abc&quot; and that it ends in &quot;xyz&quot;. I want to remove letters &quot;b&quot; to &quot;x&quot;. I want to do something like `str = ...</description>
			<content:encoded><![CDATA[ <p>So I have a string of the English alphabet for example. But I don't know the alphabet very well but I do know that it starts with "abc" and that it ends in "xyz". I want to remove letters "b" to "x". I want to do something like <code>str = str.replace("bc*x","");</code> or <code>str = str.replace("bc"*"x","");</code> but I don't know how I can make it work or even if whether <a href="http://en.wikipedia.org/wiki/Asterisk#Computing" rel="nofollow">Asterisk</a> will work like this in JavaScript.</p>

<p>how can I remove something like everything except for "efg" from "abcdefghijklm" without know what anything is except for "ef"?</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/javascript-dhtml-ajax/117">JavaScript / DHTML / AJAX</category>
			<dc:creator>nouth</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455792/javascript-string.replace-</guid>
		</item>
				<item>
			<title>(Simple!) Calculating grades w/dynamic input</title>
			<link>http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455783/simple-calculating-grades-wdynamic-input</link>
			<pubDate>Sat, 01 Jun 2013 22:52:02 +0000</pubDate>
			<description>Hi all! So I have created this for my first portion of my Beginning CIS class project, calculating the final grade based on scores. For the next step, the user must be able to enter in their own number of projects they have completed, and from that, be able to ...</description>
			<content:encoded><![CDATA[ <p>Hi all! So I have created this for my first portion of my Beginning CIS class project, calculating the final grade based on scores. For the next step, the user must be able to enter in their own number of projects they have completed, and from that, be able to put individual scores in that number of projects they entered. (For example, if they say they did 5 projects, they then individually write the number grade of each project). Then, the final letter grade is computed based on all the information.</p>

<p>I'm totally stuck and don't know where to begin to add that in. Could anyone help me out? Here is my code for the first portion, without the dynamic input text add-in:</p>

<p>&lt;html&gt;</p>

<pre><code class="language-js">&lt;html&gt;
    &lt;head&gt;
        &lt;meta charset="utf-8"&gt;
        &lt;title&gt;Grade Calculator&lt;/title&gt;
            &lt;/head&gt;
    &lt;body&gt;
        &lt;h1&gt;Grade Calculator&lt;/h1&gt;
        &lt;p&gt;Enter only whole numbers.&lt;/p&gt;
        &lt;form name="Grade Calculator" id="form"&gt;
            &lt;p&gt;
                &lt;label for="homework"&gt;Homework:&lt;/label&gt;
                &lt;input type="text" id="homework" value="" name="Homework" size="3"
                maxlength="3"&gt;
            &lt;/p&gt;
            &lt;p&gt;
                &lt;label for="projects"&gt;Projects:&lt;/label&gt;
                &lt;input type="text" id="projects" value="" name="Projects" size="3"
                maxlength="3"&gt;
            &lt;/p&gt;
            &lt;p&gt;
                &lt;label for="midterm"&gt;Midterm:&lt;/label&gt;
                &lt;input type="text" id="midterm" value="" name="Midterm"
                        size="3" maxlength="3"&gt;
            &lt;/p&gt;
            &lt;p&gt;
                &lt;label for="final"&gt;Final:&lt;/label&gt;
                &lt;input type="text" id="final" value="" name="Final"
                        size="3" maxlength="3"&gt;
            &lt;/p&gt;
                      &lt;p class="h-line"&gt;&lt;/p&gt;
            &lt;p&gt;
                &lt;label for="final-grade"&gt;Final Grade (Letter Grade):&lt;/label&gt;
                &lt;input type="text" name="Final Grade" id="final-grade" value="" 
                        size="7" readonly="readonly" tabindex="-1"&gt;
            &lt;/p&gt;
            &lt;p&gt;
                &lt;input type="button" value="Calculate" onclick="calcGrade();"&gt;
                &lt;input type="reset" value="Reset"&gt;
            &lt;/p&gt;
        &lt;/form&gt;
    &lt;script type="text/javascript"&gt;
        function calcGrade() {
            var form = document.getElementById("form");
            var finalGrade = document.getElementById("final-grade");
            var input;
            var i = 4;
            var grade = [];


            while (i--) {
                input = form.elements[i].value;
                if (parseInt(input, 10)) {
                    input = parseInt(input, 10);
                    form.elements[i].value = input;
                    if (input &lt;= 100 &amp;&amp; input &gt;= 0) {
                        grade[i] = input;
                    } else {
                        if (input &gt; 100) {
                            grade[i] = 100;
                            form.elements[i].value = "100";
                        } else {
                            if (input &lt; 0) {
                                grade[i] = 0;
                                form.elements[i].value = "0";
                            }
                        }
                    }
                } else {
                    grade[i] = 0;
                    form.elements[i].value = "0";
                }    
            }


            grade[4] = Math.round((grade[0] * 0.2) + (grade[1] * 0.25) + 
                    (grade[2] * 0.2) + (grade[3] * 0.35));

            if (grade[4] &lt; 60) {
                finalGrade.value = (grade[4] + " (F)");
                return;
            }
            if (grade[4] &gt;= 60 &amp;&amp; grade[4] &lt; 70) {
                finalGrade.value = (grade[4] + " (D)");
                return;
            }
            if (grade[4] &gt;= 70 &amp;&amp; grade[4] &lt; 80) {
                finalGrade.value = (grade[4] + " (C)");
                return;
            }
            if (grade[4] &gt;= 80 &amp;&amp; grade[4] &lt; 90) {
                finalGrade.value = (grade[4] + " (B)");
                return;
            }
            if (grade[4] &gt;= 90) {
                finalGrade.value = (grade[4] + " (A)");
            }  
        }
    &lt;/script&gt;
    &lt;/body&gt;
&lt;/html&gt;


    &lt;meta charset="utf-8"&gt;
    &lt;title&gt;Grade Calculator&lt;/title&gt;
        &lt;/head&gt;
&lt;body&gt;
    &lt;h1&gt;Grade Calculator&lt;/h1&gt;
    &lt;p&gt;Enter only whole numbers.&lt;/p&gt;
    &lt;form name="Grade Calculator" id="form"&gt;
        &lt;p&gt;
            &lt;label for="homework"&gt;Homework:&lt;/label&gt;
            &lt;input type="text" id="homework" value="" name="Homework" size="3"
            maxlength="3"&gt;
        &lt;/p&gt;
        &lt;p&gt;
            &lt;label for="projects"&gt;Projects:&lt;/label&gt;
            &lt;input type="text" id="projects" value="" name="Projects" size="3"
            maxlength="3"&gt;
        &lt;/p&gt;
        &lt;p&gt;
            &lt;label for="midterm"&gt;Midterm:&lt;/label&gt;
            &lt;input type="text" id="midterm" value="" name="Midterm"
                    size="3" maxlength="3"&gt;
        &lt;/p&gt;
        &lt;p&gt;
            &lt;label for="final"&gt;Final:&lt;/label&gt;
            &lt;input type="text" id="final" value="" name="Final"
                    size="3" maxlength="3"&gt;
        &lt;/p&gt;
                  &lt;p class="h-line"&gt;&lt;/p&gt;
        &lt;p&gt;
            &lt;label for="final-grade"&gt;Final Grade (Letter Grade):&lt;/label&gt;
            &lt;input type="text" name="Final Grade" id="final-grade" value="" 
                    size="7" readonly="readonly" tabindex="-1"&gt;
        &lt;/p&gt;
        &lt;p&gt;
            &lt;input type="button" value="Calculate" onclick="calcGrade();"&gt;
            &lt;input type="reset" value="Reset"&gt;
        &lt;/p&gt;
    &lt;/form&gt;
&lt;script type="text/javascript"&gt;
    function calcGrade() {
        var form = document.getElementById("form");
        var finalGrade = document.getElementById("final-grade");
        var input;
        var i = 4;
        var grade = [];


        while (i--) {
            input = form.elements[i].value;
            if (parseInt(input, 10)) {
                input = parseInt(input, 10);
                form.elements[i].value = input;
                if (input &lt;= 100 &amp;&amp; input &gt;= 0) {
                    grade[i] = input;
                } else {
                    if (input &gt; 100) {
                        grade[i] = 100;
                        form.elements[i].value = "100";
                    } else {
                        if (input &lt; 0) {
                            grade[i] = 0;
                            form.elements[i].value = "0";
                        }
                    }
                }
            } else {
                grade[i] = 0;
                form.elements[i].value = "0";
            }    
        }


        grade[4] = Math.round((grade[0] * 0.2) + (grade[1] * 0.25) + 
                (grade[2] * 0.2) + (grade[3] * 0.35));

        if (grade[4] &lt; 60) {
            finalGrade.value = (grade[4] + " (F)");
            return;
        }
        if (grade[4] &gt;= 60 &amp;&amp; grade[4] &lt; 70) {
            finalGrade.value = (grade[4] + " (D)");
            return;
        }
        if (grade[4] &gt;= 70 &amp;&amp; grade[4] &lt; 80) {
            finalGrade.value = (grade[4] + " (C)");
            return;
        }
        if (grade[4] &gt;= 80 &amp;&amp; grade[4] &lt; 90) {
            finalGrade.value = (grade[4] + " (B)");
            return;
        }
        if (grade[4] &gt;= 90) {
            finalGrade.value = (grade[4] + " (A)");
        }  
    }
&lt;/script&gt;
&lt;/body&gt;
</code></pre>

<p>&lt;/html&gt;</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/javascript-dhtml-ajax/117">JavaScript / DHTML / AJAX</category>
			<dc:creator>bwin</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455783/simple-calculating-grades-wdynamic-input</guid>
		</item>
				<item>
			<title>How Can I Make This Program Account for the number 0?</title>
			<link>http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455781/how-can-i-make-this-program-account-for-the-number-0</link>
			<pubDate>Sat, 01 Jun 2013 22:36:36 +0000</pubDate>
			<description>I have this: $(document).ready(function() { $('input[type=&quot;button&quot;]').click(function() { var sum = 0, count = 0, result; $('input[type=&quot;text&quot;]').each(function() { var val = Number( $(this).val() ); if (val &amp;&amp; val &gt;= 0) { sum += Number(val); count++; } }); the error is that it does not take zero into account, for example, 10 ...</description>
			<content:encoded><![CDATA[ <p>I have this:</p>

<pre><code class="language-js">$(document).ready(function() {
    $('input[type="button"]').click(function() {
        var sum = 0, count = 0, result;

        $('input[type="text"]').each(function() {
            var val = Number( $(this).val() );
            if (val &amp;&amp; val &gt;= 0) {
                sum += Number(val);
                count++;
            }
        });
        the error is that it does not take zero into account,
        for example, 10 and 0 should average out to 5, not 10.
        result = (count &gt; 0) ? sum/count : 'no values found';
        $('#result').html( result );

    });
});
</code></pre>

<p>How can I make it account for the number 0 when it figures out averages?</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/javascript-dhtml-ajax/117">JavaScript / DHTML / AJAX</category>
			<dc:creator>Navlag</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455781/how-can-i-make-this-program-account-for-the-number-0</guid>
		</item>
				<item>
			<title>Hiding Iframe horizontal scroll via javascript?</title>
			<link>http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455777/hiding-iframe-horizontal-scroll-via-javascript</link>
			<pubDate>Sat, 01 Jun 2013 21:21:45 +0000</pubDate>
			<description>I have a javascript program that creates an iframe lightbox. This is the section of the code that affects the iframe only. mediaType = 'url'; mediaWidth = mediaWidth || &quot;640px&quot;; mediaHeight = mediaHeight || &quot;360px&quot;; mediaId = &quot;mediaId_&quot;+new Date().getTime(); preload = new Element('iframe', { 'src': URL, 'id': mediaId, width: mediaWidth, ...</description>
			<content:encoded><![CDATA[ <p>I have a javascript program that creates an iframe lightbox. This is the section of the code that affects the iframe only.</p>

<pre><code class="language-js">mediaType = 'url';
            mediaWidth = mediaWidth || "640px";
            mediaHeight = mediaHeight || "360px";
            mediaId = "mediaId_"+new Date().getTime();  
            preload = new Element('iframe', {
                'src': URL,
                 'id': mediaId,
                 width: mediaWidth,
                 height: mediaHeight,
                 'frameborder': 0
</code></pre>

<p>I have no idea how to make the iframe not have an x scroll in this particular code. The css for the Js app only applies to the background, so I don't think I can alter it there.</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/javascript-dhtml-ajax/117">JavaScript / DHTML / AJAX</category>
			<dc:creator>sonicx2218</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455777/hiding-iframe-horizontal-scroll-via-javascript</guid>
		</item>
				<item>
			<title>can not set limit for image file upload, please help</title>
			<link>http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455776/can-not-set-limit-for-image-file-upload-please-help</link>
			<pubDate>Sat, 01 Jun 2013 21:17:35 +0000</pubDate>
			<description>i am using http://bojanmauser.from.hr/bvalidator/ this script to validate my form, now i am stack with a problem, want to set max file limit for image file upload. but i am unsuccessful everytime, can anybody help me to get rid of this, advance thanx to all, who is reading this discussion ...</description>
			<content:encoded><![CDATA[ <p>i am using <a href="http://bojanmauser.from.hr/bvalidator/" rel="nofollow">http://bojanmauser.from.hr/bvalidator/</a> this script to validate my form, now i am stack with a problem, want to set max file limit for image file upload. but i am unsuccessful everytime, can anybody help me to get rid of this, advance thanx to all, who is reading this discussion and give a helping a hand to solve this problem...</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/javascript-dhtml-ajax/117">JavaScript / DHTML / AJAX</category>
			<dc:creator>adeeb.keyaam</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455776/can-not-set-limit-for-image-file-upload-please-help</guid>
		</item>
				<item>
			<title>what is bmi.js ?</title>
			<link>http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455752/what-is-bmi.js-</link>
			<pubDate>Sat, 01 Jun 2013 13:45:06 +0000</pubDate>
			<description>I am newbie in learning javaScript.When investigating a site source codes i've got some scripts. in repl.html folder there is bmi.js.My question is why they use this script? or a understandable article will be helpful for me. thannks for reading.</description>
			<content:encoded><![CDATA[ <p>I am newbie in learning javaScript.When investigating a site source codes i've got some scripts. in repl.html folder there is bmi.js.My question is why they use this script? or a understandable article will be helpful for me. thannks for reading.</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/javascript-dhtml-ajax/117">JavaScript / DHTML / AJAX</category>
			<dc:creator>polashdeb</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455752/what-is-bmi.js-</guid>
		</item>
				<item>
			<title>Controlling height and width</title>
			<link>http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455732/controlling-height-and-width</link>
			<pubDate>Fri, 31 May 2013 23:14:52 +0000</pubDate>
			<description>So I'm using this program that has 2 important sections of code that determine the iframe height and width. if (!images[imageIndex][2]) images[imageIndex][2] = ''; // Thanks to Leo Feyer for offering this fix WH = images[imageIndex][2].split(' '); WHL = WH.length; if (WHL&gt;1) { mediaWidth = (WH[WHL-2].match(&quot;%&quot;)) ? (window.getWidth()*((WH[WHL-2].replace(&quot;%&quot;, &quot;&quot;))*0.01))+&quot;px&quot; : ...</description>
			<content:encoded><![CDATA[ <p>So I'm using this program that has 2 important sections of code that determine the iframe height and width.</p>

<pre><code class="language-js">            if (!images[imageIndex][2]) images[imageIndex][2] = ''; // Thanks to Leo Feyer for offering this fix
            WH = images[imageIndex][2].split(' ');
            WHL = WH.length;
            if (WHL&gt;1) {
                mediaWidth = (WH[WHL-2].match("%")) ? (window.getWidth()*((WH[WHL-2].replace("%", ""))*0.01))+"px" : WH[WHL-2]+"px";
                mediaHeight = (WH[WHL-1].match("%")) ? (window.getHeight()*((WH[WHL-1].replace("%", ""))*0.01))+"px" : WH[WHL-1]+"px";
            } else {
                mediaWidth = "";
                mediaHeight = "";
            }
            URL = images[imageIndex][0];
            URL = encodeURI(URL).replace("(","%28").replace(")","%29");
            captionSplit = images[activeImage][1].split('::');
</code></pre>

<p>AND</p>

<pre><code class="language-js">mediaType = 'url';
                mediaWidth = mediaWidth || options.defaultWidth;
                mediaHeight = mediaHeight || options.defaultHeight;
                mediaId = "mediaId_"+new Date().getTime();  // Safari may not update iframe content with a static id.
                preload = new Element('iframe', {
                    'src': URL,
                    'id': mediaId,
                    'width': mediaWidth,
                    'height': mediaHeight,
                    'frameborder': 0
</code></pre>

<p>No matter what I do, I cannot get the iframe's width and height limit to become what I specify.<br />
I'm trying to remove the scrollbars and have it show EXACTLY the height and width I specify. What can I do?<br />
Here's the code I enter to actually start the lightbox.</p>

<pre><code class="language-js"> &lt;a href="<a href="http://www.scatterset.com/#!sight-for-sore-ears/c1u3j" rel="nofollow">http://www.scatterset.com/#!sight-for-sore-ears/c1u3j</a>" rel="lightbox[external 710 1000]" title="Sight for Sore Ears" &gt;
&lt;img src="<a href="http://i2.ytimg.com/vi/-IoIfqEi8CA/mqdefault.jpg" rel="nofollow">http://i2.ytimg.com/vi/-IoIfqEi8CA/mqdefault.jpg</a>"&gt;
&lt;/a&gt;
</code></pre>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/javascript-dhtml-ajax/117">JavaScript / DHTML / AJAX</category>
			<dc:creator>sonicx2218</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455732/controlling-height-and-width</guid>
		</item>
				<item>
			<title>background image for portrait vs. landscape</title>
			<link>http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455725/background-image-for-portrait-vs.-landscape</link>
			<pubDate>Fri, 31 May 2013 20:01:46 +0000</pubDate>
			<description>I'm not sure if this is just a style-sheet issue, because there's a javascript component. But, what I have is a div set to cover the page, and a background image inside, set to cover. This works fine on a computer, but I noticed that it wasn't portraying correctly on ...</description>
			<content:encoded><![CDATA[ <p>I'm not sure if this is just a style-sheet issue, because there's a javascript component. But, what I have is a div set to cover the page, and a background image inside, set to cover.</p>

<p>This works fine on a computer, but I noticed that it wasn't portraying correctly on ipad in landscape mode. (or any phone) The image was far too big, only showing a portion of the picture onscreen. (using a 1024x680 picture)</p>

<p>I added height, changing the image to 1024 x 680, and it resolves the problem - but, of course, in portrait there is now a bunch of empty space at the bottom because the image isn't actually that size.</p>

<p>I can't just set css styles based on portrait/landscape, because there is a javascript randomizing script for what image loads on pageload.</p>

<p>Can anybody think of a solution that reconciles this problem?</p>

<p>right now the script is simply this:</p>

<pre><code class="language-js">&lt;script&gt;
$(document).ready(function() {

// code for random backgorund image on page load
$("#full-size-background").css("background-image", "url(images/backgrounds/" + Math.floor(Math.random()*3) + ".jpg)");

});
&lt;/script&gt;

And the style sheet is simply this:
&lt;style&gt;
#full-size-background {
    z-index:-1;
    background:#000;
    background-color:#000;
    background-image: url('../images/BG1b.jpg'); 
    background-repeat:no-repeat; 
    position:fixed;
    -webkit-background-size: cover;
    -moz-background-size: cover;
    -o-background-size: cover;
    background-size: cover;
    background-attachment: fixed;
    height:150px;
    top:0px;
    left:0px;
    width:100%;
    height:100%;
    z-index:1;
  }
&lt;/style&gt;
</code></pre>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/javascript-dhtml-ajax/117">JavaScript / DHTML / AJAX</category>
			<dc:creator>turpentyne</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455725/background-image-for-portrait-vs.-landscape</guid>
		</item>
				<item>
			<title>Use .lenght when you know the length before?</title>
			<link>http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455677/use-.lenght-when-you-know-the-length-before</link>
			<pubDate>Fri, 31 May 2013 06:35:11 +0000</pubDate>
			<description>yesterday I was disucsing with more experienced programmer. He saw that I am using for (var i =0; i&lt; 6; i++) So 6 is the static number. I was iterating throug array. He said to use lengh, just in case array lemngh is not 6. I say - its always ...</description>
			<content:encoded><![CDATA[ <p>yesterday I was disucsing with more experienced programmer. He saw that I am using</p>

<pre><code class="language-js">for (var i =0; i&lt; 6; i++) 
</code></pre>

<p>So 6 is the static number. I was iterating throug array. He said to use lengh, just in case array lemngh is not 6. I say - its always 6. Its not planned to be not 6.</p>

<p>He says still - who knows maybe code will be changed.</p>

<p>Ok, there might be some reason. But then I say - for me it looks more readable.</p>

<p>When I see 6 - I know its 6 and nothing else. WHen I see .lenght - then it automatically comes to my mind - this is not constant. So then I should make a commend for the code reader that its constant to not make him wasted time figuring out why can it be sometimes other than 6.</p>

<p>And even if its some time not 6, then it means ther is a bug in some other place which generates this array, so that bug needs to be fixed.</p>

<p>WHat do you think - what is better - the way I do or the way he says?</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/javascript-dhtml-ajax/117">JavaScript / DHTML / AJAX</category>
			<dc:creator>SPeed_FANat1c</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455677/use-.lenght-when-you-know-the-length-before</guid>
		</item>
				<item>
			<title>Where next-Javascript/Ajax or ?</title>
			<link>http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455665/where-next-javascriptajax-or-</link>
			<pubDate>Thu, 30 May 2013 23:50:30 +0000</pubDate>
			<description>I can display an alpha index of the table contents using a form as follows: &lt;?php if (isset($_POST['name'])) $name = ($_POST['name']); else $name = &quot;no name entered&quot;; ?&gt; &lt;form method=&quot;post&quot; name=&quot;search&quot; action=&quot;directory.php&quot;/&gt; &lt;font family = &quot;arial,verdana,sans-serif&quot; color=&quot;#3F7cef&quot;size=&quot;4&quot;/&gt;Select Letter&lt;/font&gt; &lt;input type=&quot;text&quot; name=&quot;name&quot; size=&quot;5&quot; maxlength =&quot;1&quot; value=&quot;&lt;?php if(isset($_POST['name'])){echo htmlentities($_POST['name']);}?&gt;&quot; /&gt; &lt;input type=&quot;submit&quot; ...</description>
			<content:encoded><![CDATA[ <p>I can display an alpha index of the table contents using a form as follows:</p>

<pre><code class="language-js">&lt;?php                                            
if (isset($_POST['name'])) $name = ($_POST['name']);
else $name = "no name entered";
?&gt;  

&lt;form method="post" name="search" action="directory.php"/&gt;
        &lt;font family = "arial,verdana,sans-serif" color="#3F7cef"size="4"/&gt;Select Letter&lt;/font&gt;
        &lt;input type="text" name="name" size="5" maxlength ="1"  value="&lt;?php if(isset($_POST['name'])){echo htmlentities($_POST['name']);}?&gt;" /&gt;
        &lt;input type="submit" name="submit" value="submit" alt="search"/&gt; 
    &lt;/form&gt;  

&lt;?php
if($name== "")
{
echo "&lt;p&gt;&lt;font color='red' size='6px'&gt;You have not entered a name&lt;/font&gt;&lt;/p&gt;";
exit;                                           
}
else 
{
echo"&lt;br /&gt;";
echo "&lt;font color='#3F7cef'size='4'/&gt;You searched for:&lt;/font&gt;";
echo "&lt;p&gt;";
echo "&lt;font color='#3F7cef'size='6'&gt;";
require_once "../php/fix_it.php";
echo fix_it($name);                              //function to return name input
echo"&lt;/font&gt;";
}
require_once '../php/dbconnect.php';                                
$query = "(SELECT name1 FROM allnames WHERE name1 LIKE '$name%')UNION(SELECT name2 FROM allnames WHERE name2 LIKE '$name%')UNION(SELECT name3 FROM allnames WHERE name3 LIKE '$name%').....UNION(SELECT name17 FROM allnames WHERE name17 LIKE '$name%')ORDER BY 1";
$result = mysql_query($query);
if (!$result) die ("Database access failed: " . mysql_error());
$num_rows=mysql_num_rows($result);
if(mysql_num_rows($result)==0)                              
{
                       /* some code omitted  */

while($row = mysql_fetch_assoc($result)){
$array= $row;
foreach($array as $var){
if(!empty($var)){                                   
$str=($var); 
$str=strtoupper($str);
?&gt;       
</code></pre>

<p>I would really like to replace the FORM with a line 'A' 'B' 'C' 'D' etc then onclick on a letter would initiate the SELECT query and print the index.<br />
I am told this can only be done with JavaScript or Ajax neither of which I know. I this the only way ? If so could someone describe what it involves and give some pointers?</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/javascript-dhtml-ajax/117">JavaScript / DHTML / AJAX</category>
			<dc:creator>furlanut</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455665/where-next-javascriptajax-or-</guid>
		</item>
				<item>
			<title>scrollto animation not working</title>
			<link>http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455557/scrollto-animation-not-working</link>
			<pubDate>Wed, 29 May 2013 18:32:41 +0000</pubDate>
			<description>I have a script that loads in content using jquery. With the popstate/pushstate function everything is working beautifully, when they click on navigation links. But I also have some a href tags on one of the loaded pages for sliding down to anchor points on the page. This seems to ...</description>
			<content:encoded><![CDATA[ <p>I have a script that loads in content using jquery. With the popstate/pushstate function everything is working beautifully, when they click on navigation links. But I also have some a href tags on one of the loaded pages for sliding down to anchor points on the page. This seems to run the popstate/pushtate animation, instead of just animating down the page, like I want.</p>

<p>I think it's caused by the window popstate function at the end of the script for loading content. The page reloads, rather than recognizing it was just a hash to an anchor on the page. I'm not sure how to work around it.</p>

<p>here's my problem page that gets loaded into index.php</p>

<pre><code class="language-js">&lt;script type='text/javascript' src='js/dynamicpage.js'&gt;&lt;/script&gt;

&lt;a href="#down1" id="a_1" class="portfolio_links"&gt;
                &lt;img src="images/portfolio/PortfolioBtnImage1_b.jpg" class="portfolio_thumbs" data-color="images/portfolio/PortfolioBtnImage1_a.jpg" data-bw="images/portfolio/PortfolioBtnImage1_b.jpg"&gt;
            &lt;/a&gt;     

            &lt;a href="#down2" id="a_2" class="portfolio_links"&gt;
                &lt;img src="images/portfolio/PortfolioBtnImage2_b.jpg" class="portfolio_thumbs"  data-color="images/portfolio/PortfolioBtnImage2_a.jpg" data-bw="images/portfolio/PortfolioBtnImage2_b.jpg"&gt;
            &lt;/a&gt; 


            &lt;a href="#down3" id="a_3" class="portfolio_links"&gt;
                &lt;img src="images/portfolio/PortfolioBtnImage3_b.jpg" class="portfolio_thumbs"  data-color="images/portfolio/PortfolioBtnImage3_a.jpg" data-bw="images/portfolio/PortfolioBtnImage3_b.jpg"&gt;
            &lt;/a&gt;

&lt;a name="down1" id="position_1"&gt; 
        &lt;p&gt;Below is where the slideshow should be showing&lt;/p&gt;
    &lt;/a&gt;
    &lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;
    &lt;a name="down2" id="position_1"&gt; 
        &lt;p&gt;Below is where the slideshow should be showing&lt;/p&gt;
    &lt;/a&gt;
&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;
&lt;a name="down3" id="position_1"&gt; 
        &lt;p&gt;Below is where the slideshow should be showing&lt;/p&gt;
    &lt;/a&gt;
</code></pre>

<p>the script for the scroll down is simple:</p>

<pre><code class="language-js">// 'scroll to' code

$('.portfolio_links').live('click', function(){ 

    $('.portfolio_links a').preventdefault();

    var whichTag = $(this).attr('id');
    val = whichTag.split("_");
    thisTag = "#position_"+val[1];

    $('html, body').animate({scrollTop: $(thisTag).offset().top - 100}, 2000);

});
</code></pre>

<p>And here's the loading script that is causing the problem:</p>

<pre><code class="language-js">$(function() {

    if(Modernizr.history){

    var newHash      = "",
        $mainContent = $("#main-content"),
        $pageWrap    = $("#page-wrap"),
        baseHeight   = 0,
        $el;

    $pageWrap.height($pageWrap.height());
    baseHeight = $pageWrap.height() - $mainContent.height();

    $("#main_nav").delegate("a", "click", function() {
        _link = $(this).attr("href");
        history.pushState(null, null, _link);
        loadContent(_link);
        return false;
    });

    function loadContent(href){
        $mainContent
                .find("#guts")
                .fadeOut(700, function() {
                    $mainContent.hide().load(href + " #guts", function() {
                        $mainContent.fadeIn(300, function() {

                            $pageWrap.animate({
                                height: baseHeight + $mainContent.height() + "px"
                            });
                        });
                        $("#main_nav a").removeClass("current");
                        console.log(href);
                        $("nav a[href$="+href+"]").addClass("current");


                            $.getScript("js/carousel2.js", function(data, textStatus, jqxhr) {
                                console.log(data); //data returned
                                console.log(textStatus); //success
                                console.log(jqxhr.status); //200
                                console.log('Load was performed.');
                                });

                            $.getScript("js/jquery.carouFredSel-6.2.1-packed.js", function(data, textStatus, jqxhr) {
                                console.log(data); //data returned
                                console.log(textStatus); //success
                                console.log(jqxhr.status); //200
                                console.log('Load was performed.');
                                }); 

                    });
                });
    }

    $(window).bind('popstate', function(){
       _link = location.pathname.replace(/^.*[\\\/]/, ''); //get filename only
       loadContent(_link);
    });

} // otherwise, history is not supported, so nothing fancy here.


});
</code></pre>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/javascript-dhtml-ajax/117">JavaScript / DHTML / AJAX</category>
			<dc:creator>turpentyne</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455557/scrollto-animation-not-working</guid>
		</item>
				<item>
			<title>Updating a total price</title>
			<link>http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455547/updating-a-total-price</link>
			<pubDate>Wed, 29 May 2013 14:38:31 +0000</pubDate>
			<description>Hi folks, It's a bit unusual for me to post in the javascript forum but I'm after a bit of assistance if possible. **The scenario:** I have a form with text input box for a user to enter a 'quantity' in. This can be anything from 1 to 99. When ...</description>
			<content:encoded><![CDATA[ <p>Hi folks,</p>

<p>It's a bit unusual for me to post in the javascript forum but I'm after a bit of assistance if possible.</p>

<p><strong>The scenario:</strong><br />
I have a form with text input box for a user to enter a 'quantity' in.  This can be anything from 1 to 99.<br />
When a user enters a 'quantity' it should be multiplied by a set 'price' (£2) and the total should be displayed in a 'total' box.</p>

<p><strong>Scenario example:</strong><br />
A user enters a quantity of 5, this is multiplied by the set price and £10 is displayed in the total box.</p>

<p><strong>Current state of play:</strong><br />
I can get this to partly work with an onchange trigger on the quantity box that fires a function to calcutate the new total and display it on the form.  The total changes correctly whenever focus leaves the quantity box.</p>

<p><strong>The problem:</strong><br />
If a user enters a quantity then clicks on the submit button before focus has left the quantity box, the total does change but the user doesn't get a chance to see the updated price (to confirm it is ok) before the form is submitted.</p>

<p><strong>What I tried:</strong><br />
I thought about disabling the submit button if focus is in the quantity box but this reduces usability quite a bit.<br />
I considered forcing the focus to leave the quantity box once a user has entered 2 digits, but this doesn't help if the quantity is a single digit.</p>

<p><strong>The question:</strong><br />
Is there a way, without using AJAX if possible, to update the total as the user types into the quantity box?  Or any other possible solutions?</p>

<p><strong>Example code:</strong></p>

<pre><code class="language-js">&lt;script type="text/javascript"&gt;
function ReprintPrice(){
    var theQuantity = document.getElementById("quantity").value,
        newPrice;
    newPrice = (theQuantity * 2);
    newPrice = parseFloat(newPrice).toFixed(2);
    document.getElementById("entrycost").innerHTML="&amp;#163;"+newPrice;
}
&lt;/script&gt;

&lt;input id="quantity" name="quantity" onchange="ReprintPrice()" maxlength="2" size="1" value="0" type="text" /&gt;
&lt;span id="entrycost"&gt;&amp;#163;0.00&lt;/span&gt;
&lt;input type="button" value="Submit" onclick='alert("Form Submitted before I got a chance to see the updated price")' title="submit" /&gt;
</code></pre>

<p>Any help in this would be greatly appreciated.<br />
Zagga</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/javascript-dhtml-ajax/117">JavaScript / DHTML / AJAX</category>
			<dc:creator>Zagga</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455547/updating-a-total-price</guid>
		</item>
				<item>
			<title>jQuery effect</title>
			<link>http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455536/jquery-effect</link>
			<pubDate>Wed, 29 May 2013 12:23:46 +0000</pubDate>
			<description>Which jQuery effect rotate image like in the picture I have uploaded. I saw the effect few months ago but dnt know what do we call it. Can anybody please help? Or any other plugin that will add random effects to images?</description>
			<content:encoded><![CDATA[ <p>Which jQuery effect rotate image like in the picture I have uploaded. I saw the effect few months ago but dnt know what do we call it. Can anybody please help?</p>

<p>Or any other plugin that will add random effects to images?</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/javascript-dhtml-ajax/117">JavaScript / DHTML / AJAX</category>
			<dc:creator>webdevstudent</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455536/jquery-effect</guid>
		</item>
				<item>
			<title>Form Submit</title>
			<link>http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455511/form-submit</link>
			<pubDate>Wed, 29 May 2013 06:14:27 +0000</pubDate>
			<description>I have a form to submit the details as below: &lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD HTML 4.01//EN&quot; &quot;http://www.w3.org/TR/html4/strict.dtd&quot;&gt; &lt;html&gt;&lt;head&gt; &lt;meta content=&quot;text/html; charset=ISO-8859-1&quot; http-equiv=&quot;content-type&quot;&gt;&lt;title&gt;Activate&lt;/title&gt; &lt;script type=&quot;text/javascript&quot; src=&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js?ver=3.0.1&quot;&gt; &lt;/script&gt; &lt;script type=&quot;text/javascript&quot; src=&quot;js/activate.js&quot;&gt; &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;form method=&quot;post&quot; name=&quot;form&quot;&gt; &lt;table style=&quot;text-align: left; width: 789px; height: 715px;&quot; border=&quot;0&quot; cellpadding=&quot;2&quot; cellspacing=&quot;2&quot;&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td style=&quot;width: 305px;&quot;&gt; ...</description>
			<content:encoded><![CDATA[ <p>I have a form to submit the details as below:</p>

<pre><code class="language-js">&lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "<a href="http://www.w3.org/TR/html4/strict.dtd" rel="nofollow">http://www.w3.org/TR/html4/strict.dtd</a>"&gt;
&lt;html&gt;&lt;head&gt;
&lt;meta content="text/html; charset=ISO-8859-1" http-equiv="content-type"&gt;&lt;title&gt;Activate&lt;/title&gt;
&lt;script type="text/javascript" src="<a href="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js?ver=3.0.1" rel="nofollow">http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js?ver=3.0.1</a>"&gt;
&lt;/script&gt;
&lt;script type="text/javascript" src="js/activate.js"&gt;
&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;form method="post" name="form"&gt;
&lt;table style="text-align: left; width: 789px; height: 715px;" border="0" cellpadding="2" cellspacing="2"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="width: 305px;"&gt;
Your Full Name: &lt;br&gt;
&lt;input size="47" id="name" name="name"&gt;
&lt;/td&gt;
&lt;td style="width: 464px;"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="width: 305px;"&gt;Company Name: &lt;br&gt;
&lt;input size="47" id="cmpName" name="cmpName"&gt;&lt;/td&gt;
&lt;td style="width: 464px;"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="width: 305px; height: 50px;"&gt;Your Email:&lt;br&gt;
&lt;input size="47" id="email" name="email"&gt;&lt;/td&gt;
&lt;td style="width: 464px; height: 50px;"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="width: 305px; height: 50px;"&gt;Telephone:
(Please include
Country Code)&lt;br&gt;
&lt;input size="47" id="tel" name="tel"&gt;&lt;/td&gt;
&lt;td style="width: 464px; height: 50px;"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="width: 305px; height: 50px;"&gt;Mobile
Phone: &lt;br&gt;
&lt;input size="47" id="mobile" name="mobile"&gt;&lt;/td&gt;
&lt;td style="width: 464px; height: 50px;"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="width: 305px; height: 50px;"&gt;Street
Address Line 1&lt;br&gt;
&lt;input size="47" id="address1" name="address1"&gt;&lt;/td&gt;
&lt;td style="width: 464px; height: 50px;"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="width: 305px; height: 50px;"&gt;Street
Address Line 2&lt;br&gt;
&lt;input size="47" id="address2" name="address2"&gt;&lt;/td&gt;
&lt;td style="width: 464px; height: 50px;"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="width: 305px; height: 50px;"&gt;City:&lt;br&gt;
&lt;input size="47" id="city" name="city"&gt;&lt;/td&gt;
&lt;td style="width: 464px; height: 50px;"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="width: 305px; height: 50px;"&gt;Postal /
Zip
Code: &lt;br&gt;
&lt;input size="47" id="postal" name="postal"&gt;&lt;/td&gt;
&lt;td style="width: 464px; height: 50px;"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="width: 305px; height: 50px;"&gt;Province /
State: &lt;br&gt;
&lt;input size="47" id="province" name="province"&gt;&lt;/td&gt;
&lt;td style="width: 464px; height: 50px;"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="width: 305px; height: 50px;"&gt;
Country: &lt;br&gt;
&lt;select id="country" name="country"&gt;&lt;option value="Afghanistan"&gt;Afghanistan&lt;/option&gt;&lt;option value="Albania"&gt;Albania&lt;/option&gt;&lt;option value="Algeria"&gt;Algeria&lt;/option&gt;&lt;option value="American Samoa"&gt;American Samoa&lt;/option&gt;&lt;option value="Andorra"&gt;Andorra&lt;/option&gt;&lt;option value="Angola"&gt;Angola&lt;/option&gt;&lt;option value="Anguilla"&gt;Anguilla&lt;/option&gt;&lt;option value="Antartica"&gt;Antarctica&lt;/option&gt;&lt;option value="Antigua and Barbuda"&gt;Antigua and
Barbuda&lt;/option&gt;&lt;option value="Argentina"&gt;Argentina&lt;/option&gt;&lt;option value="Armenia"&gt;Armenia&lt;/option&gt;&lt;option value="Aruba"&gt;Aruba&lt;/option&gt;&lt;option value="Australia"&gt;Australia&lt;/option&gt;&lt;option value="Austria"&gt;Austria&lt;/option&gt;&lt;option value="Azerbaijan"&gt;Azerbaijan&lt;/option&gt;&lt;option value="Bahamas"&gt;Bahamas&lt;/option&gt;&lt;option value="Bahrain"&gt;Bahrain&lt;/option&gt;&lt;option value="Bangladesh"&gt;Bangladesh&lt;/option&gt;&lt;option value="Barbados"&gt;Barbados&lt;/option&gt;&lt;option value="Belarus"&gt;Belarus&lt;/option&gt;&lt;option value="Belgium"&gt;Belgium&lt;/option&gt;&lt;option value="Belize"&gt;Belize&lt;/option&gt;&lt;option value="Benin"&gt;Benin&lt;/option&gt;&lt;option value="Bermuda"&gt;Bermuda&lt;/option&gt;&lt;option value="Bhutan"&gt;Bhutan&lt;/option&gt;&lt;option value="Bolivia"&gt;Bolivia&lt;/option&gt;&lt;option value="Bosnia and Herzegowina"&gt;Bosnia and
Herzegowina&lt;/option&gt;&lt;option value="Botswana"&gt;Botswana&lt;/option&gt;&lt;option value="Bouvet Island"&gt;Bouvet Island&lt;/option&gt;&lt;option value="Brazil"&gt;Brazil&lt;/option&gt;&lt;option value="British Indian Ocean Territory"&gt;British
Indian Ocean Territory&lt;/option&gt;&lt;option value="Brunei Darussalam"&gt;Brunei Darussalam&lt;/option&gt;&lt;option value="Bulgaria"&gt;Bulgaria&lt;/option&gt;&lt;option value="Burkina Faso"&gt;Burkina Faso&lt;/option&gt;&lt;option value="Burundi"&gt;Burundi&lt;/option&gt;&lt;option value="Cambodia"&gt;Cambodia&lt;/option&gt;&lt;option value="Cameroon"&gt;Cameroon&lt;/option&gt;&lt;option value="Canada"&gt;Canada&lt;/option&gt;&lt;option value="Cape Verde"&gt;Cape Verde&lt;/option&gt;&lt;option value="Cayman Islands"&gt;Cayman Islands&lt;/option&gt;&lt;option value="Central African Republic"&gt;Central
African Republic&lt;/option&gt;&lt;option value="Chad"&gt;Chad&lt;/option&gt;&lt;option value="Chile"&gt;Chile&lt;/option&gt;&lt;option value="China"&gt;China&lt;/option&gt;&lt;option value="Christmas Island"&gt;Christmas Island&lt;/option&gt;&lt;option value="Cocos Islands"&gt;Cocos (Keeling)
Islands&lt;/option&gt;&lt;option value="Colombia"&gt;Colombia&lt;/option&gt;&lt;option value="Comoros"&gt;Comoros&lt;/option&gt;&lt;option value="Congo"&gt;Congo&lt;/option&gt;&lt;option value="Congo"&gt;Congo, the Democratic
Republic
of the&lt;/option&gt;&lt;option value="Cook Islands"&gt;Cook Islands&lt;/option&gt;&lt;option value="Costa Rica"&gt;Costa Rica&lt;/option&gt;&lt;option value="Cota D'Ivoire"&gt;Cote d'Ivoire&lt;/option&gt;&lt;option value="Croatia"&gt;Croatia (Hrvatska)&lt;/option&gt;&lt;option value="Cuba"&gt;Cuba&lt;/option&gt;&lt;option value="Cyprus"&gt;Cyprus&lt;/option&gt;&lt;option value="Czech Republic"&gt;Czech Republic&lt;/option&gt;&lt;option value="Denmark"&gt;Denmark&lt;/option&gt;&lt;option value="Djibouti"&gt;Djibouti&lt;/option&gt;&lt;option value="Dominica"&gt;Dominica&lt;/option&gt;&lt;option value="Dominican Republic"&gt;Dominican
Republic&lt;/option&gt;&lt;option value="East Timor"&gt;East Timor&lt;/option&gt;&lt;option value="Ecuador"&gt;Ecuador&lt;/option&gt;&lt;option value="Egypt"&gt;Egypt&lt;/option&gt;&lt;option value="El Salvador"&gt;El Salvador&lt;/option&gt;&lt;option value="Equatorial Guinea"&gt;Equatorial Guinea&lt;/option&gt;&lt;option value="Eritrea"&gt;Eritrea&lt;/option&gt;&lt;option value="Estonia"&gt;Estonia&lt;/option&gt;&lt;option value="Ethiopia"&gt;Ethiopia&lt;/option&gt;&lt;option value="Falkland Islands"&gt;Falkland Islands
(Malvinas)&lt;/option&gt;&lt;option value="Faroe Islands"&gt;Faroe Islands&lt;/option&gt;&lt;option value="Fiji"&gt;Fiji&lt;/option&gt;&lt;option value="Finland"&gt;Finland&lt;/option&gt;&lt;option value="France"&gt;France&lt;/option&gt;&lt;option value="France Metropolitan"&gt;France,
Metropolitan&lt;/option&gt;&lt;option value="French Guiana"&gt;French Guiana&lt;/option&gt;&lt;option value="French Polynesia"&gt;French Polynesia&lt;/option&gt;&lt;option value="French Southern Territories"&gt;French
Southern Territories&lt;/option&gt;&lt;option value="Gabon"&gt;Gabon&lt;/option&gt;&lt;option value="Gambia"&gt;Gambia&lt;/option&gt;&lt;option value="Georgia"&gt;Georgia&lt;/option&gt;&lt;option value="Germany"&gt;Germany&lt;/option&gt;&lt;option value="Ghana"&gt;Ghana&lt;/option&gt;&lt;option value="Gibraltar"&gt;Gibraltar&lt;/option&gt;&lt;option value="Greece"&gt;Greece&lt;/option&gt;&lt;option value="Greenland"&gt;Greenland&lt;/option&gt;&lt;option value="Grenada"&gt;Grenada&lt;/option&gt;&lt;option value="Guadeloupe"&gt;Guadeloupe&lt;/option&gt;&lt;option value="Guam"&gt;Guam&lt;/option&gt;&lt;option value="Guatemala"&gt;Guatemala&lt;/option&gt;&lt;option value="Guinea"&gt;Guinea&lt;/option&gt;&lt;option value="Guinea-Bissau"&gt;Guinea-Bissau&lt;/option&gt;&lt;option value="Guyana"&gt;Guyana&lt;/option&gt;&lt;option value="Haiti"&gt;Haiti&lt;/option&gt;&lt;option value="Heard and McDonald Islands"&gt;Heard
and
Mc Donald Islands&lt;/option&gt;&lt;option value="Holy See"&gt;Holy See (Vatican City
State)&lt;/option&gt;&lt;option value="Honduras"&gt;Honduras&lt;/option&gt;&lt;option value="Hong Kong"&gt;Hong Kong&lt;/option&gt;&lt;option value="Hungary"&gt;Hungary&lt;/option&gt;&lt;option value="Iceland"&gt;Iceland&lt;/option&gt;&lt;option value="India"&gt;India&lt;/option&gt;&lt;option value="Indonesia"&gt;Indonesia&lt;/option&gt;&lt;option value="Iran"&gt;Iran (Islamic Republic of)&lt;/option&gt;&lt;option value="Iraq"&gt;Iraq&lt;/option&gt;&lt;option value="Ireland"&gt;Ireland&lt;/option&gt;&lt;option value="Israel"&gt;Israel&lt;/option&gt;&lt;option value="Italy"&gt;Italy&lt;/option&gt;&lt;option value="Jamaica"&gt;Jamaica&lt;/option&gt;&lt;option value="Japan"&gt;Japan&lt;/option&gt;&lt;option value="Jordan"&gt;Jordan&lt;/option&gt;&lt;option value="Kazakhstan"&gt;Kazakhstan&lt;/option&gt;&lt;option value="Kenya"&gt;Kenya&lt;/option&gt;&lt;option value="Kiribati"&gt;Kiribati&lt;/option&gt;&lt;option value="Democratic People's Republic of Korea"&gt;Korea,
Democratic People's Republic of&lt;/option&gt;&lt;option value="Korea"&gt;Korea, Republic of&lt;/option&gt;&lt;option value="Kuwait"&gt;Kuwait&lt;/option&gt;&lt;option value="Kyrgyzstan"&gt;Kyrgyzstan&lt;/option&gt;&lt;option value="Lao"&gt;Lao People's Democratic
Republic&lt;/option&gt;&lt;option value="Latvia"&gt;Latvia&lt;/option&gt;&lt;option value="Lebanon" selected="selected"&gt;Lebanon&lt;/option&gt;&lt;option value="Lesotho"&gt;Lesotho&lt;/option&gt;&lt;option value="Liberia"&gt;Liberia&lt;/option&gt;&lt;option value="Libyan Arab Jamahiriya"&gt;Libyan Arab
Jamahiriya&lt;/option&gt;&lt;option value="Liechtenstein"&gt;Liechtenstein&lt;/option&gt;&lt;option value="Lithuania"&gt;Lithuania&lt;/option&gt;&lt;option value="Luxembourg"&gt;Luxembourg&lt;/option&gt;&lt;option value="Macau"&gt;Macau&lt;/option&gt;&lt;option value="Macedonia"&gt;Macedonia, The Former
Yugoslav Republic of&lt;/option&gt;&lt;option value="Madagascar"&gt;Madagascar&lt;/option&gt;&lt;option value="Malawi"&gt;Malawi&lt;/option&gt;&lt;option value="Malaysia"&gt;Malaysia&lt;/option&gt;&lt;option value="Maldives"&gt;Maldives&lt;/option&gt;&lt;option value="Mali"&gt;Mali&lt;/option&gt;&lt;option value="Malta"&gt;Malta&lt;/option&gt;&lt;option value="Marshall Islands"&gt;Marshall Islands&lt;/option&gt;&lt;option value="Martinique"&gt;Martinique&lt;/option&gt;&lt;option value="Mauritania"&gt;Mauritania&lt;/option&gt;&lt;option value="Mauritius"&gt;Mauritius&lt;/option&gt;&lt;option value="Mayotte"&gt;Mayotte&lt;/option&gt;&lt;option value="Mexico"&gt;Mexico&lt;/option&gt;&lt;option value="Micronesia"&gt;Micronesia, Federated
States of&lt;/option&gt;&lt;option value="Moldova"&gt;Moldova, Republic of&lt;/option&gt;&lt;option value="Monaco"&gt;Monaco&lt;/option&gt;&lt;option value="Mongolia"&gt;Mongolia&lt;/option&gt;&lt;option value="Montserrat"&gt;Montserrat&lt;/option&gt;&lt;option value="Morocco"&gt;Morocco&lt;/option&gt;&lt;option value="Mozambique"&gt;Mozambique&lt;/option&gt;&lt;option value="Myanmar"&gt;Myanmar&lt;/option&gt;&lt;option value="Namibia"&gt;Namibia&lt;/option&gt;&lt;option value="Nauru"&gt;Nauru&lt;/option&gt;&lt;option value="Nepal"&gt;Nepal&lt;/option&gt;&lt;option value="Netherlands"&gt;Netherlands&lt;/option&gt;&lt;option value="Netherlands Antilles"&gt;Netherlands
Antilles&lt;/option&gt;&lt;option value="New Caledonia"&gt;New Caledonia&lt;/option&gt;&lt;option value="New Zealand"&gt;New Zealand&lt;/option&gt;&lt;option value="Nicaragua"&gt;Nicaragua&lt;/option&gt;&lt;option value="Niger"&gt;Niger&lt;/option&gt;&lt;option value="Nigeria"&gt;Nigeria&lt;/option&gt;&lt;option value="Niue"&gt;Niue&lt;/option&gt;&lt;option value="Norfolk Island"&gt;Norfolk Island&lt;/option&gt;&lt;option value="Northern Mariana Islands"&gt;Northern
Mariana Islands&lt;/option&gt;&lt;option value="Norway"&gt;Norway&lt;/option&gt;&lt;option value="Oman"&gt;Oman&lt;/option&gt;&lt;option value="Pakistan"&gt;Pakistan&lt;/option&gt;&lt;option value="Palau"&gt;Palau&lt;/option&gt;&lt;option value="Panama"&gt;Panama&lt;/option&gt;&lt;option value="Papua New Guinea"&gt;Papua New Guinea&lt;/option&gt;&lt;option value="Paraguay"&gt;Paraguay&lt;/option&gt;&lt;option value="Peru"&gt;Peru&lt;/option&gt;&lt;option value="Philippines"&gt;Philippines&lt;/option&gt;&lt;option value="Pitcairn"&gt;Pitcairn&lt;/option&gt;&lt;option value="Poland"&gt;Poland&lt;/option&gt;&lt;option value="Portugal"&gt;Portugal&lt;/option&gt;&lt;option value="Puerto Rico"&gt;Puerto Rico&lt;/option&gt;&lt;option value="Qatar"&gt;Qatar&lt;/option&gt;&lt;option value="Reunion"&gt;Reunion&lt;/option&gt;&lt;option value="Romania"&gt;Romania&lt;/option&gt;&lt;option value="Russia"&gt;Russian Federation&lt;/option&gt;&lt;option value="Rwanda"&gt;Rwanda&lt;/option&gt;&lt;option value="Saint Kitts and Nevis"&gt;Saint Kitts
and Nevis&lt;/option&gt;&lt;option value="Saint LUCIA"&gt;Saint LUCIA&lt;/option&gt;&lt;option value="Saint Vincent"&gt;Saint Vincent and
the
Grenadines&lt;/option&gt;&lt;option value="Samoa"&gt;Samoa&lt;/option&gt;&lt;option value="San Marino"&gt;San Marino&lt;/option&gt;&lt;option value="Sao Tome and Principe"&gt;Sao Tome and
Principe&lt;/option&gt;&lt;option value="Saudi Arabia"&gt;Saudi Arabia&lt;/option&gt;&lt;option value="Senegal"&gt;Senegal&lt;/option&gt;&lt;option value="Seychelles"&gt;Seychelles&lt;/option&gt;&lt;option value="Sierra"&gt;Sierra Leone&lt;/option&gt;&lt;option value="Singapore"&gt;Singapore&lt;/option&gt;&lt;option value="Slovakia"&gt;Slovakia (Slovak Republic)&lt;/option&gt;&lt;option value="Slovenia"&gt;Slovenia&lt;/option&gt;&lt;option value="Solomon Islands"&gt;Solomon Islands&lt;/option&gt;&lt;option value="Somalia"&gt;Somalia&lt;/option&gt;&lt;option value="South Africa"&gt;South Africa&lt;/option&gt;&lt;option value="South Georgia"&gt;South Georgia and
the
South Sandwich Islands&lt;/option&gt;&lt;option value="Span"&gt;Spain&lt;/option&gt;&lt;option value="SriLanka"&gt;Sri Lanka&lt;/option&gt;&lt;option value="St. Helena"&gt;St. Helena&lt;/option&gt;&lt;option value="St. Pierre and Miguelon"&gt;St. Pierre
and Miquelon&lt;/option&gt;&lt;option value="Sudan"&gt;Sudan&lt;/option&gt;&lt;option value="Suriname"&gt;Suriname&lt;/option&gt;&lt;option value="Svalbard"&gt;Svalbard and Jan Mayen
Islands&lt;/option&gt;&lt;option value="Swaziland"&gt;Swaziland&lt;/option&gt;&lt;option value="Sweden"&gt;Sweden&lt;/option&gt;&lt;option value="Switzerland"&gt;Switzerland&lt;/option&gt;&lt;option value="Syria"&gt;Syrian Arab Republic&lt;/option&gt;&lt;option value="Taiwan"&gt;Taiwan, Province of China&lt;/option&gt;&lt;option value="Tajikistan"&gt;Tajikistan&lt;/option&gt;&lt;option value="Tanzania"&gt;Tanzania, United Republic
of&lt;/option&gt;&lt;option value="Thailand"&gt;Thailand&lt;/option&gt;&lt;option value="Togo"&gt;Togo&lt;/option&gt;&lt;option value="Tokelau"&gt;Tokelau&lt;/option&gt;&lt;option value="Tonga"&gt;Tonga&lt;/option&gt;&lt;option value="Trinidad and Tobago"&gt;Trinidad and
Tobago&lt;/option&gt;&lt;option value="Tunisia"&gt;Tunisia&lt;/option&gt;&lt;option value="Turkey"&gt;Turkey&lt;/option&gt;&lt;option value="Turkmenistan"&gt;Turkmenistan&lt;/option&gt;&lt;option value="Turks and Caicos"&gt;Turks and Caicos
Islands&lt;/option&gt;&lt;option value="Tuvalu"&gt;Tuvalu&lt;/option&gt;&lt;option value="Uganda"&gt;Uganda&lt;/option&gt;&lt;option value="Ukraine"&gt;Ukraine&lt;/option&gt;&lt;option value="United Arab Emirates"&gt;United Arab
Emirates&lt;/option&gt;&lt;option value="United Kingdom"&gt;United Kingdom&lt;/option&gt;&lt;option value="United States"&gt;United States&lt;/option&gt;&lt;option value="United States Minor Outlying Islands"&gt;United
States Minor Outlying Islands&lt;/option&gt;&lt;option value="Uruguay"&gt;Uruguay&lt;/option&gt;&lt;option value="Uzbekistan"&gt;Uzbekistan&lt;/option&gt;&lt;option value="Vanuatu"&gt;Vanuatu&lt;/option&gt;&lt;option value="Venezuela"&gt;Venezuela&lt;/option&gt;&lt;option value="Vietnam"&gt;Viet Nam&lt;/option&gt;&lt;option value="Virgin Islands (British)"&gt;Virgin
Islands (British)&lt;/option&gt;&lt;option value="Virgin Islands (U.S)"&gt;Virgin
Islands
(U.S.)&lt;/option&gt;&lt;option value="Wallis and Futana Islands"&gt;Wallis
and
Futuna Islands&lt;/option&gt;&lt;option value="Western Sahara"&gt;Western Sahara&lt;/option&gt;&lt;option value="Yemen"&gt;Yemen&lt;/option&gt;&lt;option value="Yugoslavia"&gt;Yugoslavia&lt;/option&gt;&lt;option value="Zambia"&gt;Zambia&lt;/option&gt;&lt;option value="Zimbabwe"&gt;Zimbabwe&lt;/option&gt;&lt;/select&gt;
&lt;/td&gt;
&lt;td style="width: 464px; height: 50px;"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="width: 305px; height: 50px;"&gt;my iBOX
IPTV
Serial Number:&lt;br&gt;
&lt;input size="47" id="serialNo" name="serialNo"&gt;&lt;/td&gt;
&lt;td style="width: 464px; height: 50px;"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="width: 305px; height: 24px;"&gt;&lt;/td&gt;
&lt;td style="width: 464px; height: 24px;"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="width: 305px; height: 30px;"&gt;Active my
iBox IPTV &lt;input id="agree" name="agree" type="checkbox"&gt;&lt;/td&gt;
&lt;td style="width: 464px; height: 30px;"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="width: 305px; height: 34px;"&gt;
&lt;div&gt;
&lt;input value="Submit" type="submit" class="submit"&gt;&lt;span class="error" style="display: none;"&gt; Please Enter
Valid Info&lt;/span&gt;
&lt;span class="success" style="display: none;"&gt;Registration
Successfully&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
&lt;td style="width: 464px; height: 34px;"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/form&gt;
&lt;br&gt;
&lt;/body&gt;&lt;/html&gt;
</code></pre>

<p>I am using the following jquery to validate the details from the form above:</p>

<pre><code class="language-js">$(function(){
    $(".submit").click(function(){
               var name = $("#name").val();
               var cmpName = $("#cmpName").val();
               var email = $("#email").val();
               var tel = $("#tel").val();
               var mobile = $("#mobile").val();
               var addr1 = $("#address1").val();
               var addr2 = $("#address2").val();
               var city = $("#city").val();
               var postal = $("#postal").val();
               var province = $("#province").val();
               var country = $("#country").val();
               var serialNo = $("#serialNo").val();   

               var param = 'name='+ name + '&amp;cmpName=' + cmpName + '&amp;email=' + email + '&amp;tel=' + tel + '&amp;mobile=' + mobile + '$addr1=' + addr1 + '&amp;addr2='
               + addr2 + '&amp;city=' + city + '&amp;postal=' + postal + '&amp;province=' + province + '&amp;country=' + country + '&amp;serialNo=' + serialNo; 


               if(name=='' || email=='' || tel=='' || addr1=='' || city=='' || postal=='' || province=='' || country=='' || serialNo==''){ 
                    $('.success').fadeOut(200).hide();
                    $('.error').fadeOut(200).show();
               }else{
                    $.ajax({
            type: "POST",
                        url: "test.php",
                        data: param,
                        success: function(){
                             $('.success').fadeIn(200).show();
                             $('.error').fadeOut(200).hide();
                        }   
                });
               }
               return false;
        });
});
</code></pre>

<p>So when I click on the submit button with an empty name for example, I get an error message. The problem is that when I click on the submit button once again the error disappears although the name is empty. After that I click on the submit button again the error appears again. Did I miss out something in the code?</p>

<p>Your help is kindly appreciated.</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/javascript-dhtml-ajax/117">JavaScript / DHTML / AJAX</category>
			<dc:creator>solomon_13000</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455511/form-submit</guid>
		</item>
				<item>
			<title>Understanding how to use Math.min on an Array</title>
			<link>http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455508/understanding-how-to-use-math.min-on-an-array</link>
			<pubDate>Wed, 29 May 2013 05:21:15 +0000</pubDate>
			<description>I have two array's Array1[1,3,5,7,4,0,8] Array2[1,5,8,3,4,2,9] What I would like to achieve is an output count = 3( three of the numbers 3,5,8 from Array2 are in Array1 but in the wrong place) using Math.min. Can someone explain this process to me please. Thank you</description>
			<content:encoded><![CDATA[ <p>I have two array's<br />
Array1[1,3,5,7,4,0,8]<br />
Array2[1,5,8,3,4,2,9]</p>

<p>What I would like to achieve is an output   count = 3( three of the numbers 3,5,8 from Array2 are in Array1 but in the wrong place) using Math.min.</p>

<p>Can someone explain this process to me please. Thank you</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/javascript-dhtml-ajax/117">JavaScript / DHTML / AJAX</category>
			<dc:creator>jenny1975</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455508/understanding-how-to-use-math.min-on-an-array</guid>
		</item>
				<item>
			<title>jqGrid setting globally emptyrecords</title>
			<link>http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455490/jqgrid-setting-globally-emptyrecords</link>
			<pubDate>Tue, 28 May 2013 19:57:09 +0000</pubDate>
			<description>Hi all. I have a grid table and I need to set globally 2 kind of values for **emptyrecords**: 1. 'Nothing to display from the DB' -&gt; if no data is retrieved from mysql 2. 'No data matches the search' -&gt; after using search and nothing matched. Till now I ...</description>
			<content:encoded><![CDATA[ <p>Hi all.</p>

<p>I have a grid table and I need to set globally 2 kind of values for <strong>emptyrecords</strong>:<br />
1. 'Nothing to display from the DB' -&gt; if no data is retrieved from mysql<br />
2. 'No data matches the search' -&gt; after using search and nothing matched.</p>

<p>Till now I succeeded just to set globally <strong>emptyrecords</strong>, but only with one value:</p>

<pre><code class="language-js">$.extend($.jgrid.defaults,{emptyrecords: "Nothing to display"});
</code></pre>

<p>I have tried to combine with other methods:<br />
-beforeProcessing<br />
-gridComplete<br />
-loadComplete<br />
-jQuery("#grid-tbl").jqGrid('navGrid','#grid-pg',{emptyrecords: "No data matches the search"});<br />
but it didn't work.</p>

<p>Please advise if it is possible to achieve this with jqGrid?</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/javascript-dhtml-ajax/117">JavaScript / DHTML / AJAX</category>
			<dc:creator>eburlea</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455490/jqgrid-setting-globally-emptyrecords</guid>
		</item>
				<item>
			<title>toggle images using data- attribute</title>
			<link>http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455483/toggle-images-using-data-attribute</link>
			<pubDate>Tue, 28 May 2013 18:14:41 +0000</pubDate>
			<description>Maybe there's a better way to do this. but I thought I'd try. I want to write a simple image toggle script that would work with multiple images. When the user mouses over, change the src, using the data- attribute. Then on mouseout, revert to the original src. Is this ...</description>
			<content:encoded><![CDATA[ <p>Maybe there's a better way to do this. but I thought I'd try.</p>

<p>I want to write a simple image toggle script that would work with multiple images.</p>

<p>When the user mouses over, change the src, using the data- attribute. Then on mouseout, revert to the original src.</p>

<p>Is this a dumb way to do it?</p>

<p>I got this far. it switches the src, but I'm not sure how to save the original src to revert back on mouseout.</p>

<pre><code class="language-js">$('.portfolio_thumbs').live('hover', function(){ 

    var thumbnail = $(this).attr("src");
    var whichThumb = $(this).data('color');

    if ($(thumbnail).attr("src") !== whichThumb){

        $(this).attr("src", whichThumb);

   } else {

        $(this).attr("src", thumbnail);
   }

});
</code></pre>

<p>The images in the html are like this:</p>

<pre><code class="language-js">&lt;img src="images/portfolio/Image1.jpg" class="portfolio_thumbs" data-color="images/portfolio/Image1Color.jpg"&gt;

&lt;img src="images/portfolio/Image2.jpg" class="portfolio_thumbs"  data-color="images/portfolio/Image2Color.jpg"&gt;

&lt;img src="images/portfolio/Image3.jpg" class="portfolio_thumbs"  data-color="images/portfolio/Image3Color.jpg"&gt;
</code></pre>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/javascript-dhtml-ajax/117">JavaScript / DHTML / AJAX</category>
			<dc:creator>turpentyne</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455483/toggle-images-using-data-attribute</guid>
		</item>
				<item>
			<title>script change to run at later moment</title>
			<link>http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455472/script-change-to-run-at-later-moment</link>
			<pubDate>Tue, 28 May 2013 13:31:53 +0000</pubDate>
			<description>This script is set to run automatically. The syntax is stuff I'm not used to. How can I change this script to run at a later point? Such as when an image loads. Or another delayed point from when the page it's on is loaded in with ajax. Like this, ...</description>
			<content:encoded><![CDATA[ <p>This script is set to run automatically. The syntax is stuff I'm not used to. How can I change this script to run at a later point? Such as when an image loads. Or another delayed point from when the page it's on is loaded in with ajax. Like this, it won't work:</p>

<p>I tried to change "document ready" section to when an image loads at the bottom of the page, but it didn't work either. I did something like: "$('img #trigger').ready(function() { ... but with no success.</p>

<p>The guts of the script seem irrelevent - if I delete everything but the alert('function is running');, it still doesn't run.</p>

<p>if I put it in the parent index.php file, the alert will run, but the rest of the script does nothing.</p>

<pre><code class="language-js">&lt;script type="text/javascript" language="javascript"&gt;
        (function($, window, document) {

    var $doc = $(document),
        $win = $(window);
        wWidth = $win.width();

 //tried window.onload = function() - also didn't work



   $(document).ready(function() {
   alert('function is running');

                function reset() {

            timer = setInterval(function(){
                index++;

                if (index&gt;=$img.length) {
                    index=0;
                }

                $current=$paging.eq(index);
                move();
            }, 8000);
        }


        if ( $('.slideshow').length ) {
            var h = 532;
            var $img = $('.slideshow .carousel img');
            var $paging = '';
            var $carousel = $('.slideshow .carousel div');

            if ( $('.residence-slideshow').length ) {
                h = 644;
            }


            $carousel.width(($img.length * 1200)+60);

            for (var i=0; i&lt;$img.length;i++) {
                var c = i===0?' class="selected" ':'';
                $paging += '&lt;a href="#" '+c+'&gt;&lt;/a&gt;';
            }

            $paging = $($paging);

            var index = 0;
            var $current = $paging.eq(index);
            var timer = false;

            $('.slideshow-paging').append($paging);


            $paging.on('click', function(e){
                e.preventDefault();
                index = $paging.index(this);
                $current=$(this);
                move();
                reset();
                return false;
            });

            $('.slideshow .arrows').on('click', function(){
                index = $(this).hasClass('arrows-left')?index-1:index+1;
                index = (index&lt;0)?$img.length-1:(index&gt;$img.length-1?0:index);
                $current=$paging.eq(index);
                move();
                reset();
            });


            $img.on('mouseover', function(){
                clearInterval(timer);
            })
            .on('mouseout', reset);


            reset();
        }

        if ( $('.places-slideshow').length ) {
            $('.places-slideshow .carousel').fadeIn().carouFredSel({
                align: 'left',
                responsive: true,
                items: {
                    visible: 1
                },
                scroll: {
                    items: 1,
                    fx: 'directscroll',
                    duration: 500,
                    timeoutDuration: 5000,
                    pauseOnHover: true,
                    onAfter: function( data ) {
                        data.items.visible.find('.slide-text').fadeIn('slow');

                        setTimeout(function() {
                            data.items.visible.find('.slide-text').fadeOut('slow');
                        }, 4500);
                    }
                },

                auto: {
                     timeoutDuration: 3500,
                     delay: 3500
                },


                prev: {
                    key: 'left',
                    button: '.places-slideshow .prev-slide'
                },
                next: {
                    key: 'right',
                    button: '.places-slideshow .next-slide'
                },


                onCreate: function() {
                    var firstRound = $(this).find('.slide:eq(0) .slide-text');

                    firstRound.fadeIn('fast');

                    setTimeout(function() {
                        firstRound.fadeOut('slow');
                    }, 3350);
                }
            });
        }
    });

}(jQuery, window, document));
        &lt;/script&gt;
</code></pre>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/javascript-dhtml-ajax/117">JavaScript / DHTML / AJAX</category>
			<dc:creator>turpentyne</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455472/script-change-to-run-at-later-moment</guid>
		</item>
				<item>
			<title>when i m select value from select tag then automatically display the text</title>
			<link>http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455467/when-i-m-select-value-from-select-tag-then-automatically-display-the-text</link>
			<pubDate>Tue, 28 May 2013 12:36:27 +0000</pubDate>
			<description>hello...help me rapidly.. query is that.. when we select the mail from the select tag and then automatically display the two text box like user name and contact no.. how i do this...? but remeber it that without use button....i hope as soon as i vl get my perfect ans...</description>
			<content:encoded><![CDATA[ <p>hello...help me rapidly..<br />
query is that.. when we select the mail from the select tag and then automatically display the two text box like user name and contact no.. how i do this...? but remeber it that without use button....i hope as soon as i vl get my perfect ans...</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/javascript-dhtml-ajax/117">JavaScript / DHTML / AJAX</category>
			<dc:creator>seju</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455467/when-i-m-select-value-from-select-tag-then-automatically-display-the-text</guid>
		</item>
				<item>
			<title>Creating Array in JS</title>
			<link>http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455448/creating-array-in-js</link>
			<pubDate>Tue, 28 May 2013 07:18:21 +0000</pubDate>
			<description>Hi. I'm using JS for d3. What I intend to do is get some data from database and plot them in a diagram I've created. Here's what I've done so far: Fetched the data from database: &lt;?php while($row = mysql_fetch_assoc($query)){ $q_id[] = $row['q_id']; $res_val[] = $row['response_value']; $chpt[] = $row['cr_chpt']; $lvl[] ...</description>
			<content:encoded><![CDATA[ <p>Hi. I'm using JS for d3. What I intend to do is get some data from database and plot them in a diagram I've created. Here's what I've done so far:</p>

<p>Fetched the data from database:</p>

<pre><code class="language-js">    &lt;?php 
        while($row = mysql_fetch_assoc($query)){
        $q_id[] = $row['q_id'];
        $res_val[] = $row['response_value'];
        $chpt[] = $row['cr_chpt'];
        $lvl[] = $row['ql_level'];
        }   
    ?&gt;
</code></pre>

<p>Sent it to JS:</p>

<pre><code class="language-js">        var id = &lt;?php echo json_encode($q_id); ?&gt;;
        var val = &lt;?php echo json_encode($res_val); ?&gt;;
        var chpt = &lt;?php echo json_encode($chpt); ?&gt;;
        var lvl = &lt;?php echo json_encode($lvl); ?&gt;;
</code></pre>

<p>I'm having trouble creating an array for the data though. For static data I've made it something like this:</p>

<pre><code class="language-js">        var dataLevel = [
        [280, "ANALYZE", 260, 560],
        [230, "APPLY", 260, 510],
        [180, "UNDERSTAND", 260, 460],
        [130, "REMEMBER", 260, 410]
                        ];
</code></pre>

<p>I'll use the array I want to create to plot.</p>

<p>Any help would be appreciated. Thanks.</p>

<p>Atikah</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/javascript-dhtml-ajax/117">JavaScript / DHTML / AJAX</category>
			<dc:creator>atikah8890</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455448/creating-array-in-js</guid>
		</item>
				<item>
			<title>Random Image Generator [Randomize instead of Order]</title>
			<link>http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455429/random-image-generator-randomize-instead-of-order</link>
			<pubDate>Tue, 28 May 2013 00:52:50 +0000</pubDate>
			<description>I have this code here and I need to know how to make it randomize the amoutn of images there are: Currently it shows the images, and uses a cookie so the image doesnt show up more than it needs to, but i need to randomize the image order instead ...</description>
			<content:encoded><![CDATA[ <p>I have this code here and I need to know how to make it randomize the amoutn of images there are:<br />
Currently it shows the images, and uses a cookie so the image doesnt show up more than it needs to, but i need to randomize the image order instead of it show up by order.</p>

<pre><code class="language-js">            function showImage() {
                //get image object
                var myImg = document.getElementById('showImage');

                //declare image directory path and image array
                var thePath = "images/";
                var theImages = new Array();
                theImages[0] = "01.png";
                theImages[1] = "02.png";
                theImages[2] = "03.png";
                theImages[3] = "04.png";
                theImages[4] = "05.png";
                theImages[5] = "06.png";
                theImages[6] = "07.png";
                theImages[7] = "08.png";
                theImages[8] = "09.png";
                theImages[9] = "10.png";
                theImages[10] = "11.png";
                theImages[11] = "12.png";
                theImages[12] = "13.png";
                theImages[13] = "14.png";
                theImages[14] = "15.png";
                theImages[15] = "16.png";
                theImages[16] = "17.png";
                theImages[17] = "18.png";
                theImages[18] = "19.png";
                theImages[19] = "20.png";
                theImages[20] = "21.png";
                theImages[21] = "22.png";
                theImages[22] = "23.png";
                theImages[23] = "24.png";
                theImages[24] = "25.png";
                theImages[25] = "26.png";
                theImages[26] = "27.png";
                theImages[27] = "28.png";
                theImages[28] = "29.png";
                theImages[29] = "30.png";
                theImages[30] = "31.png";
                theImages[31] = "32.png";
                theImages[32] = "33.png";

                //get current cookie value
                var currentIndex = parseInt(getCookie());
                var imgPath = thePath + theImages[currentIndex];
                myImg.src = imgPath;
                myImg.alt = theImages[currentIndex];
                myImg.title = theImages[currentIndex];

                //set next cookie index
                currentIndex += 1;
                if(currentIndex &gt; (theImages.length - 1)) {
                    currentIndex = 0;
                }
                setCookie(currentIndex);
            }

            function setCookie(someint) {
                var now = new Date();
                var addDays = now.getDate() + 7
                now.setDate(addDays); // cookie expires in 7 days
                var theString = 'imgID=' + escape(someint) + ';expires=' + now.toUTCString();
                document.cookie = theString;
            }

            function getCookie() {
                var output = "0";
                if(document.cookie.length &gt; 0) {
                    var temp = unescape(document.cookie);
                    temp = temp.split(';');
                    for(var i = 0; i &lt; temp.length; i++) {
                        if(temp[i].indexOf('imgID') != -1) {
                            temp = temp[i].split('=');
                            output = temp.pop();
                            break;
                        }
                    }
                }
                return output;
            }
</code></pre>

<p>I use this to show the image:</p>

<pre><code class="language-js">&lt;img id="showImage" style="margin: auto;margin-top: -234px;width: 100%;" width="100%" height="216px" /&gt;
&lt;script language="JavaScript"&gt;
jQuery(document).ready(function(){ showImage(); })
&lt;/script&gt;
</code></pre>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/javascript-dhtml-ajax/117">JavaScript / DHTML / AJAX</category>
			<dc:creator>Cravver</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455429/random-image-generator-randomize-instead-of-order</guid>
		</item>
				<item>
			<title>compare array elements and return couunt</title>
			<link>http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455428/compare-array-elements-and-return-couunt</link>
			<pubDate>Tue, 28 May 2013 00:37:54 +0000</pubDate>
			<description>I have 2 arrays that I need to compare against each other and retun the count of the same: ex: array1[abcd] array2 [adce] return would be 2 as both a and c are in same postion. I would then have to return 2,1 as a and c are in the ...</description>
			<content:encoded><![CDATA[ <p>I have 2 arrays that I need to compare against each other and retun the count of the same:</p>

<p>ex: array1[abcd]  array2 [adce] return would be 2 as both a and c are in same postion.</p>

<p>I would then have to return 2,1 as a and c are in the same place but d is in the array but in the wrong place.</p>

<pre><code class="language-js">     var  index = 0;

     for(index = 0; index &lt; length; index++){
     if(array1[index] == array2[index]){
     count++
    } 

return count
}
</code></pre>

<p>which i ofcourse is only returning 1, so not sure where to go from here?</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/javascript-dhtml-ajax/117">JavaScript / DHTML / AJAX</category>
			<dc:creator>jenny1975</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455428/compare-array-elements-and-return-couunt</guid>
		</item>
				<item>
			<title>slideshow dies when loaded.</title>
			<link>http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455420/slideshow-dies-when-loaded</link>
			<pubDate>Mon, 27 May 2013 20:10:39 +0000</pubDate>
			<description>A problem's come back to haunt me, after reworking the page for other features. I have a page with a caroufredsel script in it to show a rotating slideshow. The page works fine on it's own. But I need it to work when loaded into an existing page. I get ...</description>
			<content:encoded><![CDATA[ <p>A problem's come back to haunt me, after reworking the page for other features.</p>

<p>I have a page with a caroufredsel script in it to show a rotating slideshow. The page works fine on it's own. But I need it to work when loaded into an existing page. I get no errors when I look at console, while loading this page.</p>

<p>It's easier to just show a link to the site, I believe.</p>

<p>At this url, click on the first link in the navigation, you'll see that the slideshow isn't showing when loaded.</p>

<p><a href="http://www.thewalshgroup.ca/dev/mazenga/site2/" rel="nofollow">http://www.thewalshgroup.ca/dev/mazenga/site2/</a></p>

<p>But go to the page itself, and the slideshow works fine.</p>

<p><a href="http://www.thewalshgroup.ca/dev/maze...e2/mazenga.php" rel="nofollow">http://www.thewalshgroup.ca/dev/maze...e2/mazenga.php</a></p>

<p>Last time, the problem was solved by changing from window.onload() to  $(document).ready(function()</p>

<p>But this doesn't seem to solve anything this time</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/javascript-dhtml-ajax/117">JavaScript / DHTML / AJAX</category>
			<dc:creator>turpentyne</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455420/slideshow-dies-when-loaded</guid>
		</item>
				<item>
			<title>[AJAX] process not working!</title>
			<link>http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455413/ajax-process-not-working</link>
			<pubDate>Mon, 27 May 2013 18:49:57 +0000</pubDate>
			<description>hey, fellas.. I was gonna make a simple website.. Which somehow explains you about the readystate exchange,. But i am not getting the desired ouput. Please help me out.. I am ginna upload the codes, of the javascript and the html file.. the javascript file {a.js}: http://codeviewer.org/view/code:33b6 _______________________________________________________________ the html ...</description>
			<content:encoded><![CDATA[ <p>hey, fellas.. I was gonna make a simple website.. Which somehow explains you about the readystate exchange,. But i am not getting the desired ouput. Please help me out.. I am ginna upload the codes, of the javascript and the html file..</p>

<p>the javascript file {a.js}: <a href="http://codeviewer.org/view/code:33b6" rel="nofollow">http://codeviewer.org/view/code:33b6</a></p>

<p>_______________________________________________________________</p>

<p>the html file: <a href="http://codeviewer.org/view/code:33b7" rel="nofollow">http://codeviewer.org/view/code:33b7</a></p>

<p>__________________________________<br />
 PLEASE HELP ME OUT.. THANKS!</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/javascript-dhtml-ajax/117">JavaScript / DHTML / AJAX</category>
			<dc:creator>tanmay.majumdar2</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455413/ajax-process-not-working</guid>
		</item>
				<item>
			<title>can&#039;t load page - div disappears</title>
			<link>http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455399/cant-load-page-div-disappears</link>
			<pubDate>Mon, 27 May 2013 15:23:02 +0000</pubDate>
			<description>I'm trying to work in a script to fade out a div, load content and fade the div back in. But when the navigation links are clicked, the div fades out, then is completely removed from the DOM?? Here's the html: &lt;head&gt; &lt;link rel=&quot;stylesheet&quot; href=&quot;css/styles_default.css&quot; type=&quot;text/css&quot; media=&quot;screen&quot;/&gt; &lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; ...</description>
			<content:encoded><![CDATA[ <p>I'm trying to work in a script to fade out a div, load content and fade the div back in. But when the navigation links are clicked, the div fades out, then is completely removed from the DOM??</p>

<p>Here's the html:</p>

<pre><code class="language-js">&lt;head&gt;


    &lt;link rel="stylesheet" href="css/styles_default.css" type="text/css" media="screen"/&gt;
    &lt;link rel="stylesheet" type="text/css" href="css/MyFontsWebfontsKit.css"&gt;


    &lt;script type="text/javascript" language="javascript" src="js/jquery-2.0.0.js"&gt;&lt;/script&gt;


    &lt;!--[if IE]&gt;
      &lt;script src="<a href="http://html5shiv.googlecode.com/svn/trunk/html5.js" rel="nofollow">http://html5shiv.googlecode.com/svn/trunk/html5.js</a>"&gt;&lt;/script&gt;
    &lt;![endif]--&gt;

    &lt;script type='text/javascript' src='js/modernizr.js'&gt;&lt;/script&gt;
    &lt;script type='text/javascript' src='js/dynamicpage.js'&gt;&lt;/script&gt;

&lt;/head&gt;



&lt;body&gt;
&lt;!-- the beginning background, logo and "menu" link: this disappears to reveal full site //////////////////////////////////////// --&gt;

     &lt;div id="full-size-background"&gt;
        &lt;div id="starting_point"&gt;
            &lt;img id="start_logo" src="images/logo.png"&gt;
            &lt;a href="#" id="starting_point_link"&gt;MENU&lt;/a&gt;
            &lt;div id="rotated_text"&gt;adsfasdfasdf&lt;/div&gt;
        &lt;/div&gt;
     &lt;/div&gt;

     &lt;!-- MAIN SITE content below //////////////////////////////////////////////////////////////////////////////////////////////////// --&gt;

 &lt;?php include 'inc/header5.php'; ?&gt;


    &lt;div id="page-wrap"&gt;

        &lt;section id="main-content"&gt;
        &lt;div id="main_center_box"&gt;
        &lt;!-- here's where content should load, but the main_center_box div completely disappears --&gt;

        &lt;?php include 'inc/include_at_start.php'; ?&gt;

                &lt;?php include 'inc/footer.php'; ?&gt;
        &lt;/div&gt;
        &lt;/section&gt;

    &lt;/div&gt;

        &lt;a id="walsh_link" href="<a href="http://www.thewalshgroup.ca/" rel="nofollow">http://www.thewalshgroup.ca/</a>" target="_blank"&gt;POWERED BY THE WALSH GROUP &lt;/a&gt;

        &lt;script type="text/javascript" language="javascript" src="js/functions4.js"&gt;&lt;/script&gt;

&lt;/body&gt;

&lt;/html&gt;
</code></pre>

<p>the dynamic page script: for this:</p>

<pre><code class="language-js">$(function() {

    if(Modernizr.history){

    var newHash      = "",
        $mainContent = $("#main-content"),
        $pageWrap    = $("#page-wrap"),
        baseHeight   = 0,
        $el;

    $pageWrap.height($pageWrap.height());
    baseHeight = $pageWrap.height() - $mainContent.height();

    $("nav").delegate("a", "click", function() {
        _link = $(this).attr("href");
        history.pushState(null, null, _link);
        loadContent(_link);
        return false;
    });

    function loadContent(href){
        $mainContent
                .find("#main_center_box")
                .fadeOut(600, function() {
                    $mainContent.hide().load(href + " #main_center_box", function() {
                        $mainContent.fadeIn(500, function() {

                            $pageWrap.animate({
                                height: baseHeight + $mainContent.height() + "px"
                            });
                        });
                        $("nav a").removeClass("current");
                        console.log(href);
                        $("nav a[href$="+href+"]").addClass("current");
                    });
                });
    }

    $(window).bind('popstate', function(){
       _link = location.pathname.replace(/^.*[\\\/]/, ''); //get filename only
       loadContent(_link);
    });

} // otherwise, history is not supported, so nothing fancy here.


});
</code></pre>

<p>and the functions.js, if it's relevant to the problem:</p>

<pre><code class="language-js">$(document).ready(function() {





// code for random backgorund image on page load
$("#full-size-background").css("background-image", "url(images/backgrounds/" + Math.floor(Math.random()*3) + ".jpg)");



// starting point fade when "menu" clicked

    $("#starting_point_link").on("click", function(){

            $('#starting_point, .places-slideshow,#full-size-background').stop().animate({ opacity: 0 }, 1400, function() {
                $('#starting_point').css({display:"none"});
                $('#main_center_box').css({zIndex:"1"});
                $('.header_content, #main_center_box').css({display:"block"}).stop().animate({ opacity: 1 }, 800, function() { 

                    //  $(' #main_center_box').load('include_at_start.php');

                    $('#main_center_box2').stop().animate({ opacity: 1 }, 700, function() { /* animation complete */ });
                    $('.places-slideshow').stop().animate({ opacity: 1 }, 2100, function() { /* animation complete */ });

                }); 

                $("#starting_point_link").attr('class','visited');
                $("#full-size-background,.header_content").css('opacity','0').css("background-image", "url(images/BG1a.jpg)");
                $('#full-size-background').stop().animate({ opacity: 1 }, 700, function() { /* animation complete */ });
                $('.header_content').stop().animate({ opacity: 1 }, 800, function() { /* animation complete */ });
            });
    });





// function for navigation clicks





    // researching deeplinking solutions


// end resesarching deeplinking solutions







$('.slider .slide:eq(0)').addClass('active').fadeIn(200);

$('.slider-nav li a').click(function() {    
    var index = $(this).parent().index('li');

    $('.slider .slide.active').removeClass('active').fadeOut(200, function() { 
            $('.slider .slide:eq(' + index + ')').addClass('active').fadeIn(200);
        });

    return false;
});

$('.slide').click(function() {
    if($(this).hasClass('active')){
        $(this).removeClass('active').fadeOut(200, function() {
            if($(this).is(':last-child')){
                $('.slider .slide:first-child').addClass('active').fadeIn(200);
            }else{
                $(this).next().addClass('active').fadeIn(200);
            }
        });
    } 
}); 





// 'scroll to' code

$('.portfolio_links').live('click', function(){ 
    var whichTag = $(this).attr('id');
    val = whichTag.split("_");
    thisTag = "#position_"+val[1];

    $('html, body').animate({scrollTop: $(thisTag).offset().top - 100}, 2000);

});






}); // document ready ending brackets



// the form label controls

(function($) {
    function toggleLabel() {
        var input = $(this);
        setTimeout(function() {
            var def = input.attr('title');
            if (!input.val() || (input.val() == def)) {
                input.prev('span').css('visibility', '');
                if (def) {
                    var dummy = $('&lt;label&gt;&lt;/label&gt;').text(def).css('visibility','hidden').appendTo('body');
                    input.prev('span').css('margin-left', dummy.width() + 3 + 'px');
                    dummy.remove();
                }
            } else {
                input.prev('span').css('visibility', 'hidden');
            }
        }, 0);
    };

    function resetField() {
        var def = $(this).attr('title');
        if (!$(this).val() || ($(this).val() == def)) {
            $(this).val(def);
            $(this).prev('span').css('visibility', '');
        }
    };

    $('input, textarea').live('keydown', toggleLabel);
    $('input, textarea').live('paste', toggleLabel);
    $('select').live('change', toggleLabel);

    $('input, textarea').live('focusin', function() {
        $(this).prev('span').css('color', '#000');
    });
    $('input, textarea').live('focusout', function() {
        $(this).prev('span').css('color', '#fff');
    });

    $(function() {
        $('input, textarea').each(function() { toggleLabel.call(this); });
    });

})(jQuery);
</code></pre>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/javascript-dhtml-ajax/117">JavaScript / DHTML / AJAX</category>
			<dc:creator>turpentyne</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455399/cant-load-page-div-disappears</guid>
		</item>
				<item>
			<title>Javascript Prototype??</title>
			<link>http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455397/javascript-prototype</link>
			<pubDate>Mon, 27 May 2013 14:19:25 +0000</pubDate>
			<description>Here's my code (It doesn't work): var c=document.getElementById(&quot;myCanvas&quot;); var ctx=c.getContext(&quot;2d&quot;); function Shape(){}; Shape.prototype.Circle = function(){ // Some code here }; Shape.prototype.Square = function(){ // Some code here }; MainMenu.prototype = new Shape(); var MainMenu = function(ctx){ this.draw{ this.Circle(); this.Square(); } } What I want to do is to call the ...</description>
			<content:encoded><![CDATA[ <p>Here's my code (It doesn't work):</p>

<pre><code class="language-js">var c=document.getElementById("myCanvas");
var ctx=c.getContext("2d");


function Shape(){};

Shape.prototype.Circle = function(){
    // Some code here
};

Shape.prototype.Square = function(){
    // Some code here
};


MainMenu.prototype = new Shape();

var MainMenu = function(ctx){
   this.draw{
    this.Circle();
    this.Square();
   }
}
</code></pre>

<p>What I want to do is to call the Circle() and Square() function inside my draw() function.<br />
Is this even possible??<br />
I'm going crazy trying to figure this out!!</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/javascript-dhtml-ajax/117">JavaScript / DHTML / AJAX</category>
			<dc:creator>hiyatran</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455397/javascript-prototype</guid>
		</item>
				<item>
			<title>Image rotation</title>
			<link>http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455366/image-rotation</link>
			<pubDate>Mon, 27 May 2013 03:57:22 +0000</pubDate>
			<description>I attempted to implement image rotation using google jquery library. The problem is that the image rotation stops at 5.jpg and doesn't go back to 1.jpg to 2.jpg.........and so on. Did I miss out something? &lt;html&gt; &lt;head&gt; &lt;title&gt;&lt;/title&gt; &lt;script type=&quot;text/javascript&quot; src=&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js?ver=3.0.1&quot;&gt; &lt;/script&gt; &lt;script type=&quot;text/javascript&quot; src=&quot;js/img-rotator.js&quot;&gt; &lt;/script&gt; &lt;link rel=&quot;stylesheet&quot; href=&quot;css/style.css&quot; type=&quot;text/css&quot; ...</description>
			<content:encoded><![CDATA[ <p>I attempted to implement image rotation using google jquery library. The problem is that the image</p>

<p>rotation stops at 5.jpg and doesn't go back to 1.jpg to 2.jpg.........and so on. Did I miss out</p>

<p>something?</p>

<pre><code class="language-js">&lt;html&gt;
&lt;head&gt;
&lt;title&gt;&lt;/title&gt;
&lt;script type="text/javascript" src="<a href="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js?ver=3.0.1" rel="nofollow">http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js?ver=3.0.1</a>"&gt;
&lt;/script&gt;
&lt;script type="text/javascript" src="js/img-rotator.js"&gt;
&lt;/script&gt;
&lt;link rel="stylesheet" href="css/style.css" type="text/css" media="screen" /&gt;
&lt;/head&gt;
&lt;body&gt;
     &lt;div id="rotating-img-container"&gt;
           &lt;img class="rotating-img-item" src="images/1.jpg" /&gt;
           &lt;img class="rotating-img-item" src="images/2.jpg" /&gt;
           &lt;img class="rotating-img-item" src="images/3.jpg" /&gt;
           &lt;img class="rotating-img-item" src="images/4.jpg" /&gt; 
           &lt;img class="rotating-img-item" src="images/5.jpg" /&gt; 
     &lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;



$(window).load(function(){

    var rotator = {

        init: function(){

                    var imgCount = $('.rotating-img-item').length;

                    var currentImg = 0;

                    $('.rotating-img-item').eq(currentImg).fadeIn(1000);

                    var loop = setInterval(function(){

                $('.rotating-img-item').eq(currentImg).fadeIn(1000);

                if(currentImg == imgCount - 1){
                                currentImg = 0;  
                }else{
                                currentImg++;
                        }

                        $('.rotating-img-item').eq(currentImg).fadeIn(1000);    

                },5000); 
        }
    };

        rotator.init();
});




#rotating-img-container {
    position: relative;
    width: 980px;
    height: 347px;
}
.rotating-img-item {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
}
</code></pre>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/javascript-dhtml-ajax/117">JavaScript / DHTML / AJAX</category>
			<dc:creator>solomon_13000</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455366/image-rotation</guid>
		</item>
				<item>
			<title>JavaScrip cookies conflict with PHP cookies</title>
			<link>http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455361/javascrip-cookies-conflict-with-php-cookies</link>
			<pubDate>Mon, 27 May 2013 01:30:30 +0000</pubDate>
			<description>I have set up a cookie in JavaScript to store the change to the stylesheet. The cookie is loaded using &lt;body onload=&quot;set_style_from_cookie()&quot;&gt; This cookie was working fine until I set a session cookie in PHP to verity if a user was logged in session_start(); if(isset($_SESSION['username'])) { $user = $_SESSION['username']; } ...</description>
			<content:encoded><![CDATA[ <p>I have set up a cookie in JavaScript to store the change to the stylesheet.</p>

<p>The cookie is loaded using</p>

<pre><code class="language-js">&lt;body onload="set_style_from_cookie()"&gt;
</code></pre>

<p>This cookie was working fine until I set a session cookie in PHP to verity if a user was logged in</p>

<pre><code class="language-js">session_start();
if(isset($_SESSION['username']))
    {
    $user = $_SESSION['username'];
    }
</code></pre>

<p>This php code is placed at the top of the page. This has created a conflict with the JavaScript cookie. Is there anyway to get both cookies working together.</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/javascript-dhtml-ajax/117">JavaScript / DHTML / AJAX</category>
			<dc:creator>MattD00</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455361/javascrip-cookies-conflict-with-php-cookies</guid>
		</item>
				<item>
			<title>InvalidStateError: DOM IDBDatabase Exception 11</title>
			<link>http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455360/invalidstateerror-dom-idbdatabase-exception-11</link>
			<pubDate>Mon, 27 May 2013 01:19:04 +0000</pubDate>
			<description>can someone please tell me where im going wrong here? window.indexedDB = window.indexedDB || window.webkitIndexedDB || window.mozIndexedDB; if ('webkitIndexedDB' in window) { window.IDBTransaction = window.webkitIDBTransaction; window.IDBKeyRange = window.webkitIDBKeyRange; } var VULY_DB = {}; VULY_DB = {}; VULY_DB.db = null; VULY_DB.onerror = function(e) { console.log(e); }; VULY_DB.open = function() { var ...</description>
			<content:encoded><![CDATA[ <p>can someone please tell me where im going wrong here?</p>

<pre><code class="language-js">window.indexedDB = window.indexedDB || window.webkitIndexedDB ||
window.mozIndexedDB;

if ('webkitIndexedDB' in window) {
    window.IDBTransaction = window.webkitIDBTransaction;
    window.IDBKeyRange = window.webkitIDBKeyRange;
}

var VULY_DB = {};
VULY_DB = {};
VULY_DB.db = null;

VULY_DB.onerror = function(e) {
    console.log(e);
};

VULY_DB.open = function() {
    var request = indexedDB.open(salt);


    request.onerror = request.onsuccess = function(e) { VULY_DB.onerror(request.error); };
    request.onsuccess = function(e) {
        VULY_DB.db = e.target.result;
        var db = VULY_DB.db;

        var store = db.createObjectStore("revisions", {keyPath: "id"});
    };
};

VULY_DB.open();
</code></pre>

<p>Thank you!</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/javascript-dhtml-ajax/117">JavaScript / DHTML / AJAX</category>
			<dc:creator>marases</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455360/invalidstateerror-dom-idbdatabase-exception-11</guid>
		</item>
				<item>
			<title>[AJAX] Website not Working [Newbie]</title>
			<link>http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455353/ajax-website-not-working-newbie</link>
			<pubDate>Sun, 26 May 2013 20:41:04 +0000</pubDate>
			<description>Hey, fellas. I have just started LEARNING AJAX. I am having prblems in the first website only. So this website is like a restaurant menu, which tells you the avaible food. With respect to the user's query. But its not displaying the end result. As i think, it is not ...</description>
			<content:encoded><![CDATA[ <p>Hey, fellas. I have just started LEARNING AJAX. I am having prblems in the first website only. So this website is like a restaurant menu, which tells you the avaible food. With respect to the user's query.</p>

<p>But its not displaying the end result. As i think, it is not reaching till the lastfile.</p>

<p>I am uploading the codes for all the php, javascript, and html files.</p>

<p>THE HTML FILE (NOTHING SPECIAL :P) [FOODSTORE.HTML]:</p>

<pre><code class="language-js">&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
    &lt;script type="text/javascript" src="foodstore.js"&gt; &lt;/script&gt;
&lt;/head&gt;
    &lt;body&gt;
        &lt;input type="text" id="userInput" onkeyup="process()" /&gt;
        &lt;div id="underInput" /&gt;
    &lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>_____________________________________________________________________________<br />
THE JAVASCRIPT FILE: [foodstore.js]:</p>

<pre><code class="language-js">var xmlHttp = createXmlHttpRequestObject();

function createXmlHttpRequestObject() {

    var xmlHttp;

    if (window.ActiveXObject){
        try{
            xmlHttp = new ActiveXObject("Microsofot.XMLHTTP");
        } catch (e) {
            xmlHttp = false;
        }
    }else{
        try{
            xmlHttp = new XMLHttpRequest();
        } catch (e) {
            xmlHttp = false;
        }
    }

    if (!xmlHttp) {
        alert("Could not create XML Object");
    } else {
        return xmlHttp;
    }
}




function process() {


        food = encodeURIComponent(document.getElementById("userInput").value);
        //alert(food);
        xmlHttp.open("GET", "foodstore.php?food="+food, true);
        xmlHttp.onreadystatechange = handleServerResponse;
        xmlHttp.send();

}

function handleServerResponse () {

    if ( xmlHttp.readyState==4 )
        if ( xmlHttp.status==200) {
        xmlResponse = xmlHttp.responseXML;
        xmlDocumentElement = xmlResponse.documentElement;
        message = xmlDocumentElement.firstChild.textContent;
        document.getElementById("underInput").innerHTML = '&lt;span style="color:blue"&gt;' + message + '&lt;/span&gt;';
    }
}
</code></pre>

<p>__________________________________________________________</p>

<p>the php file: [foodstore.php]</p>

<pre><code class="language-js">&lt;?php
    header('Content-Type: text/xml');
    echo '&lt;?xml version="1.0" encoding="UTF-8" standalone="yes" ?&gt;';

    echo '&lt;response&gt;';
        $food=$_GET['food'];
        $foodArray = array('tuna','bacon','beef','loaf','ham');

        if (in_array($food,$foodArray)) {
            echo "We do have ".$food;
        } elseif ($food==''){
            echo "Enter food";
        } else {
            echo    "Sorry, we do not have ".$food;
        }

    echo '&lt;/response&gt;';
?&gt;
</code></pre>

<p>_______________________________________</p>

<p>Also, for clarification:</p>

<p>For the server factor, earlier I was using xampp. { ACTUALLY, I AM QUITE FAMILIAR WITH JAVASCRIPT AND PHP, but ajax is a very new topic for me}. Obviuosly it didnt work. So for experiment's sake , I registered on serverfree.com. But still no new development!</p>

<p>in case you WANT TO visit the file: =&gt; <a href="http://tattikhale.bugs3.com/foodstore.html" rel="nofollow">http://tattikhale.bugs3.com/foodstore.html</a></p>

<p>ALSO IF YOU ARE ABLE TO SOLVE THE ABOVE PROBLEM: PLEASE UPLOAD IT AND DO GIVE ME THE LINK.</p>

<p>THANKS IN ADVANCE....</p>

<p>P.S: PLEASE HELP THE NOOB. HE IS REALLY STUCK.. :(</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/javascript-dhtml-ajax/117">JavaScript / DHTML / AJAX</category>
			<dc:creator>tanmay.majumdar2</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455353/ajax-website-not-working-newbie</guid>
		</item>
				<item>
			<title>Jquery.jqplot - How to use?</title>
			<link>http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455331/jquery.jqplot-how-to-use</link>
			<pubDate>Sun, 26 May 2013 14:38:09 +0000</pubDate>
			<description>Hello everyone.. I'm trying to work out how to install and use Jquery.jqplot in google chrome. I have no idea how to go about this.. I have downloaded jquery.jqplot but not sure what to do next. Does anyone know how to install this, or include this? Does it go in ...</description>
			<content:encoded><![CDATA[ <p>Hello everyone..</p>

<p>I'm trying to work out how to install and use Jquery.jqplot in google chrome.<br />
I have no idea how to go about this.. I have downloaded jquery.jqplot but not sure what to do next.</p>

<p>Does anyone know how to install this, or include this?  Does it go in my google chrome directory?</p>

<p>Little bit confused.</p>

<p>Thanks you :)</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/javascript-dhtml-ajax/117">JavaScript / DHTML / AJAX</category>
			<dc:creator>furalise</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455331/jquery.jqplot-how-to-use</guid>
		</item>
				<item>
			<title>Printing from a JSON string</title>
			<link>http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455301/printing-from-a-json-string</link>
			<pubDate>Sat, 25 May 2013 18:23:28 +0000</pubDate>
			<description>I am having problems accessing what for me is a complex JSON object. I successfully interrogated the Open Weather API and received a good response. What I am not accessing, and don’t know how to, is the individual items of the weather portion of the list group while in a ...</description>
			<content:encoded><![CDATA[ <p>I am having problems accessing what for me is a complex JSON object.<br />
I successfully interrogated the Open Weather API and received a good response.<br />
What I am not accessing, and don’t know how to, is the individual items of the weather portion of  the list group while in a for loop.<br />
When printed the values are undefined.<br />
Thanks for any help!<br />
The Response from the open weather API</p>

<pre><code class="language-js">{
   "timestamp":1369498755320,
   "data":{
      "cod":"200",
      "message":0.0372,
      "city":{
         "id":5037649,
         "name":"Minneapolis",
         "coord":{
            "lon":-93.26384,
            "lat":44.979969
         },
         "country":"US",
         "population":382578
      },
      "cnt":10,
      "list":[
         {
            "dt":1369504800,
            "temp":{
               "day":291.59,
               "min":285.95,
               "max":291.59,
               "night":285.95,
               "eve":289.25,
               "morn":288.86
            },
            "pressure":1004.12,
            "humidity":62,
            "weather":[
               {
                  "id":800,
                  "main":"Clear",
                  "description":"sky is clear",
                  "icon":"01d"
               }
            ],
            "speed":7.27,
            "deg":154,
            "clouds":32
         },
         {
            "dt":1369591200,
            "temp":{
               "day":286.26,
               "min":285.08,
               "max":287.6,
               "night":285.8,
               "eve":286.83,
               "morn":285.08
            },
            "pressure":1001.63,
            "humidity":71,
            "weather":[
               {
                  "id":501,
                  "main":"Rain",
                  "description":"moderate rain",
                  "icon":"10d"
               }
            ],
            "speed":8.11,
            "deg":131,
            "clouds":92,
            "rain":3.5
         },
         ....
      ]
   }
}

In trying to print to the browser I use the following to access the weather section but this does not wok and gives me a value of undefined.


//Turn JSON string into a javaScript object
 weatherOutPut = JSON.parse(weather);

 $('#baker').append('weather.id = ' + weatherOutPut.data.list[i].weather.id + '&lt;br /&gt;');
 $('#baker').append('weather.main = ' + weatherOutPut.data.list[i].weather.main + '&lt;br /&gt;');
 $('#baker').append('weather.description = ' + weatherOutPut.data.list[i].weather.description + '&lt;br /&gt;');
 $('#baker').append('weather.icon = ' + weatherOutPut.data.list[i].weather.icon + '&lt;br /&gt;'); 

 //This returns undefined.
</code></pre>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/javascript-dhtml-ajax/117">JavaScript / DHTML / AJAX</category>
			<dc:creator>rouse</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455301/printing-from-a-json-string</guid>
		</item>
				<item>
			<title>How can i auto click on a link after x amount of time?</title>
			<link>http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455276/how-can-i-auto-click-on-a-link-after-x-amount-of-time</link>
			<pubDate>Sat, 25 May 2013 03:30:21 +0000</pubDate>
			<description>Hello, I want to click the skip ad buttom when the buttom appears, can someone please explain me how this can be done using jquery? Here is the Code &lt;!DOCTYPE html&gt; &lt;html&gt; &lt;body style=&quot;margin:0px;padding:0px;&quot;&gt; &lt;iframe src=&quot;http://bc.vc/7VsNj6&quot; style=&quot;width:100%; height:100%; border:none;&quot; id=&quot;frame&quot;&gt; &lt;p&gt;Your browser does not support iframes.&lt;/p&gt; &lt;/iframe&gt; &lt;/body&gt; &lt;/html&gt; Thanks ...</description>
			<content:encoded><![CDATA[ <p>Hello,</p>

<p>I want to click the skip ad buttom when the buttom appears, can someone please explain me how this can be done using jquery?</p>

<p>Here is the Code</p>

<pre><code class="language-js">&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;body style="margin:0px;padding:0px;"&gt;

&lt;iframe src="<a href="http://bc.vc/7VsNj6" rel="nofollow">http://bc.vc/7VsNj6</a>" style="width:100%; height:100%; border:none;" id="frame"&gt;
  &lt;p&gt;Your browser does not support iframes.&lt;/p&gt;
&lt;/iframe&gt;

&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>Thanks in advance.</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/javascript-dhtml-ajax/117">JavaScript / DHTML / AJAX</category>
			<dc:creator>spyece</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455276/how-can-i-auto-click-on-a-link-after-x-amount-of-time</guid>
		</item>
				<item>
			<title>reloading previous page with popstate</title>
			<link>http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455268/reloading-previous-page-with-popstate</link>
			<pubDate>Fri, 24 May 2013 18:14:49 +0000</pubDate>
			<description>I've gotten this far on setting up popstate() - a totally new thing for me. I have loaded content for each click of the navigation, and pushstate() changes the url. But it doesn't load anything when the back button is pressed. Only when I've pressed the back button enough, that ...</description>
			<content:encoded><![CDATA[ <p>I've gotten this far on setting up popstate() - a totally new thing for me. I have loaded content for each click of the navigation, and pushstate() changes the url.</p>

<p>But it doesn't load anything when the back button is pressed. Only when I've pressed the back button enough, that the url shows the index page again, then it reloads the page.</p>

<p>Here's what I have so far:</p>

<pre><code class="language-js">$("#top_nav li a, #footer_info").on("click", function(e){

                // prevent the a href from doing what it naturally does.
                e.preventDefault();

                // highlight active nav link &amp; turn off others              
                $('.current').attr('class','link1');


                href = $(this).attr("href");

                // page chosen...
                var loadpage = 'inc/'+$(this).attr('name')+'.php';
                var footer = 'inc/footer.php';

                // fade out the main box                
                if(loadpage == "inc/index.php"){

                    $('#main_center_box,.header_content').css({opacity:1}).stop().animate({ opacity: 0 }, 700, function() { /* animation complete */ });
                    $('#starting_point, .places-slideshow,#full-size-background').css({display:"block"}).stop().animate({ opacity: 1 }, 1400, function() { /* animation complete */ });
                    $('#main_center_box').css({zIndex:"-1"});
                    $("#starting_point_link").attr('class','');

                } else {
                    $('#main_center_box,#footer_links').stop().animate({ opacity: 0, zIndex:0 }, 700, function() { 
                        $(this).attr('class','current');

                        // now load the page that matches navigation selected, and fade back in.
                        $('#main_center_box').css({zIndex:1 }).load(loadpage).stop().animate({ opacity: 1}, 700, function() { /* animation complete */ });

                        window.history.pushState('', 'New URL: '+href, href);

                    });
                }
    });




    // researching deeplinking solutions

    function change(state) {
    if(state === null) {
        $("#main_center_box").load('inc/mazenga.php');
    } else {

        $("#main_center_box").load(state.url);
    }
}

$(window).bind("popstate", function(e) {
    change(e.originalEvent.state);
});



(function(original) {
    history.pushState = function(state) {
        change(state);
        return original.apply(this, arguments);
    };
})(history.pushState);
</code></pre>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/javascript-dhtml-ajax/117">JavaScript / DHTML / AJAX</category>
			<dc:creator>turpentyne</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455268/reloading-previous-page-with-popstate</guid>
		</item>
				<item>
			<title>how to incorporate &quot;pushstate()&quot;</title>
			<link>http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455258/how-to-incorporate-pushstate</link>
			<pubDate>Fri, 24 May 2013 15:27:53 +0000</pubDate>
			<description>Hi... I have a simple function for loading php pages into the index.php file. I'm wanting to incorporate pushstate() so I can start making the page crawlable. But not sure how. Here's my starting point (which just gives me &quot;http://www.site.com/undefined&quot; // function for navigation clicks $(&quot;#top_nav li a, #footer_info&quot;).on(&quot;click&quot;, function(e){ ...</description>
			<content:encoded><![CDATA[ <p>Hi...</p>

<p>I have a simple function for loading php pages into the index.php file. I'm wanting to incorporate pushstate() so I can start making the page crawlable. But not sure how.</p>

<p>Here's my starting point (which just gives me "<a href="http://www.site.com/undefined" rel="nofollow">http://www.site.com/undefined</a>"</p>

<pre><code class="language-js">// function for navigation clicks

    $("#top_nav li a, #footer_info").on("click", function(e){

                // prevent the a href from doing what it naturally does.
                e.preventDefault();

                // highlight active nav link &amp; turn off others              
                $('.current').attr('class','link1');



                // which page chosen?
                var loadpage = 'inc/'+$(this).attr('name')+'.php';
                var footer = 'inc/footer.php';



                    $('#main_center_box,#footer_links').stop().animate({ opacity: 0, zIndex:0 }, 700, function() { 
                        $(this).attr('class','current');

                        // now load the page that matches navigation selected
                        $('#main_center_box').css({zIndex:1 }).load(loadpage).stop().animate({ opacity: 1}, 700, function() { /* animation complete */ });
                        $('html,body').scrollTop(0);

                        // not sure how to do this part...
                        href = $(this).attr(loadpage);
                        history.pushState('', 'New URL: '+href, href);
                    });

    });
</code></pre>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/javascript-dhtml-ajax/117">JavaScript / DHTML / AJAX</category>
			<dc:creator>turpentyne</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455258/how-to-incorporate-pushstate</guid>
		</item>
				<item>
			<title>simplify script</title>
			<link>http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455252/simplify-script</link>
			<pubDate>Fri, 24 May 2013 14:17:08 +0000</pubDate>
			<description>For the sake of learning, I'm just curious how I can simplify these functions? Open to any suggestions... Please forgive all the over-commenting. $(document).ready(function() { // code for random backgorund image on page load $(&quot;#full-size-background&quot;).css(&quot;background-image&quot;, &quot;url(images/backgrounds/&quot; + Math.floor(Math.random()*3) + &quot;.jpg)&quot;); // starting point fade when &quot;menu&quot; clicked $(&quot;#starting_point_link&quot;).on(&quot;click&quot;, function(){ $('#starting_point, ...</description>
			<content:encoded><![CDATA[ <p>For the sake of learning, I'm just curious how I can simplify these functions? Open to any suggestions...<br />
Please forgive all the over-commenting.</p>

<pre><code class="language-js">$(document).ready(function() {

// code for random backgorund image on page load
$("#full-size-background").css("background-image", "url(images/backgrounds/" + Math.floor(Math.random()*3) + ".jpg)");



// starting point fade when "menu" clicked

    $("#starting_point_link").on("click", function(){

            $('#starting_point, .places-slideshow,#full-size-background').stop().animate({ opacity: 0 }, 1400, function() {
                $('#starting_point').css({display:"none"});
                $('#main_center_box').css({zIndex:"1"});
                $('.header_content, #main_center_box').css({display:"block"}).stop().animate({ opacity: 1 }, 800, function() { 

                    //  $(' #main_center_box').load('mazenga.php');

                    $('#main_center_box2').stop().animate({ opacity: 1 }, 700, function() { /* animation complete */ });
                    $('.places-slideshow').stop().animate({ opacity: 1 }, 2100, function() { /* animation complete */ });

                }); 

                $("#starting_point_link").attr('class','visited');
                $("#full-size-background,.header_content").css('opacity','0').css("background-image", "url(images/BG1a.jpg)");
                $('#full-size-background').stop().animate({ opacity: 1 }, 700, function() { /* animation complete */ });
                $('.header_content').stop().animate({ opacity: 1 }, 800, function() { /* animation complete */ });
            });
    });



// function for navigation clicks

    $("#top_nav li a, #footer_info").on("click", function(e){

                // prevent the a href from doing what it naturally does.
                e.preventDefault();

                // highlight active nav link &amp; turn off others              
                $('.current').attr('class','link1');



                // set the hashtag in url
                window.location.hash = $(this).attr('name');

                // which page chosen?
                var loadpage = 'inc/'+$(this).attr('name')+'.php';
                var footer = 'inc/footer.php';

                // fade out the main box    


                if(loadpage == "inc/index.php"){

                    $('#main_center_box,.header_content').css({opacity:1}).stop().animate({ opacity: 0 }, 700, function() { /* animation complete */ });
                    $('#starting_point, .places-slideshow,#full-size-background').css({display:"block"}).stop().animate({ opacity: 1 }, 1400, function() { /* animation complete */ });
                    $('#main_center_box').css({zIndex:"-1"});
                    $("#starting_point_link").attr('class','');

                } else {
                    $('#main_center_box,#footer_links').stop().animate({ opacity: 0, zIndex:0 }, 700, function() { 
                        $(this).attr('class','current');
                        // now load the page that matches navigation selected
                        $('#main_center_box').css({zIndex:1 }).load(loadpage).stop().animate({ opacity: 1}, 700, function() { /* animation complete */ });
                        $('html,body').scrollTop(0);
                    });
                }
    });




$('.slider .slide:eq(0)').addClass('active').fadeIn(200);

$('.slider-nav li a').click(function() {    
    var index = $(this).parent().index('li');

    $('.slider .slide.active').removeClass('active').fadeOut(200, function() { 
            $('.slider .slide:eq(' + index + ')').addClass('active').fadeIn(200);
        });

    return false;
});

$('.slide').click(function() {
    if($(this).hasClass('active')){
        $(this).removeClass('active').fadeOut(200, function() {
            if($(this).is(':last-child')){
                $('.slider .slide:first-child').addClass('active').fadeIn(200);
            }else{
                $(this).next().addClass('active').fadeIn(200);
            }
        });
    } 
}); 





// 'scroll to' code

$('.portfolio_links').live('click', function(){ 
    var whichTag = $(this).attr('id');
    val = whichTag.split("_");
    thisTag = "#position_"+val[1];

    $('html, body').animate({scrollTop: $(thisTag).offset().top - 100}, 2000);

});

}); // document ready ending brackets



// the form label controls

(function($) {
    function toggleLabel() {
        var input = $(this);
        setTimeout(function() {
            var def = input.attr('title');
            if (!input.val() || (input.val() == def)) {
                input.prev('span').css('visibility', '');
                if (def) {
                    var dummy = $('&lt;label&gt;&lt;/label&gt;').text(def).css('visibility','hidden').appendTo('body');
                    input.prev('span').css('margin-left', dummy.width() + 3 + 'px');
                    dummy.remove();
                }
            } else {
                input.prev('span').css('visibility', 'hidden');
            }
        }, 0);
    };

    function resetField() {
        var def = $(this).attr('title');
        if (!$(this).val() || ($(this).val() == def)) {
            $(this).val(def);
            $(this).prev('span').css('visibility', '');
        }
    };

    $('input, textarea').live('keydown', toggleLabel);
    $('input, textarea').live('paste', toggleLabel);
    $('select').live('change', toggleLabel);

    $('input, textarea').live('focusin', function() {
        $(this).prev('span').css('color', '#000');
    });
    $('input, textarea').live('focusout', function() {
        $(this).prev('span').css('color', '#fff');
    });

    $(function() {
        $('input, textarea').each(function() { toggleLabel.call(this); });
    });

})(jQuery);
</code></pre>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/javascript-dhtml-ajax/117">JavaScript / DHTML / AJAX</category>
			<dc:creator>turpentyne</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455252/simplify-script</guid>
		</item>
				<item>
			<title>Cannot understand object</title>
			<link>http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455223/cannot-understand-object</link>
			<pubDate>Fri, 24 May 2013 07:57:05 +0000</pubDate>
			<description>Hi all, I have taken from net drop down menu script my web page is medistyle.az. It works perfectly but when i look up code i cannot understand one thing there below is code (js. file) var menu=function(){ var t=15,z=50,s=6,a; function dd(n){this.n=n; this.h=[]; this.c=[]} dd.prototype.init=function(p,c){ a=c; var w=document.getElementById(p), s=w.getElementsByTagName('ul'), l=s.length, ...</description>
			<content:encoded><![CDATA[ <p>Hi all,<br />
I have taken from net drop down menu script<br />
my web page is medistyle.az. It works perfectly<br />
but when i look up code i cannot understand one thing there<br />
below is code (js. file)</p>

<pre><code class="language-js">var menu=function(){
    var t=15,z=50,s=6,a;
    function dd(n){this.n=n; this.h=[]; this.c=[]}
    dd.prototype.init=function(p,c){
        a=c; var w=document.getElementById(p), s=w.getElementsByTagName('ul'), l=s.length, i=0;
        for(i;i&lt;l;i++){
            var h=s[i].parentNode; this.h[i]=h; this.c[i]=s[i];
            h.onmouseover=new Function(this.n+'.st('+i+',true)');
            h.onmouseout=new Function(this.n+'.st('+i+')');
        }
    }
    dd.prototype.st=function(x,f){
        var c=this.c[x], h=this.h[x], p=h.getElementsByTagName('a')[0];
        clearInterval(c.t); c.style.overflow='hidden';
        if(f){
            p.className+=' '+a;
            if(!c.mh){c.style.display='block'; c.style.height=''; c.mh=c.offsetHeight; c.style.height=0}
            if(c.mh==c.offsetHeight){c.style.overflow='visible'}
            else{c.style.zIndex=z; z++; c.t=setInterval(function(){sl(c,1)},t)}
        }else{p.className=p.className.replace(a,''); c.t=setInterval(function(){sl(c,-1)},t)}
    }
    function sl(c,f){
        var h=c.offsetHeight;
        if((h&lt;=0&amp;&amp;f!=1)||(h&gt;=c.mh&amp;&amp;f==1)){
            if(f==1){c.style.filter=''; c.style.opacity=1; c.style.overflow='visible'}
            clearInterval(c.t); return
        }
        var d=(f==1)?Math.ceil((c.mh-h)/s):Math.ceil(h/s), o=h/c.mh;
        c.style.opacity=o; c.style.filter='alpha(opacity='+(o*100)+')';
        c.style.height=h+(d*f)+'px'
    }
    return{dd:dd}
}();
</code></pre>

<p>Here i dont understand what does <strong>return{dd:dd}</strong> mean. I understand dd is name of function(class) but i couldnt understand what does syntax mean (return{dd:dd})<br />
Thanks in advance for attention !!!</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/javascript-dhtml-ajax/117">JavaScript / DHTML / AJAX</category>
			<dc:creator>azegurb</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455223/cannot-understand-object</guid>
		</item>
				<item>
			<title>VBscript to find duplicates within an array and increment it by 1</title>
			<link>http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455216/vbscript-to-find-duplicates-within-an-array-and-increment-it-by-1</link>
			<pubDate>Fri, 24 May 2013 03:54:43 +0000</pubDate>
			<description>Hi, I have a scenario where in I had to sort an array, find duplicates and increment one or the other by 1. So, Eg: An array has 22, 23, 21, 21, 24 within it then, an array should be able to find 21 and increment it by 1 i.e. ...</description>
			<content:encoded><![CDATA[ <p>Hi,</p>

<p>I have a scenario where in I had to sort an array, find duplicates and increment one or the other by 1.<br />
So, Eg: An array has 22, 23, 21, 21, 24 within it then, an array should be able to find 21 and increment it by 1 i.e. 22. Also, on the other hand, it should now go scanning from the start and find 22 already present and increment that by 1. So, far had managed to sort an array which is just a part of the entire project.<br />
Anyone too good in VBscript, please?</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/javascript-dhtml-ajax/117">JavaScript / DHTML / AJAX</category>
			<dc:creator>mith_cool</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455216/vbscript-to-find-duplicates-within-an-array-and-increment-it-by-1</guid>
		</item>
				<item>
			<title>toggle buton problem</title>
			<link>http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455210/toggle-buton-problem</link>
			<pubDate>Fri, 24 May 2013 00:25:47 +0000</pubDate>
			<description> html &lt;div class=&quot;example2&quot;&gt; &lt;p&gt;This is some text This is some textThis is some textThis is some textThis is some text This is some textThis is some textThis is some textThis is some textThis is some text&lt;/p&gt; &lt;/div&gt; Css .button{ -moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px; -moz-box-shadow:0 1px 1px rgba(0, 0, 0, 0.2);-webkit-box-shadow:0 1px 1px rgba(0, ...</description>
			<content:encoded><![CDATA[ <pre><code class="language-js">html


&lt;div class="example2"&gt;
    &lt;p&gt;This is some text This is some textThis is some textThis is some textThis is some text
    This is some textThis is some textThis is some textThis is some textThis is some text&lt;/p&gt;
&lt;/div&gt;


Css


.button{
    -moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;
    -moz-box-shadow:0 1px 1px rgba(0, 0, 0, 0.2);-webkit-box-shadow:0 1px  1px rgba(0, 0, 0, 0.2);box-shadow:0 1px 1px rgba(0, 0, 0, 0.2);
    background:#eee;
    border:0;
    color:#333;
    cursor:pointer;
    font-family:"Lucida Grande",Helvetica,Arial,Sans-Serif;
    margin:0;padding:6px 4px;
    text-decoration:none;
    position:relative
}
.example1 p, .example2 p{
    border:1px solid #eee;background:#eee;
    -moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;
    width:400px;
    padding:10px;
    margin:10px 0
}




Javascript code


$(document).ready(function() {
    $('.example2').hide().before('&lt;a href="#" id="toggle-example2" class="button"&gt;Open/Close&lt;/a&gt;');
    $('a#toggle-example2').click(function() {
        $('.example2').slideToggle(1000);
        return false;
    });
});
</code></pre>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/javascript-dhtml-ajax/117">JavaScript / DHTML / AJAX</category>
			<dc:creator>andi.andiiimintoyouu</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455210/toggle-buton-problem</guid>
		</item>
				<item>
			<title>uncaught TypeError: Cannot read property &#039;0&#039; of null HELP</title>
			<link>http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455186/uncaught-typeerror-cannot-read-property-0-of-null-help</link>
			<pubDate>Thu, 23 May 2013 17:02:26 +0000</pubDate>
			<description>Hi anyone can help, am having this error on line 10: uncaught TypeError: Cannot read property '0' of null. I have use the same code other places, same array but never got this error. I dont know why am having this error here. this.addEventListener(&quot;message&quot;,function(e){ importScripts('test.js'); var object=e.data; object=JSON.parse(object); mArray=object.array; var ...</description>
			<content:encoded><![CDATA[ <p>Hi anyone can help, am having this error on line 10: uncaught TypeError: Cannot read property '0' of null.<br />
I have use the same code other places, same array but never got this error. I dont know why am having this error here.</p>

<pre><code class="language-js">this.addEventListener("message",function(e){
    importScripts('test.js');
    var object=e.data;
    object=JSON.parse(object);

    mArray=object.array;
    var test=new test();
    for (var y=0;y&lt;8;y++){
        for (var x=0;x&lt;4;x++){
            word="" + mArray[y][x]+ mArray[y][x+1] + mArray[y][x+2] + mArray[y][x+3] + mArray[y][x+4];
            var object={test:word}
            this.postMessage(JSON.stringify(object));
        }
    }
</code></pre>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/javascript-dhtml-ajax/117">JavaScript / DHTML / AJAX</category>
			<dc:creator>techyworld</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455186/uncaught-typeerror-cannot-read-property-0-of-null-help</guid>
		</item>
				<item>
			<title>My date picker</title>
			<link>http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455183/my-date-picker</link>
			<pubDate>Thu, 23 May 2013 15:40:54 +0000</pubDate>
			<description>Hello, Whilst writing this I actually fixed the issue but I thought I'd post anyway as this technique might be useful to others... I have a javascript class I wrote (alas I can't post the whole code as the IP technically belongs to the company I work for) which presents ...</description>
			<content:encoded><![CDATA[ <p>Hello,</p>

<p>Whilst writing this I actually fixed the issue but I thought I'd post anyway as this technique might be useful to others...</p>

<p>I have a javascript class I wrote (alas I can't post the whole code as the IP technically belongs to the company I work for) which presents 3 drop down boxes, 1 for day, 1 for month and 1 for year. If you select an invalid date (eg 30th feb), it automatically updates itself to a near correct date (eg 28th feb) the class handles leap years.</p>

<p>This sadly doesn't work in chrome and I'd appreciate if anyone is interested could offer some small amount of guidance to get me going in the right direction....</p>

<p>You add your date picker to your form like this:</p>

<pre><code class="language-js">        &lt;script type="text/javascript"&gt; 
            var processDateVbl = new dateDropper('processDate', "&lt;?php echo $currentDate; ?&gt;");
        &lt;/script&gt;
</code></pre>

<p>The class definition itself is pretty weird and works perfectly on IE.</p>

<p>Its constructor sets a few variables like how many days there are in each month and the min and max years to be added to the year select box etc and does some validation on the date string passed to it (in the php echo). Importantly, the constructor uses the first parameter (processDate) and suffixes it with Vbl and stores it as a parameter so that it can call itself later on...</p>

<p>It then calls a method called drawFields()</p>

<p>drawFields uses document.write to output form elements to the page;</p>

<pre><code class="language-js">    document.write ("&lt;input type=\"hidden\" name=\"" + this.formId + "\" value=\"" + this.defaultDate + "\"&gt;");
</code></pre>

<p>This line in particular creates a hidden form element with the name from the first parameter used to call dateDropper, so, when the form is submitted, the next page's php can use $_POST['processDate'] to reference the whole date and not access all 3 fields separately.</p>

<p>Next is where the class can 'call itself' for want of a better expression...</p>

<pre><code class="language-js">    document.write ("&lt;select name=\"" + this.formId + "Day\" onchange=\" " + this.variableName + ".dayChange() \"&gt;");
</code></pre>

<p>this.formId is processDate and this.variableName is processDateVbl.</p>

<p>So when the object is instantiated it creates select boxes whose onchange command is to refer back to the object's dayChange method. This works fine.</p>

<p>however, the first thing that the dayChange (also monthChange and yearChange) does when you change the select box value is to getElementById("processDateDay").options to find what you have changed it to.</p>

<p>This is where things go wrong. This works fine in internet explorer (7 and 8) but does not work in chrome or firefox. The javascript console there essentially tells me that getElementById("processDateDay") is null.</p>

<p>At this point I realised I was searching by element ID and had defined element names... What a twit.</p>

<p>I updated my drawFields() method to output like so:</p>

<pre><code class="language-js">        document.write ("&lt;select id=\"" + this.formId + "Day\" onchange=\" " + this.variableName + ".dayChange() \"&gt;");
</code></pre>

<p>now it all works!</p>

<p>I'm unsure where else anyone might want to do this, it's a pretty unusual concept so far as I know.</p>

<p>Hope this is of assistance!</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/javascript-dhtml-ajax/117">JavaScript / DHTML / AJAX</category>
			<dc:creator>BenWard</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455183/my-date-picker</guid>
		</item>
				<item>
			<title>working slideshow killed when loaded</title>
			<link>http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455179/working-slideshow-killed-when-loaded</link>
			<pubDate>Thu, 23 May 2013 14:25:33 +0000</pubDate>
			<description>I have a carousel that works fine on it's own, but something's killing it when I load its page into my main page. Not sure what would cause it? i'm using &quot;Caroufredsel&quot;. Here's the main page, with script to load page based on which navigation selected. If the user selects ...</description>
			<content:encoded><![CDATA[ <p>I have a carousel that works fine on it's own, but something's killing it when I load its page into my main page. Not sure what would cause it? i'm using "Caroufredsel".</p>

<p>Here's the main page, with script to load page based on which navigation selected. If the user selects "portfolio" it should load a page that includes my slider. Below this is the loaded page.</p>

<pre><code class="language-js">&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;


    &lt;link rel="stylesheet" href="css/styles_default.css" type="text/css" media="screen"/&gt;

    &lt;script type="text/javascript" language="javascript" src="js/jquery-2.0.0.js"&gt;&lt;/script&gt;

&lt;/head&gt;

&lt;body&gt;

    &lt;!-- the beginning background, logo and "menu" link: this disappears to reveal full site //////////////////////////////////////// --&gt;

     &lt;div id="full-size-background"&gt;
        &lt;div id="starting_point"&gt;
            &lt;img id="start_logo" src="images/logo.png"&gt;
            &lt;a href="#" id="starting_point_link"&gt;MENU&lt;/a&gt;
            &lt;div id="rotated_text"&gt;Title&lt;/div&gt;
        &lt;/div&gt;
     &lt;/div&gt;

     &lt;!-- NAV  below //////////////////////////////////////////////////////////////////////////////////////////////////// --&gt;

    &lt;div class="header_content" style="opacity:0;display:none;"&gt;
        &lt;br/&gt;


        &lt;ul id="top_nav"&gt;
            &lt;li class="nav_item logo_li"&gt;
                &lt;a id="home" class="logo" href="index.php" name="index"&gt;
                    &lt;img src="images/logo.png"&gt;
                &lt;/a&gt;
            &lt;/li&gt;

            &lt;li class="nav_item"&gt;
                 &lt;a  id="xx" class="link1" href="#" name="index" rel="address:/xx"&gt;xx&lt;/a&gt;
            &lt;/li&gt;            

            &lt;li class="nav_separator"&gt; / &lt;/li&gt;    

            &lt;li class="nav_item"&gt;
                &lt;a id="new_sites" class="link1" href="#" name="new_sites" rel="address:/new_sites"&gt;
                NOW RELEASING
                &lt;/a&gt;
            &lt;/li&gt;

            &lt;li class="nav_separator"&gt; / &lt;/li&gt;    

            &lt;li class="nav_item"&gt;
                &lt;a id="portfolio" class="link1" href="#"  name="portfolio" rel="address:/portfolio"&gt;
                PORTFOLIO
                &lt;/a&gt;
            &lt;/li&gt;

            &lt;li class="nav_separator"&gt; / &lt;/li&gt;    

            &lt;li class="nav_item"&gt;
                &lt;a id="strategy" class="link1" href="#" name="strategy" rel="address:/strategy"&gt;
                STRATEGY
                &lt;/a&gt;
            &lt;/li&gt;

            &lt;li class="nav_separator"&gt; / &lt;/li&gt;    

            &lt;li class="nav_item"&gt;
                &lt;a id="vip_first" class="link1" href="#" name="vip_first" rel="address:/vip_first"&gt;
                VIP FIRST
                &lt;/a&gt;
            &lt;/li&gt;

            &lt;li class="nav_separator"&gt; / &lt;/li&gt;    

            &lt;li class="nav_item"&gt;
                &lt;a id="contact" class="link1" href="#" name="contact" rel="address:/contact"&gt;
                CONTACT
                &lt;/a&gt;
            &lt;/li&gt;

            &lt;li class="nav_separator"&gt; // &lt;/li&gt;   

            &lt;li class="nav_item"&gt;
                &lt;a id="login" class="link1" href="#" name="login" rel="address:/login"&gt;
                LOGIN
                &lt;/a&gt;
            &lt;/li&gt;


    &lt;/ul&gt;


    &lt;/div&gt;

         &lt;!-- MAIN SITE content below //////////////////////////////////////////////////////////////////////////////////////////////////// --&gt; 



     &lt;div id="main_center_box" class=""&gt;

        &lt;!-- here's where the content loads in //////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////--&gt;


        &lt;?php include 'inc/footer.php'; ?&gt;
    &lt;/div&gt;

    &lt;a id="walsh_link" href="<a href="http://www.thewalshgroup.ca/" rel="nofollow">http://www.thewalshgroup.ca/</a>" target="_blank"&gt;POWERED BY THE WALSH GROUP &lt;/a&gt;


&lt;script&gt;

$(document).ready(function() {

    // the script that determines which page to load.  My problem page is "portfolio"


    $("#top_nav li a, #footer_info").on("click", function(e){

                // prevent the a href from doing what it naturally does.
                e.preventDefault();

                // highlight active nav link &amp; turn off others              
                $('.current').attr('class','link1');
                $(this).attr('class','current');

                // set the hashtag in url
                window.location.hash = $(this).attr('name');

                // which page chosen?
                var loadpage = 'inc/'+$(this).attr('name')+'.php';
                var footer = 'inc/footer.php';

                // fade out the main box            
                $('#main_center_box').stop().animate({ opacity: 0, zIndex:0 }, 700, function() { 
                    $('#main_center_box2').css({opacity:1}).stop().animate({ opacity: 0 }, 700, function() { /* animation complete */ });
                    // now load the page that matches navigation selected
                    $('#main_center_box').css({zIndex:1 }).load(loadpage).stop().animate({ opacity: 1}, 700, function() { /* animation complete */ });

                });

    });
});
&lt;/script&gt;

&lt;/body&gt;
&lt;/html&gt; 

&lt;!-- include jQuery + carouFredSel plugin --&gt;
&lt;script type="text/javascript" language="javascript" src="jquery-1.8.2.min.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript" language="javascript" src="jquery.carouFredSel-6.2.1-packed.js"&gt;&lt;/script&gt;

&lt;!-- optionally include helper plugins --&gt;
&lt;script type="text/javascript" language="javascript" src="helper-plugins/jquery.mousewheel.min.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript" language="javascript" src="helper-plugins/jquery.touchSwipe.min.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript" language="javascript" src="helper-plugins/jquery.transit.min.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript" language="javascript" src="helper-plugins/jquery.ba-throttle-debounce.min.js"&gt;&lt;/script&gt;

&lt;!-- fire plugin onDocumentReady --&gt;
        &lt;script type="text/javascript" language="javascript"&gt;
        (function($, window, document) {

    var $doc = $(document),
        $win = $(window);
        wWidth = $win.width();



    $win.on('load', function() {
        function move() {
            $paging.removeClass('selected');
            $current.addClass('selected');
            $carousel.stop().animate({left:-(index*(wWidth&lt;=1200?wWidth:1200))});
        }
        function reset() {
            if (timer!==false) {
                clearInterval(timer);
            }

            timer = setInterval(function(){
                index++;

                if (index&gt;=$img.length) {
                    index=0;
                }

                $current=$paging.eq(index);
                move();
            }, 8000);
        }


        if ( $('.slideshow').length ) {
            var h = 532;
            var $img = $('.slideshow .carousel img');
            var $paging = '';
            var $carousel = $('.slideshow .carousel div');

            if ( $('.residence-slideshow').length ) {
                h = 644;
            }


            $carousel.width(($img.length * 1200)+60);

            for (var i=0; i&lt;$img.length;i++) {
                var c = i===0?' class="selected" ':'';
                $paging += '&lt;a href="#" '+c+'&gt;&lt;/a&gt;';
            }

            $paging = $($paging);

            var index = 0;
            var $current = $paging.eq(index);
            var timer = false;

            $('.slideshow-paging').append($paging);


            $paging.on('click', function(e){
                e.preventDefault();
                index = $paging.index(this);
                $current=$(this);
                move();
                reset();
                return false;
            });

            $('.slideshow .arrows').on('click', function(){
                index = $(this).hasClass('arrows-left')?index-1:index+1;
                index = (index&lt;0)?$img.length-1:(index&gt;$img.length-1?0:index);
                $current=$paging.eq(index);
                move();
                reset();
            });


            $img.on('mouseover', function(){
                clearInterval(timer);
            })
            .on('mouseout', reset);


            reset();
        }

        if ( $('.places-slideshow').length ) {
            $('.places-slideshow .carousel').fadeIn().carouFredSel({
                align: 'left',
                responsive: true,
                items: {
                    visible: 1
                },
                scroll: {
                    items: 1,
                    fx: 'directscroll',
                    duration: 500,
                    timeoutDuration: 5000,
                    pauseOnHover: true,
                    onAfter: function( data ) {
                        data.items.visible.find('.slide-text').fadeIn('slow');

                        setTimeout(function() {
                            data.items.visible.find('.slide-text').fadeOut('slow');
                        }, 4500);
                    }
                },

                auto: {
                     timeoutDuration: 2000,
                     delay: 3500
                },


                prev: {
                    key: 'left',
                    button: '.places-slideshow .prev-slide'
                },
                next: {
                    key: 'right',
                    button: '.places-slideshow .next-slide'
                },
                onCreate: function() {
                    var firstRound = $(this).find('.slide:eq(0) .slide-text');

                    firstRound.fadeIn('fast');

                    setTimeout(function() {
                        firstRound.fadeOut('slow');
                    }, 3350);
                }
            });
        }
    });

}(jQuery, window, document));
        &lt;/script&gt;



&lt;div class="places-slideshow"&gt;


    &lt;div class="carousel"&gt;
        &lt;div class="slide"&gt;
            &lt;img src="images/slideshow/slide1.jpg" alt="" /&gt;

            &lt;div class="slide-text"&gt;
                &lt;h2&gt;&lt;a href="#" target="_blank"&gt;TOWNHOME DEVELOPMENT&lt;/a&gt;&lt;/h2&gt;
                &lt;p&gt;367 asdf Avenue&lt;/p&gt;
                &lt;p&gt;ASDFADFASFAADFSADF&lt;/p&gt;
            &lt;/div&gt;
        &lt;/div&gt;

        &lt;div class="slide"&gt;
            &lt;img src="images/slideshow/slide2.jpg" alt="" /&gt;

            &lt;div class="slide-text"&gt;
                &lt;h2&gt;&lt;a href="#" target="_blank"&gt;CUSTOM HOME&lt;/a&gt;&lt;/h2&gt;
                &lt;p&gt;365 asdf Avenue&lt;/p&gt;
                &lt;p&gt;ASDFASDFASF&lt;/p&gt;
            &lt;/div&gt;
        &lt;/div&gt;

        &lt;div class="slide"&gt;
            &lt;img src="images/slideshow/slide3.jpg" alt="" /&gt;

            &lt;div class="slide-text"&gt;
                &lt;h2&gt;&lt;a href="#" target="_blank"&gt;DETACHED HOME&lt;/a&gt;&lt;/h2&gt;
                &lt;p&gt;341 HILLDOWN Avenue&lt;/p&gt;
                &lt;p&gt;ASDFASDFAFs&lt;/p&gt;
            &lt;/div&gt;
        &lt;/div&gt;

        &lt;div class="slide"&gt;
            &lt;img src="images/slideshow/slide4.jpg" alt="" /&gt;

            &lt;div class="slide-text"&gt;
                &lt;h2&gt;&lt;a href="#" target="_blank"&gt;LOREM IPSUM&lt;/a&gt;&lt;/h2&gt;
                &lt;p&gt;361asfdasdf&lt;/p&gt;
                &lt;p&gt;asdfasdf&lt;/p&gt;
            &lt;/div&gt;
        &lt;/div&gt;
    &lt;/div&gt;

    &lt;span class="arrow-overlay"&gt;&lt;/span&gt;

    &lt;a href="#" class="prev-slide"&gt;prev&lt;/a&gt;
    &lt;a href="#" class="next-slide"&gt;next&lt;/a&gt;
&lt;/div&gt;
</code></pre>

<p>Here's the page that get's loaded in, including the slideshow. This page will work when I test it by itself. But</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/javascript-dhtml-ajax/117">JavaScript / DHTML / AJAX</category>
			<dc:creator>turpentyne</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455179/working-slideshow-killed-when-loaded</guid>
		</item>
				<item>
			<title>Smooth movement of non hidden div</title>
			<link>http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455168/smooth-movement-of-non-hidden-div</link>
			<pubDate>Thu, 23 May 2013 11:58:40 +0000</pubDate>
			<description>I have some div's one after another. When i click anywhere the first div hides and other div's shifts to fill the empty space. But the movement of other div which aren't hidden are not satisfying as it takes the place but not smoothly. I have no idea as how ...</description>
			<content:encoded><![CDATA[ <p>I have some div's one after another.<br />
When i click anywhere the first div hides and other div's shifts to fill the empty space.<br />
But the movement of other div which aren't hidden are not satisfying as it takes the place<br />
but not smoothly.<br />
I have no idea as how should i approach this problem</p>

<p>Here's a link of current scenario<br />
<a href="http://jsfiddle.net/code_rum/Xb4ZX/" rel="nofollow">http://jsfiddle.net/code_rum/Xb4ZX/</a></p>

<p>Thanks in advance</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/javascript-dhtml-ajax/117">JavaScript / DHTML / AJAX</category>
			<dc:creator>code_rum</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455168/smooth-movement-of-non-hidden-div</guid>
		</item>
				<item>
			<title>.js validation works for email but not submission to database.</title>
			<link>http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455124/.js-validation-works-for-email-but-not-submission-to-database</link>
			<pubDate>Wed, 22 May 2013 16:42:00 +0000</pubDate>
			<description>Hi: i have site contact form that validates required fields w/ .js And php. if browser has javascript turned on, the req'd info error message will show next to the field boxes .. if javascript is turned off, then user will see the same thing but coming from php instead... ...</description>
			<content:encoded><![CDATA[ <p>Hi:</p>

<p>i have site contact form that validates required fields w/ .js And php.<br />
if browser has javascript turned on, the req'd info error message will show next to the field boxes ..</p>

<p>if javascript is turned off, then<br />
user will see the same thing but coming from php instead...</p>

<p>the submit goes to database and personal email.<br />
email received shows complete field boxes info.. as expected..</p>

<p>the database will show incomplete submissions that the .js was sposed to stop..<br />
example:: like name is filled but missing email and such..</p>

<p>how can this be so?...<br />
must be something simple//</p>

<p>i didnt try to disable the .js validation to see what happens..<br />
i would rather fix it and keep it</p>

<p>here is code if someone can look at it..<br />
<a href="http://jsbin.com/ixupuk/1/edit" rel="nofollow">http://jsbin.com/ixupuk/1/edit</a></p>

<p>thanx</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/javascript-dhtml-ajax/117">JavaScript / DHTML / AJAX</category>
			<dc:creator>amkaos</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455124/.js-validation-works-for-email-but-not-submission-to-database</guid>
		</item>
				<item>
			<title>OnPropertyChange</title>
			<link>http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455123/onpropertychange</link>
			<pubDate>Wed, 22 May 2013 16:36:37 +0000</pubDate>
			<description>For a script that needs to be run on multiple pages with different coding etiquettes, I need to be able to figure out when there is some dynamic change occuring in the DOM. MutationObservers cater for Chrome and Firefox but I'm having problems with IE so onpropertychange event is something ...</description>
			<content:encoded><![CDATA[ <p>For a script that needs to be run on multiple pages with different coding etiquettes, I need to be able to figure out when there is some dynamic change occuring in the DOM. MutationObservers cater for Chrome and Firefox but I'm having problems with IE so onpropertychange event is something I've chosen to use as it appears to be the only thing that MAY give the behaviour I want.</p>

<pre><code class="language-js">document.attachEvent("onpropertychange", doThis);
</code></pre>

<p>The above is the function which fires the doThis method whenever something occurs. But some of the pages my script needs to run on have unlimited scrolls (similar to what Facebook, LinkedIn have) and rescanning the entire page each time the event fires in order to detect that element where a property was changed is very resource intensive.</p>

<p>If only there was some way to get the particular element that caused the propertychange I would be so happy..</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/javascript-dhtml-ajax/117">JavaScript / DHTML / AJAX</category>
			<dc:creator>asif49</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455123/onpropertychange</guid>
		</item>
				<item>
			<title>Progress Bar using JavaScript</title>
			<link>http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455122/progress-bar-using-javascript</link>
			<pubDate>Wed, 22 May 2013 16:29:42 +0000</pubDate>
			<description>Can anyone pls help me with how to create a Progress Bar by using JavaScript methods like setInterval() ?</description>
			<content:encoded><![CDATA[ <p>Can anyone pls help me with how to create a Progress Bar by using JavaScript methods like setInterval() ?</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/javascript-dhtml-ajax/117">JavaScript / DHTML / AJAX</category>
			<dc:creator>Bibek_NS</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455122/progress-bar-using-javascript</guid>
		</item>
				<item>
			<title>Ignoring event fires</title>
			<link>http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455048/ignoring-event-fires</link>
			<pubDate>Tue, 21 May 2013 14:20:05 +0000</pubDate>
			<description>Hi I have an event listener attached to something which will fire a lot based on some user action that has occured on the page or some javscript change. Unfortunately it will be something like 5 or 6 fires in the space of 250ms and I am only interested in ...</description>
			<content:encoded><![CDATA[ <p>Hi</p>

<p>I have an event listener attached to something which will fire a lot based on some user action that has occured on the page or some javscript change. Unfortunately it will be something like 5 or 6 fires in the space of 250ms and I am only interested in the last fire so I can carry out the resource intensive processing. I'd like to ignore all of the fires before that.</p>

<p>Any way this can be achieved keeping in mind we don't know how many times it will fire.</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/javascript-dhtml-ajax/117">JavaScript / DHTML / AJAX</category>
			<dc:creator>asif49</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455048/ignoring-event-fires</guid>
		</item>
				<item>
			<title>&#039;Live&#039; updates of div without hammering server</title>
			<link>http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455043/live-updates-of-div-without-hammering-server</link>
			<pubDate>Tue, 21 May 2013 12:18:08 +0000</pubDate>
			<description>We recently had our account suspended (without warning - thanks 1&amp;1) due to exceeding server load. The reason this happened was there were quite a few divs that were refreshing (via Ajax) every 9 seconds to give a 'live update' on the site (it is a sports site so this ...</description>
			<content:encoded><![CDATA[ <p>We recently had our account suspended (without warning - thanks 1&amp;1) due to exceeding server load.</p>

<p>The reason this happened was there were quite a few divs that were refreshing (via Ajax) every 9 seconds to give a 'live update' on the site (it is a sports site so this was to give live score updates etc).</p>

<p>Now I am looking for an alternative way of getting the same functionality without putting strain on the server and, ideally, not register a page hit on each refresh and hopefully someone can give me advice on the best way to go.</p>

<p>Currently, each of these divs call a seperate page which pulls data from a MySQL database. I have read that there are ways to check that file and only refresh the div if it has changed. Ideally, however, I would like to pull the data directly into the div, without using the middle page, and get that to update if the data in the database has changed.</p>

<p>Having said that, I am open to any suggestions or pointers that will give me the same live updates without running the risk of the host pulling the plug again!</p>

<p>Thanks<br />
Steve</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/javascript-dhtml-ajax/117">JavaScript / DHTML / AJAX</category>
			<dc:creator>MargateSteve</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455043/live-updates-of-div-without-hammering-server</guid>
		</item>
				<item>
			<title>Global variables in Javascript class with functions?</title>
			<link>http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455041/global-variables-in-javascript-class-with-functions</link>
			<pubDate>Tue, 21 May 2013 11:17:31 +0000</pubDate>
			<description>Hello I have this similar code: var SomeVar = Class.create({ one: null, two: null, three: null, initialize: function(one, two) { this.one = one; this.two = two; }, startListeners: function() { $j('#somediv1').mousedown(function(e) { this.three=3; three=&quot;hi&quot; }.bind(this)); $j('#somediv2').mousedown(function(e) { console.log(this.three); console.log(three); }.bind(this)); }, }); As you see there are more can one ...</description>
			<content:encoded><![CDATA[ <p>Hello</p>

<p>I have this similar code:</p>

<pre><code class="language-js">var SomeVar = Class.create({
    one: null,
    two: null,
    three: null,

initialize: function(one, two) {
        this.one = one;
        this.two = two;

    },

startListeners: function() {


        $j('#somediv1').mousedown(function(e) {


        this.three=3;
        three="hi"



        }.bind(this));


    $j('#somediv2').mousedown(function(e) {


        console.log(this.three);
        console.log(three);



        }.bind(this));
    },

});
</code></pre>

<p>As you see there are more can one variable called "three". What is the best way to have one common variable named three where I can modifiy it freely and it does not get deleted/destroyed everytime I do a mousedown on divone then on divtwo it comes out null.</p>

<p>It may be related but what the hell is "}.bind(this));"?</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/javascript-dhtml-ajax/117">JavaScript / DHTML / AJAX</category>
			<dc:creator>riahc3</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455041/global-variables-in-javascript-class-with-functions</guid>
		</item>
				<item>
			<title>1 JS to run across several unknown pages</title>
			<link>http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455035/1-js-to-run-across-several-unknown-pages</link>
			<pubDate>Tue, 21 May 2013 08:52:13 +0000</pubDate>
			<description>I have script which will run across multiple pages I don't know about. Say I want to replace some text within it. I attempt to do it by looping through every element on the page and checking if it matches the regex before replacing it but keep getting this... SCRIPT5007: ...</description>
			<content:encoded><![CDATA[ <p>I have script which will run across multiple pages I don't know about. Say I want to replace some text within it. I attempt to do it by looping through every element on the page and checking if it matches the regex before replacing it but keep getting this...</p>

<p>SCRIPT5007: Unable to get value of the property 'go': object is null or undefined<br />
rs=AItRSTO5xlMcJYBeFTggpnLiO7-4oJljag, line 1533 character 260<br />
SCRIPT5007: Unable to get value of the property 'go': object is null or undefined<br />
rs=AItRSTO5xlMcJYBeFTggpnLiO7-4oJljag, line 1533 character 260</p>

<p>Or on some pages instead of 'go' it lists another property. Anyone know what this could mean?</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/javascript-dhtml-ajax/117">JavaScript / DHTML / AJAX</category>
			<dc:creator>asif49</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455035/1-js-to-run-across-several-unknown-pages</guid>
		</item>
				<item>
			<title>Animation Issues</title>
			<link>http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455011/animation-issues</link>
			<pubDate>Tue, 21 May 2013 00:28:00 +0000</pubDate>
			<description>I am having trouble animating a div on the same page as the div that is not animating. Here is my code: Page 2 &lt;?php mysql_connect('127.0.0.1', 'root', ''); mysql_select_db('table'); $query = mysql_query(&quot;SELECT * FROM `blog`&quot;); ?&gt; &lt;script&gt; $('.post').click(function() { var value = $(this).attr('rel'); $('.load_post').html('Loading...').load('load_post.php?value='+value); $('.load_post').animate({&quot;left&quot;: &quot;-=1500px&quot;}, &quot;slow&quot;); $(&quot;.posts&quot;).animate({&quot;left&quot;: &quot;-=1500px&quot;}, &quot;slow&quot;); ...</description>
			<content:encoded><![CDATA[ <p>I am having trouble animating a div on the same page as the div that is not animating. Here is my code:</p>

<p>Page 2</p>

<pre><code class="language-js">&lt;?php

mysql_connect('127.0.0.1', 'root', '');
mysql_select_db('table');

$query = mysql_query("SELECT * FROM `blog`");

?&gt;

&lt;script&gt;
$('.post').click(function() {       
    var value = $(this).attr('rel');

    $('.load_post').html('Loading...').load('load_post.php?value='+value);
    $('.load_post').animate({"left": "-=1500px"}, "slow");
    $(".posts").animate({"left": "-=1500px"}, "slow");
    $(".blog_posts").animate({"left": "-=1500px"}, "slow");

});
&lt;/script&gt;

&lt;?php
while ($rows = mysql_fetch_array($query)){

$id = $rows['id'];
$date = str_replace("-", "/", $rows['date']);
$title = stripslashes($rows['title']);

?&gt;
&lt;a href="#" class="post" rel="&lt;?php echo $id; ?&gt;"&gt; &lt;h2 style="padding:0px; margin:0px;"&gt;&lt;?php echo $title; ?&gt;&lt;/h2&gt;&lt;/a&gt;
&lt;h6 style="padding:0px; margin:0px;"&gt;&lt;?php echo $date; ?&gt;&lt;/h6&gt;
&lt;?php
}
?&gt;
</code></pre>

<p>Page 1</p>

<pre><code class="language-js">&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "<a href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" rel="nofollow">http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd</a>"&gt;
&lt;html xmlns="<a href="http://www.w3.org/1999/xhtml" rel="nofollow">http://www.w3.org/1999/xhtml</a>"&gt;
&lt;?php
    include 'body/head.php';
?&gt;

&lt;body&gt;
    &lt;?php
        include 'body/nav.php';
    ?&gt;

    &lt;script&gt;
        $(document).ready(function() {
            $('.blog_posts').load('blog_feed.php');
        });
    &lt;/script&gt;

    &lt;div style="position:absolute; top:90px; left:1px; width:550px; background-color:lightblue;"&gt;

        &lt;h1&gt;Blog Posts&lt;/h1&gt;

        &lt;div class="blog_posts"&gt;

        &lt;/div&gt;

        &lt;div class="load_post" style="position:absolute; top:250px; left:1500px; width:550px; background-color:lightblue;"&gt;

        &lt;/div&gt;
    &lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>I do not have anymore ideas of why this could be happening. Can anyone figure out this issue? Thanks for helping.</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/javascript-dhtml-ajax/117">JavaScript / DHTML / AJAX</category>
			<dc:creator>Djmann1013</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/455011/animation-issues</guid>
		</item>
				<item>
			<title>One of those stupid questions: What is &quot;+=&quot; and &quot;-=&quot;?</title>
			<link>http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/454973/one-of-those-stupid-questions-what-is-and-</link>
			<pubDate>Mon, 20 May 2013 10:23:36 +0000</pubDate>
			<description>Hello This is one of those stupid questions but you gotta ask to be sure What is var h=0; h += 5; var l=0; l -= 5; Is it the same as: var h=0; h = h+ 5; var l=0; l = l- 5; Thanks and sorry for the stupidity</description>
			<content:encoded><![CDATA[ <p>Hello</p>

<p>This is one of those stupid questions but you gotta ask to be sure</p>

<p>What is</p>

<p>var h=0;<br />
h += 5;</p>

<p>var l=0;<br />
l -= 5;</p>

<p>Is it the same as:</p>

<p>var h=0;<br />
h = h+ 5;</p>

<p>var l=0;<br />
l = l- 5;</p>

<p>Thanks and sorry for the stupidity</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/javascript-dhtml-ajax/117">JavaScript / DHTML / AJAX</category>
			<dc:creator>riahc3</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/454973/one-of-those-stupid-questions-what-is-and-</guid>
		</item>
				<item>
			<title>Hover popup that appears pointing to a button then disappears</title>
			<link>http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/454970/hover-popup-that-appears-pointing-to-a-button-then-disappears</link>
			<pubDate>Mon, 20 May 2013 09:58:23 +0000</pubDate>
			<description>Hello How can a small (I imagine jQuery UI popup) popup hover over a page then disappear after x seconds?</description>
			<content:encoded><![CDATA[ <p>Hello</p>

<p>How can a small (I imagine jQuery UI popup) popup hover over a page then disappear after x seconds?</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/javascript-dhtml-ajax/117">JavaScript / DHTML / AJAX</category>
			<dc:creator>riahc3</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/454970/hover-popup-that-appears-pointing-to-a-button-then-disappears</guid>
		</item>
				<item>
			<title>Image Slider Help</title>
			<link>http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/454962/image-slider-help</link>
			<pubDate>Mon, 20 May 2013 08:26:25 +0000</pubDate>
			<description>Dear Friends, I've generated Image Slider using WOWSlider. Now I wants to add tooltip to that Image Slider. It's mean, when user hover mouse on the each slider each tooltip should be displayed. How can I do it?? Please help me friends.</description>
			<content:encoded><![CDATA[ <p>Dear Friends,<br />
I've generated Image Slider using WOWSlider.<br />
Now I wants to add tooltip to that Image Slider.<br />
It's mean, when user hover mouse on the each slider each tooltip should be displayed.<br />
How can I do it??<br />
Please help me friends.</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/javascript-dhtml-ajax/117">JavaScript / DHTML / AJAX</category>
			<dc:creator>Shalomd</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/454962/image-slider-help</guid>
		</item>
				<item>
			<title>getDateFromFormat is not defined</title>
			<link>http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/454948/getdatefromformat-is-not-defined</link>
			<pubDate>Mon, 20 May 2013 00:36:36 +0000</pubDate>
			<description>Hi! This is my code to get the difference of two dates in Javascript. var today = new Date(); var dd = today.getDate(); var mm = today.getMonth()+1; //January is 0! var yyyy = today.getFullYear(); if (dd &lt; 10) { dd='0'+dd } if (mm &lt; 10) { mm='0'+mm } today = ...</description>
			<content:encoded><![CDATA[ <p>Hi!</p>

<p>This is my code to get the difference of two dates in Javascript.</p>

<pre><code class="language-js">var today = new Date();

            var dd = today.getDate();

            var mm = today.getMonth()+1; //January is 0!

            var yyyy = today.getFullYear();



            if (dd &lt; 10)

            {

                dd='0'+dd

            } 

            if (mm &lt; 10)

            {

                mm='0'+mm

            } 



            today = mm+'/'+dd+'/'+yyyy;

            var minutes = 1000*60;

            var hours = minutes*60;

            var days = hours*24;


            var foo_date1 = getDateFromFormat(today, "M/d/y");

            var foo_date2 = getDateFromFormat("02/28/2015", "M/d/y");



            var diff_date = Math.round((foo_date2 - foo_date1)/days);

            var ans = Math.abs(diff_date);

            alert(ans);
</code></pre>

<p>This works fine in my localhost. However, when I upload it to the server. It does not work anymore.<br />
When I use IE, this is the error it founds.</p>

<p><img src="/attachments/fetch/L2ltYWdlcy9hdHRhY2htZW50cy8yLzM0Mjg4ZjczOGM2NTUwMWQ1YzZlNWM0Y2E1NjIzNTU0LnBuZw%3D%3D/300" alt="34288f738c65501d5c6e5c4ca5623554" title="align-left" /></p>

<p>I tried to chmod the file permissions for all the javascripts and jquery it needs even the folder that these javascript is contained. But it does not do anything.</p>

<p>Kindly help me please :((</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/javascript-dhtml-ajax/117">JavaScript / DHTML / AJAX</category>
			<dc:creator>xuexue</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/454948/getdatefromformat-is-not-defined</guid>
		</item>
				<item>
			<title>keypress causing my sidebar and content to disappear</title>
			<link>http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/454946/keypress-causing-my-sidebar-and-content-to-disappear</link>
			<pubDate>Sun, 19 May 2013 22:34:47 +0000</pubDate>
			<description>so i have a problem, i'm trying to make a live chat where two members can chat without having to refresh the page, and i have got everything work up to where you start typing in the textarea, well i'm trying to check for the &quot;enter&quot; key to be pressed, ...</description>
			<content:encoded><![CDATA[ <p>so i have a problem, i'm trying to make a live chat where two members can chat without having to refresh the page, and i have got everything work up to where you start typing in the textarea, well i'm trying to check for the "enter" key to be pressed, and when it's pressed it'll send the message, but now when ANY key is pressed, it'll make the sidebar div and content div's content disappear, when i look at the html it'll still be there, but not visible on the page...</p>

<p>if you want to see what it's doing on the website the links <a href="http://www.daparadise.com/test/autochat/long_poller.php#" rel="nofollow">http://www.daparadise.com/test/autochat/long_poller.php#</a> please help iv'e been working on this for a couple days and want to get it to work to release on the site ASAP.</p>

<pre><code class="language-js">&lt;div&gt;
&lt;?php include "include/header.php" ?&gt;
fff
    &lt;div id="chatbar" style="width:1050px;"&gt;

        &lt;div id="fullchat" style="background-color:00AF29;"&gt;
            &lt;div id="chatname" onclick="showHide('chatbod 18');"&gt;
                &lt;?php echo $name; ?&gt;&lt;div id="close18" style="float:right;padding:5px;margin-top:-4px; " onclick="closechat('#fullchat');"&gt;X&lt;/div&gt;
            &lt;/div&gt;
            &lt;div id="chatbod 18"&gt;
                &lt;div id="chat" style="overflow-y:scroll;overflow-x:hidden; height:225px;"&gt;
                    &lt;div id="messages" class="0" style="display:inline;"&gt;
                    &lt;/div&gt;
                    &lt;div id="messages" class="0" style="display:inline;"&gt;
                    &lt;/div&gt;
                &lt;/div&gt;
                &lt;div&gt;
                    &lt;form method='post' id="yourform" name="409" &gt;
                        &lt;textarea id="Msg" name="Msg" autocomplete="off" onkeydown="chatenter(event, 409);"&gt;&lt;/textarea&gt;
                        &lt;input name='id' type='hidden'  value='409'/&gt;
                    &lt;/form&gt;
                &lt;/div&gt;
            &lt;/div&gt;
        &lt;/div&gt;

    &lt;/div&gt;

&lt;?php include "../../include/footer.php"; ?&gt;
&lt;/div&gt;
&lt;script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"&gt;&lt;/script&gt;
&lt;style type="text/css" media="screen"&gt;
    .msg{ background:#aaa;padding:.2em; border-bottom:1px #000 solid}
    .old{ background-color:#246499;}
    .new{ background-color:#3B9957;}
    .error{ background-color:#992E36;}
    #fullchat{
        position: relative;
        bottom:0px;
        width:250px;
        max-height:300px;
        border:1px solid black;
        z-index:1999;
        margin-top:-255px;
        float:right;
    }
    #chatbar{
        position:fixed;
        bottom:0px;
        left:0px;
        width:1050px;
        height:30px;
        background-color: #3CD51A;
        background: -webkit-gradient(linear, center top, center bottom, from(#319C19), to(#3CD51A));
        background-image: linear-gradient(#319C19, #3CD51A);
        z-index:999;
    }
    #chatname{
        padding: 5px 5px;
        border-bottom:1px solid black;
        background-color:#807CC2;
    }
    textarea {
        resize: none;
        width:100%;
        height:100%;
    }
&lt;/style&gt;
&lt;script type="text/javascript" charset="utf-8"&gt;
    function addmsg(type, msg){
        $("#chat").animate({ scrollTop: $('#chat')[0].scrollHeight}, 1000);
        /* Simple helper to add a div.
        type is the name of a CSS class (old/new/error).
        msg is the contents of the div */
        $("#chat").append(
             msg
        );
    }

    function waitForMsg(){
        var className = $('#chat').children().last().attr('class');
        /* This requests the url "msgsrv.php"
        When it complete (or errors)*/
        $.ajax({
            type: "GET",
            url: "msgsrv.php?ID=11&amp;MID=409&amp;SELECT=" + className,

            async: true, /* If set to non-async, browser shows page as "Loading.."*/
            cache: false,
            timeout:50000, /* Timeout in ms */

            success: function(data){ /* called when request to barge.php completes */
                addmsg("new", data); /* Add response to a .msg div (with the "new" class)*/
                setTimeout(
                    waitForMsg, /* Request next message */
                    5000 /* ..after 1 seconds */
                );
            },
            error: function(XMLHttpRequest, textStatus, errorThrown){
                addmsg("error", textStatus + " (" + errorThrown + ")");
                setTimeout(
                    waitForMsg, /* Try again after.. */
                    15000); /* milliseconds (15seconds) */
            }
        });
    };

    $(document).ready(function(){
        waitForMsg(); /* Start the inital request */
    });
    function showHide(obj) {
        var div = document.getElementById(obj);
        if (div.style.display == 'none') {
            div.style.display = '';
            document.getElementById("fullchat").style.marginTop="-255px";
        }else {
            div.style.display = 'none';
            document.getElementById("fullchat").style.marginTop="0px";
        }
     }
    function closechat() {
        $("#fullchat").remove();
    }
    function chatenter(evt, id){
        var charCode = (evt.which) ? evt.which : window.event.keyCode; 
        if (charCode == 13){
            var message = document.getElementById("Msg").value;
            $("#chat").append(
                message
            );
        }
        return false
    }
&lt;/script&gt;
</code></pre>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/javascript-dhtml-ajax/117">JavaScript / DHTML / AJAX</category>
			<dc:creator>zacharysr</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/454946/keypress-causing-my-sidebar-and-content-to-disappear</guid>
		</item>
			</channel>
</rss>