// Wow, more stupid Javascript. We can't just do this:
// return ($(e.target).parents('.jqx-tree').length > 0)
// We actually have to do this. WTF?
if ($(e.target).parents('.jqx-tree').length > 0) {
returnfalse;
}
returntrue;
WTF is the reason I can't just do a return on > comparison???
In jQuery event handlers, return false; should be directly equivalent to e.preventDefault(); e.stopPropagation();, and usually works to cancel an event. Having said that, e.preventDefault() is the preferred way to stop the event.
We need to get client system date and time format. At present in our application we have requirement when user login into the application they have to see the date and time format as his local PC date and time format setting.
For example he is accessing the site form the then he able to see exact his local system date and time format instead of server format.
We tried this approach by using. date.toLocaleDateString() but this is returning the current local system date instead of format. Even this date.toLocalDateString() is behaving differently in different browsers.
So, please assist me how to get exact customize date and time format of client system.
Example: like (dd/MM/yyyy hh:mm, MM/dd/yyyy hh:mm and so on).
Please see this link what i am expecting http://screencast.com/t/wgrgvHmDrY[^]
angular.module('ViewLogsApp', [])
.controller('ViewLogsController', [
'$scope', function ($scope) {
$scope.logslist = [];
$scope.load;
$scope.load = function () {
$.ajax({
type: 'GET',
contentType: 'application/json; charset=utf-8',
url: 'UserActivityLogs.aspx/getList',
success: function (data) {
$scope.logslist = data
$scope.$apply();
}
});
}
$scope.load();
}
]);
WebMethod code:
[System.Web.Services.WebMethod]
[ScriptMethod(UseHttpGet = true, ResponseFormat = ResponseFormat.Json)]
public static List getList()
{
SqlConnection con = new SqlConnection();
con.ConnectionString = _connstr;
con.Open();
var logs = new List();
string get = "select * from UserActivityLogs";
//string get = "sp_employee";
SqlCommand cmd = new SqlCommand(get, con);
SqlDataReader dr = cmd.ExecuteReader();
while (dr.Read())
{
UserActivityLogsList e = new UserActivityLogsList();
To make sure if you are really getting your data at javaScript level and to make sure if your $scope is really working fine first try this snippet in your html. If it works than try all columns.
If it does not work than try this in your html and body tags
<html ng-app="ViewLogsApp"></html>
and
<body ng-controller="ViewLogsController"></body>
Just a rhetorical question...but sometimes when I'm looking for the correct code, things get so convoluted! When I figure it out, like how to stop a timer with the clear interval...face palm! It was so easy! I feel like there is something missing from my understanding or just my novice status, needing more experience. Thanks all for listening/reading my "moment".
I want to create an array containing graphic GIF files (or pointers to the files) such that I can access and show the file with: document.write(array[gif1]);
I am new at Javascript. If there is something better than document.write, I'm open for suggestions.
You would have to show us the code you are currently using to do this. But my guess is you are just adding "," to some variable that is being decremented. So, just check if your variable is 1 first and if so, don't add the ","
There are only 10 types of people in the world, those who understand binary and those who don't.
var str,i,counter="";
for (i = 5 ; i >= 1; i--) {
str =i+',';
console.log(str);
counter+=str;
}
console.log(counter.replace(/.$/,""));
//console.log(counter.substring(0,counter.length-1));
The string value for the required rule is a jQuery selector which will be evaluated in the context of the form. The rule will only apply if the selector returns at least one element.
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
Yes. You just need to set up a comment box for each question, with its own rule. The dependency expression would use the name of the radio buttons for the question - for example:
You'd then just need a script to monitor the click event of each radio-button, and show or hide the relevant comment box. How you find the relevant comment box for the clicked radio button is up to you - I'd be inclined to use a predictable ID:
<textareaid="promptness-comments"name="promptness-comments"rows="2"cols="50"></textarea>
...
<script>
$(document).ready(function () {
...
$("#form1").on("click", "input:radio", function(){
var group = this.name;
var commentsId = "#" + group + "-comments";
$(commentdId).toggle(this.value === "1" || this.value === "2");
});
});
</script>
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
Ford Motor Company is accused of stealing Versata's Automotive Configuration Management (ACM) software. Versata is currently investigating this matter and is seeking information from individuals that formerly worked at Ford Motor Company on either the ACM program or on the replacement program called Product Definition Offering (PDO). If you previously worked on either one of these programs we would like to hear from you on a confidential basis at [email protected].
We very much appreciate your response and are eager to hear from you.
I am sorry for the very basic question, but I don't have a reference book. Can you have more than one "Else if " statement in case you needed to make more than 2 comparisons to the same item?
use the dev tools of your browser, or a tool like Fiddler, to examine the network traffic. So if the request is being made and if so what its return status is. Maybe it's 404? or 500? We can't access your system so don't know.
<script>
function myfun() {
var age = 21; //change value of age and check it.
(age < 21) ? alert('less than 21') : (age > 21) ? alert('greater than 21') : (age == 21) ? alert('equl 21') : alert('else part');
}
</script>
I think you have not tested well in my case it's worked fine. i think you should have to check again.
if any doubt then reply me.
just change value of age like 19,21,22 and 'blah..' it gives you all kind of alert..please try it out.
Well I guess you do not understand that simple statement only requires two if parts.
If age is less than 21 : Alert1
If age is greater than 21 : Alert2
Else: age must be equal to 21, so the test for equality is not needed.
Hello Richard MacCutchan,
have you read question of "Member 11849688" he written clearly that "else if age==21 alert" that means he/she wants alert on equality condition also.
please read out the question properly.
he/she want 4 alert <, >, ==, else part.
Yes, and that is what my logic provided. If you really cannot understand simple boolean expressions then ...
And in future, please do not remove messages as you have done here. We all get things wrong from time to time (me more often), so just be adult enough to accept correction.
but when the window size is resized the cs property 'right' should also reduce as this div is not visible if window is minimized than 100%
Initially
`$( window ).width() = 1899px;`
'right' property for feedback div should be 310px
For every reduce of 10px in window width, right css of feedback div should reduce by 4.5px
egg.
Width = 1899px Right property = 310px
Width = 1889px Right property = 305.5px
Width = 1879px Right property = 301px
.
.
.
.
util
Width = 1234px Right property = 0px
I'm not able to make this logic work. Can anyone please help