|
Please do not just dump all your code and expect people to explain it to you. You have been here long enough to know the procedure.
|
|
|
|
|
Yeah I do accept my mistake but what can I do friend, its totally u-turn in technology, earlier I did javascript coding but just used some events in them getElementByID etc but this jQuery with lot of new concepts and so many things I am trying to learn it, if you can please help me.
One more thing is in the above code he is assigning function to a variable I am not sure why is he doing it all these things are big doubts.
Thanks & Regards,
Abdul Aleem Mohammad
St Louis MO - USA
|
|
|
|
|
|
A nice tutorial to JQuery is here[^].
Click on the Classroom link, and proceed.
|
|
|
|
|
Hi All,
I am new for the jquery world, I have an unordered list in the following way in which each list item has span field, and I have another radio button in whose checked changed event I want to find which list item or span is selected using jquery.
Can I find any way to do it? Any help a link, suggestion or code snippet really helps me a lot. Please help me thanks in advance.
<ul id="reports-All_Reports" class="active"><li class="report">Child DatesDetailed date information about an individual child (for DEL only).</li><li class="report">Child DemographicsCharacteristics of children and families enrolled in ECEAP</li><li class="report">Child Record SummaryEnrollment, health, child development and family information for an individual child.</li><li class="report">Class ListLists Class names and characteristics.</li><li class="report">Class RosterLists child names, birthdate, first language, parent name and contact information, with space for staff to add notes.</li><li class="report">Class SummaryShows information entered on the Class pages of ELMS for one class, or compiled for a site, contractor or (for DEL staff) statewide.</li><li class="report">Contractor ListLists Contractor names and characteristics.</li><li class="report">Developmental ScreeningChildren's development screening dates and results.</li><li class="report">Directors RosterList of ECEAP contractors, funded ECEAP slots, directors, contact information and counties served.</li><li class="report">ELMS Site Data for Early AchieversList of all ECEAP and Head Start sites for the current school year.</li><li class="report active">Enrollment by Child<span class="description">Lists children with their age, poverty level, IEP status, priority points and first and last days attending class.
<input id="phb_rdbCurrentEnrollment" type="radio" name="ctl00$phb$ReportMode" value="rdbCurrentEnrollment" checked="checked">
Thanks & Regards,
Abdul Aleem Mohammad
St Louis MO - USA
|
|
|
|
|
|
var old = $.fn.carousel
$.fn.carousel = function (option) {
return this.each(function () {
var $this = $(this)
, data = $this.data('carousel')
, options = $.extend({}, $.fn.carousel.defaults, typeof option == 'object' && option)
, action = typeof option == 'string' ? option : options.slide
if (!data) $this.data('carousel', (data = new Carousel(this, options)))
if (typeof option == 'number') data.to(option)
else if (action) data[action]()
else if (options.interval) data.pause().cycle()
})
}
$.fn.carousel.defaults = {
interval: 1000
, pause: 'hover'
}
<pre lang="xml"><script>
$('.carousel-inner').carousel({
interval: 2000
})</script></pre>
I want to move slider/carousel automatically without clicking first to start
|
|
|
|
|
You'll have to look through the code for the carousel plugin and find the click event and instead change that code to run on a timer or however you want it to run.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
which carousel you are using. Can you give link for fix you need?
|
|
|
|
|
Here is what I have so far. I cant get it to work.
This application stores the last name, first name, and score for one or more students and it calculates the average score for all of the scores that have been entered.
When the user clicks on the Clear button, this application clears the score data from this application.
When the user clicks on the Sort button, this application sorts the data in alphabetical order by last name.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Student Scores</title>
<link rel="stylesheet" type="text/css" href="default.css" />
<script type="text/javascript" src="student_scores.js"></script>
</head>
<body>
<div id="content">
<h1>Student Scores</h1>
<div class="formLayout">
<label>Last Name:</label>
<input type="text" id="last_name" /><br />
<label>First Name:</label>
<input type="text" id="first_name" /><br />
<label>Score:</label>
<input type="text" id="score" /><br />
<label> </label>
<input type="button" id="add_button" value="Add Student Score" /><br />
</div>
<h2>Student Scores</h2>
<p><textarea id="scores" rows="5" cols="60"></textarea></p>
<div class="formLayout">
<label>Average score:</label>
<input type="text" id="average_score"/><br />
<label> </label>
<input type="button" id="clear_button" value="Clear Student Scores" /><br />
<label> </label>
<input type="button" id="sort_button" value="Sort By Last Name" /><br />
</div>
</body>
</html>
var scores = [];
var $ = function (id) { return document.getElementById(id) }
var displayScores = function () {
var scoreNumber = parseInt( $("score").value );
var scoreString = $("last_name").value + ", " +
$("first_name").value + ": " +
$("score").value;
if (scoreSting.length == 0) {
for (var i = 0; i < displayScores.length; i++) {
var scores = displayScores[i];
for (var i in scores) { displayScores += scores[scoreString] + ", "; }
$("average_score").value = getAverageScore(scoreNumber);
}
var addScore = function () {
var scoreNumber = parseInt( $("score").value );
var scoreString = $("last_name").value + ", " +
$("first_name").value + ": " +
$("score").value;
scores.push(scoreNumber);
scoresString.push(scoreString);
displayScores();
}
var getAverageScore = function () {
var scoreNumber = score.length;
var sum = 0;
if (scoreNumber > 0) {
for (var i = 0; i in scoreNumber; i++)
sum += score[i][2];
}
$("average_Score").value = sum / scoreNumber;
}
var sortScores = function () {
scoresString.sort();
displayScores();
}
}
window.onload = function() {
$("add_button").onclick = add_button;
$("sort_button").onclick = sort_button;
}
modified 17-Feb-15 18:14pm.
|
|
|
|
|
WebDesignStudent wrote: I cant get it to work.
is not enough information. What is it doing? What is it supposed to do? Please edit the question to add detail and context.
|
|
|
|
|
Do not post it as a reply! Edit the question and add it there!
|
|
|
|
|
How should I start learning javascript. From where should it, Any book, Video tutorial etc. I just have 3 months and want to learn javascript to basic or intermediate level not advanced level in 3 months. Please guide me
|
|
|
|
|
|
One really nice tutorial I found is here[^].
Click on the Classroom link, and get going.
|
|
|
|
|
3 months are fair enough to learn JavaScript. First learn some basic concepts of JavaScript like how to manipulate DOM, Event binding, functions in JavaScript.I will suggest learn some jQuery for DOM manipulation. After this start creating some small Application like calculator.Gradually you will understand how things works in JavaScript.
After that you can try some books like JavaScript good part.
|
|
|
|
|
I recommend "learning by doing", which, in your case, means not reading lots of text about the intricacies of the language (like in most JS programming books), but rather read the minimum necessary to start programming your first app. This approach is implemented in my tutorial book Engineering Front-End Web Apps with Plain JavaScript.
|
|
|
|
|
You can start with 'Object-Oriented javascript by Stoyan Stefanov'. Very simple language and start from basics. A must have book for any javascript programmer.
Prateek
|
|
|
|
|
|
I am brand new to coding of any kind. I am reading W3schools, Javascript String Methods, and one of the functions I don't understand is what is the function/purpose of Extracting String Characters?
These two codes are particularly unclear to me charAt() and charCodeAt(). When would they be used?
|
|
|
|
|
Member 11446034 wrote: charAt() and charCodeAt()
The charAt function[^] returns the character at the specified index. For example, if the string contains "Hello", s.charAt(0) will return "H" .
The charCodeAt function[^] returns the numeric Unicode value of the character at the given index. For example, if the string contains "Hello", s.charCodeAt(0) will return 72 , which is the Unicode value that represents an uppercase "H".
List of Unicode characters[^]
Member 11446034 wrote: When would they be used?
They would be used when you need to extract either a character, or the Unicode value of a character, at a particular index in a string.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
good information.
|
|
|
|
|
Hi,
I am new to jQuery, ajax and signalR.
I have this code in Popup.js file, I don't know what it is and I don't know how it executes, but I can understand that this code is to open popups one with close button and another without close button, because I commented and ran it, but I want to have the control over setting which popup to have close and which not. I am trying my best and placing the code in the aspx and ascx files.
I am not understanding, can some one please help me with this, and if I want to overwrite this same functionality in the local popup, page or user control how can I do that?
Any help code snippet, link or even suggestion would be greatly helpful
var control ={
---
convertLinkToPopupWithClose: function (event, informParentOnClose) {
return ELMS.WebControls.Popup.convertLinkToPopup(event, { showClose: true, closeInformsParent: informParentOnClose | false });
},
convertLinkToPopupWithoutClose: function (event, informParentOnClose) {
return ELMS.WebControls.Popup.convertLinkToPopup(event, { showClose: false, closeInformsParent: informParentOnClose | false });
},
----
}
Thanks & Regards,
Abdul Aleem Mohammad
St Louis MO - USA
modified 10-Feb-15 19:32pm.
|
|
|
|
|
I'm trying to to send form data to PHP via ajax but printout shows zero values. My JS editor indicates that one of the scripts below (commented) is invalid. I don't see it. help?
<!DOCTYPE html><html>
<!--To POST data like an HTML form, add an HTTP header with
setRequestHeader
(). Specify the data you want to send in the send() method:-->
<head>
<meta charset=utf-8>
<title>calculator insert form</title>
<style type="text/css">
input{
text-align:center;
}
</style>
</head>
<body><center>
<input type="text" size="45" align="middle" value="enter purpose
in box below" ><br>
<input type="text" align="middle" name="purpose" size="45" >
<FORM name="Keypad"
action="http://localhost/home/calcinsert.php" method="post">
<TABLE>
<TABLE border=2 width=50 height=60 cellpadding=1
cellspacing=5>
<TR>
<TD colspan=3 align=middle>
<input name="ReadOut" type="Text" size=24 value="0"
width=100%></TD>
<TD></TD>
<TD><input name="btnClear" type="Button" value=" C "
onclick="Clear()"></TD>
<TD><input name="btnClearEntry" type="Button" value=" CE "
onclick="ClearEntry()"></TD>
</TR><TR>
<TD><input name="btnSeven" type="Button" value=" 7 "
onclick="NumPressed(7)"></TD>
<TD><input name="btnEight" type="Button" value=" 8 "
onclick="NumPressed(8)"></TD>
<TD><input name="btnNine" type="Button" value=" 9 "
onclick="NumPressed(9)"></TD>
<TD></TD>
<TD><input name="btnNeg" type="Button" value=" +/- "
onclick="Neg()"></TD>
<TD><input name="btnPercent" type="Button" value=" % "
onclick="Percent()"></TD>
</TR><TR>
<TD><input name="btnFour" type="Button" value=" 4 "
onclick="NumPressed(4)"></TD>
<TD><input name="btnFive" type="Button" value=" 5 "
onclick="NumPressed(5)"></TD>
<TD><input name="btnSix" type="Button" value=" 6 "
onclick="NumPressed(6)"></TD>
<TD></TD>
<TD align=middle><input name="btnPlus" type="Button" value="
+ " onclick="Operation('+')"></TD>
<TD align=middle><input name="btnMinus" type="Button" value="
- " onclick="Operation('-')"></TD>
</TR><TR>
<TD><input name="btnOne" type="Button" value=" 1 "
onclick="NumPressed(1)"></TD>
<TD><input name="btnTwo" type="Button" value=" 2 "
onclick="NumPressed(2)"></TD>
<TD><input name="btnThree" type="Button" value=" 3 "
onclick="NumPressed(3)"></TD>
<TD></TD>
<TD align=middle><input name="btnMultiply" type="Button"
value=" * " onclick="Operation('*')"></TD>
<TD align=middle><input name="btnDivide" type="Button" value="
/ " onclick="Operation('/')"></TD>
</TR><TR>
<TD><input name="btnZero" type="Button" value=" 0 "
onclick="NumPressed(0)"></TD>
<TD><input name="btnDecimal" type="Button" value=" . "
onclick="Decimal()"></TD>
<TD colspan=3></TD>
<td><input type="button" name="btnEquals" class="red" value=" =
" onClick="Operation('='); this.form.submit();
event.returnValue = false;"></td>
</TR></TABLE></TABLE></FORM>
<a href="http://localhost/home/calcprint.php">Print</a>
</CENTER>
<font face="Verdana, Arial, Helvetica" size=2>
<script>
var FKeyPad = document.Keypad;
var Accumulate = 0;
var FlagNewNum = false;
var PendingOp = "";
function NumPressed (Num)
{
if (FlagNewNum)
{FKeyPad.ReadOut.value = Num;FlagNewNum = false;}
else {if (FKeyPad.ReadOut.value == "0") FKeyPad.ReadOut.value =
Num;
else FKeyPad.ReadOut.value += Num;}
}
function Operation (Op)
{
var Readout = FKeyPad.ReadOut.value;
if (FlagNewNum && PendingOp != "=");
else
{
FlagNewNum = true;
if ( '+' == PendingOp )
Accumulate += parseFloat(Readout);
else if ( '-' == PendingOp )
Accumulate -= parseFloat(Readout);
else if ( '/' == PendingOp )
Accumulate /= parseFloat(Readout);
else if ( '*' == PendingOp )
Accumulate *= parseFloat(Readout);
else
Accumulate = parseFloat(Readout);
FKeyPad.ReadOut.value = Accumulate;
PendingOp = Op;
}
}
function Decimal ()
{
var curReadOut = FKeyPad.ReadOut.value;
if (FlagNewNum)
{curReadOut = "0.";FlagNewNum = false;}
else
{if (curReadOut.indexOf(".") == -1) curReadOut += ".";}
FKeyPad.ReadOut.value = curReadOut;
}
function ClearEntry ()
{FKeyPad.ReadOut.value = "0";FlagNewNum = true;}
function Clear ()
{Accumulate = 0;PendingOp = "";ClearEntry();}
function Neg ()
{FKeyPad.ReadOut.value = parseFloat(FKeyPad.ReadOut.value) *
-1;}
function Percent ()
{FKeyPad.ReadOut.value = (parseFloat(FKeyPad.ReadOut.value) /
100) * parseFloat(Accumulate);}
</SCRIPT>
<script>
var js_var = "<br />whatever";
document.getElementById("link").onclick = OnCalc ();
{
var xhr;
if (window.XMLHttpRequest) xhr = new XMLHttpRequest();
else xhr = new ActiveXObject("Microsoft.XMLHTTP");
var url = 'http://localhost/home/calcinsert.php?js_var=' + js_var;
xhr.open('GET', url, false);
xhr.onreadystatechange = function ()
{
if (xhr.readyState===4 && xhr.status===200)
{
var div = document.getElementById("update");
div.innerHTML=xhr.responseText;
}
};
xhr.send();
return false;
}
</script>
</body></html>
-------------------- --------------
<?php
$servername = "localhost";$username = "root";$password = "cookie";
$dbname = "homedb";
$conn = mysqli_connect($servername, $username, $password, $dbname);
if (!$conn)
{ die("Connection failed: " . mysqli_connect_error()); }
$sql = "INSERT INTO calculator (purpose, value1, op, value2, total)
VALUES ('purpose', 'value1', 'op', 'value2', 'total')";
if (mysqli_query($conn, $sql))
{
echo "<center>";
echo "data entered<br><br>";
}
else
{ echo "Error: " . $sql . "<br>" . mysqli_error($conn); }
mysqli_close($conn);
header( "refresh:3;url='xxxxxxx'");
echo "<center>";
echo 'I\m old and slow</br>
in a rush, click
<a href="http://localhost/home/calcform.html">here</a>.'
?>
-------------------------------------
|
|
|
|
|
If you know which block of code it is complaining about then please edit your question, remove all the other stuff, and then format what's left for easier reading.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|