- Screen name: rajeshyadav
rajeshyadav's Profile
28 Posts
19 Responses
0
Followers
Show:
- Expanded view
- List view
Private Message
- 17-Mar-2021 12:55 AM
- Forum: Getting Started
hi,I heard that variables must be declared above the loop to avoid the declaration cost specially in sql server.so here in jquery i noticed people declaring variables in side the loop lik e$.each or foreach loops .q1) is it good practice?yours sincerely- q1) I have sorted the "var dd" first then I have iterated using "each", does the order in dd is followed by "each" or it can change the order in any case?q2) do all the loops honour the sort order?q3) if I declare the "var dd" as global var and sort it, then will it preserver the order inside the "var dd" all the time or is there any case where it can change?q4) when we get data ordered from database using ajax function of jquery, is the data remains ordered or it can change in any case?<script>var dd = [{ id: 2, dd: "t",type:"kk" },{ id: 3, dd: "h",type:"kk" },{ id: 1, dd: "k",type:"kk" },]dd.sort(function (a, b) {return a.id - b.id;});$.each(dd, function (key, item) {if (this.type == "kk") {$('#div1').append($('<h2 id="h22">' + item.dd + '</h2>'));}});</script>
- 09-Aug-2020 11:06 PM
- Forum: Using jQuery
I noticed people using $("#div1").empty() to clear every thing inside the div, with attached events . and $("#div1").html("") to achieve the same. pls, tell me the difference between them or which one should be used.- 02-Aug-2020 05:45 AM
- Forum: Using jQuery
I have one WCF data service, now I want to use jquery to send set of records to wcf data service for updating at once, any link with an example would be more helpful.
thank u
- 23-Jul-2020 05:26 AM
- Forum: Using jQuery
i want to block the web page so that if i click save button, then while the save button is processing one should not be able to click on any other button and after the process of the click of save button is over then form should be available.Q1) how many ways this could be achieved.q2) following is the way i am using but it is not showing the div unless the processing of the loop finishes.- <style>
- #popupblock {
- width: 100%;
- height: 100%;
- position: fixed;
- z-index: 9999;
- top: 0;
- background:url("~/Content/loader.gif") no-repeat center center rgba(0,0,0,0.25)
- }
- </style>
- <div id="popupblock" style="display:none;">
- </div>
- <input id="Button1" type="button" value="button"
- <script type="text/javascript">
- $(document).ready(function () {
- $("#Button1").click(function () {
- $('#popupblock').show();
- let ii = 0;
- let text = "";
- while (ii < 19000000) {
- text += "the number is " + ii;
- var t = text;
- ii++;
- }
- $('#popupblock').hide();
- });
- });
- </script>
- 21-Jul-2020 08:07 AM
- Forum: Getting Started
hi,Q1) should i define and declare this function inside the docuent.ready or outside.i do not need this x2() function any where else , i need it inside only.$(document).ready(function () {function x2 (){alert("abc");}$('#ddlcomp).change(function (event) {x2 ();});$('#ddlcust').change(function (event) {x2 ();});});hi,
Q1) i want to use const of javascript and let with jquery 1.9 on my page , can I use it?
Q2) I have more than one js file on my aspx page, what I have noticed is that in each js file , I have some variables which are declared with var but they are nothing but abbreviation(which are not changed). so can I make them const?
- 28-Jun-2020 01:52 PM
- Forum: Getting Started
hi
when i compair in javascript like so , then it converts one type to another type. which is based on precedence. can i get link of that precedence.
if ("2"<3)
{
}
- 27-Jun-2020 04:43 AM
- Forum: Getting Started
hi,i want to disable all the elements except the text box whose entry is wrong.,the problem is, when ever some one enters wrong txt in textbox , i set the focus to the element , i do not want the user to click any other control unless her corrects the entry which is mandatory.- 26-Jun-2020 03:58 AM
- Forum: Using jQuery
hi,in asp.net i noticed that there is an event which can capture all errors at one place. u do not have to put try catch at all the places.similarly if i am using jquery , is there any event or functionality which can give me this facility.- 26-Jun-2020 03:09 AM
- Forum: Getting Started
hi,i have used this line $(selector).parent().parent();I want to know that how many browsers support it.note: the html properties used by java scripts browser compatibility is at MDN.but my question is about the function of j query.- 25-Jun-2020 08:19 AM
- Forum: Getting Started
hi,is there any website or library exists which can tel me that this property or function would not run on particular browser.and at least if it could tel the runtime errors ?- 25-Jun-2020 08:16 AM
- Forum: Getting Started
hi,
I have a textbox and a button, with this I have written a focusout event of textbox which calls a function which returns true or false.
and I have written one click event of the button.
now I want to cancel the click event of the button if the function which is called in focusout returns false else it should follow the natural chain of events.
and the problem is worse because I have many buttons and checkboxes which have got click events or other events too. so I want to find the next event which can execute after focusout and then cancel it as per the case.
pls answer for jquery and javascript both.
- i used change event of textbox and found the change , then blur and then focusout fires in an order,so i wanted to know all set of orders of events which exist and fires in Dom.so pls send me link of that domcumentaiton.
- 09-Jun-2020 06:10 AM
- Forum: Using jQuery
hii can get the data attribute using following pls tel me which one is fast and safe .specally i want to know that the jquery method the third one will tervers the whole dom to find the element orit will just convert the element's object into jquery and would get the data- attributes vlaue?the obj is a variable where i have passed the this key wordonclick="fun(this.getAttribute('data-uid')
and inside function fun i have used all three ways to get the value of data-uid1) var uid= obj.getAttribute('data-uid')2) var uid= obj.getAttribute('data-uid')3) var uid= $(obj).attr('data-uid');- 03-Jun-2020 08:49 AM
- Forum: Using jQuery Plugins
hi,it works in first case but not in second , pls tel me why- <table id="example" class="display" style="width:100%">
- <thead>
- <tr>
- <th>Name</th>
- <th>Position</th>
- <th>Office</th>
- <th>Age</th>
- <th>Start date</th>
- <th>Salary</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td>Tiger Nixon</td>
- <td>System Architect</td>
- <td>Edinburgh</td>
- <td>61</td>
- <td>2011/04/25</td>
- <td>$320,800</td>
- </tr>
- </tbody>
- </table>
- // then in js file
- var table12 = $('#example').DataTable();
- table12.page(1).draw(true); // works
- // but in below case it does not
- <table id="tblReport1" class="display" style="width:100%"><thead></thead><tbody></tbody></table>
- // in js file
- var dd = [
- {
- "name": "Tiger Nixon",
- "position": "System Architect",
- "salary": "$3,120"
- }
- ];
- var table111 = $('#tblReport1').dataTable({
- "data": dd
- ,
- "columns": [
- { "data": "name" },
- { "data": "position" },
- { "data":"salary"}
- ]
- });
- table111.page(1).draw(true); // does not work
- 27-May-2020 07:18 AM
- Forum: Getting Started
I have used only aspx page and javascript. so from page, i want to call jquery ajax method to send more than one row at a time to WCF data service.
data could be of one table or more than one tables, related or non-related.
os there is any documentation exits then pls send me the link with an example.
few people said datajs,js also does it, but I could not open the documentation of the library may be something wrong with the site.
one more thing, thought wcf data services might have described the formate of post data, so that i can formate my data in the given formate in javascript and post it to
wcf data service using ajax. so a like of wcf dataservices would be help full which could describe the formate of inserted, updated etc data to be posted to the service.
- 08-May-2020 06:28 AM
- Forum: Getting Started
I have a page login.aspx, it has a link <a href= "webfolder/abc.aspx"on click it opens properly but when i open another link which is on abc.aspx,link <a href = "webfolder/abc1.aspx"> this one does not opens instead.it copies webfolder/webfoldertwoice.i wanted to understand the process, because i tried windows.location and equivalent but they all behaved in then same way.- 09-Apr-2020 03:43 AM
- Forum: Getting Started
DateTime.SpecifyKind(Convert.ToDateTime(filterParam.dtFrom).Date, DateTimeKind.Utc);
well the main question is.
i get datetime in json string "2019-01-01T00:00:000Z"
i do not want to remove Z out of it and i want to show it on page with ddMMyyyy formate, when i use moment(day).format(timeFormat);.
this reduces my date by one as my local is America. so please suggest how should I format.
- 16-Feb-2020 01:04 AM
- Forum: Using jQuery
hi,var arr =[{"date":"10/dec2019"},{"date": "11/dec/2019"}] // and so on between 10 dec 2010 to 10 dec 2020above thing can be done using lemda , but pls do not use it as it is not working in my environment , it is working in fiddel. so pls solve with out lembda.- 14-Feb-2020 08:03 PM
- Forum: Getting Started
hi,i have to get the value of key ScurvepPlanData from following json, which is an array.then i have to itrate each object. pls tel me how to do it."ScurvePlanName": "PipeTrack", "ScurvePlanData": [{ "Levels": "Mechanical", "Scope": null, "StartDate": null, "EndDate": null, "Weightage": { "$numberDouble": "20" }, "ParentLevels": "", "ActivityId": null, "IsInternal": false }, { "Levels": "Welding", "Scope": { "$numberDouble": "2000" }, "StartDate": "898989667687687768768", "EndDate": "898989667687687768768", "Weightage": { "$numberDouble": "5" }, "ParentLevels": "Mechanical", "ActivityId": { "$numberDouble": "5" }, "IsInternal": true }] }
yours sincerley- hi,i noticed that span can have any custom attribute like xyz<span id="p" xyz="24"></span>now i can use data-xyz also.so my question is which one i should?q2) in first case should i prefer lower case becasue i noticed it takes any thing.yours sincerley
- 07-Sep-2018 03:15 AM
- Forum: Using jQuery
hi,Any variable we create in the script(javascript) tag of HTML, it goes to the global namespace. which can be seen in the console tab of the developer window(f12).I wanted to find out where does document. ready function goes, and whether it goes to the global namespace or not.
your sincerely
- 05-Jul-2018 03:10 AM
- Forum: Getting Started
hi,I am getting some data using ajax [json], but in javascript it does not support bigint data, becasue it is big.so please tel me some solution at javascript level.yours sincerely- hiDeprecation Notice: The
jqXHR.success()
,jqXHR.error()
, andjqXHR.complete()
callbacks are removed as of jQuery 3.0. You can usejqXHR.done()
,jqXHR.fail()
, andjqXHR.always()
instead.- my doubt is does the above stmt says that follwing way of using will be depricated $.ajax({
url :"views/departments/create.cshtml",
datatype: "xml",
success: function( data ){
alert(data);
},
global :true,
error : function(data){
alert("unable to process request");
}
});
and following will be used- $.ajax({
url: "views/departments/create.cshtml",
datatype: "html",
global: false
})
.done(function (data) {
alert("done to process done");
})
.fail(function (data) {
alert("unable to process done");
}).always(function () {
alert("complete");
});
yours sincerely- «Prev
- Next »
- my doubt is does the above stmt says that follwing way of using will be depricated $.ajax({
Moderate user : rajeshyadav
© 2013 jQuery Foundation
Sponsored by
and others.