Uncaught TypeError: Cannot read property 'color' of undefined
Greetings, I'm fairly new to jquery and have encountered the following problem. I'm trying to pass the id of a div into a function, (see code below), and get the "Uncaught TypeError: Cannot read property 'color' of undefined". I've simplified the code to make it more readable. Can someone tell me what I'm doing wrong? Thanks for reading this and thanks in advance for taking the time to respond. <div id="div1" style="color:red">some text </div> <div id="div2" style="color:blue">some text </div>
unable to submit form after a condition is true
Hi, I have the following code, but I am able to prevent the form submit when the qty is less than the min bid amount but unable to submit the form when the qty is greater than min bid. first time if input qty with a lesser value and then input the qty value greater than min_bid then the form is unable to submit. If I input qty value greater than min_bid amount in the first time then I am able to submit the form Please help <form class="form-inline" method="post" id="auctionform" action="<?php echo
delete a tr based on sub element value inside
I have a html body which has : <table> <tr><td><h3><nobr>Leaveit1</nobr></h3></td></tr> <tr><td><h3><nobr>takeit</nobr></h3></td></tr> <tr><td><h3><nobr>Leaveit2</nobr></h3></td></tr> </table> I want to delete the tr which contains nobr as "takeit". How do i go about doing it thanks
Go To URL in XML file After Drop Downs Are Selected
I am trying to make a dynamic drop-down menu that, when completed, takes you to the page listed with it in the XML. Right now I have it to where it spits out all the information but I keep breaking it when trying to get it to go to the url. Demo page: http://creativenights.creativecaraudio.net/cn/psfit/psfit.html HTML: <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script> <script src="psfit.js"></script> <table style="width: 100%;" border="0" align="center"> <tbody>
Add the class only to the previous element not all of them?
Hi, Looking at this Pen, I'm trying to achieve that if an input-field is checked only the element with the class "js-booking-list__header" which is before the input-field should get a class added. But all other elements with the class "js-booking-list__header" which are in DOM after the the checked input-field shouldn't get the new class. Only previous header should get a new class However it's not working as it should. What am I doing wrong? Thanks
Mischievous user clicking button repeatedly to trigger ajax : how do I prevent it?
I'm considering a case where a mischievous user repeatedly clicks (3-4 times per second) an ON / OFF button that triggers AJAX ajax on my web application. I tested this on my local machine and didn't see any problem. My specific application makes entry to the database upon every toggle of the ON / OFF switch. I'm wondering what kind of protection should I have for my switch? What kind of issues can repeated ajax submission cause?
Prevent Mobile Zooming on Input Select
I noticed when running on a mobile, when selecting a form input, the keyboard opens at bottom, but also the page zooms in. Is there a way to prevent the zooming when selecting an input? Or at least a way to return the zoom to normal when the user clicks the 'Done' button in keyboard?
Open PDF in seprate windows
I try to Download/open PDF file in separate window but currently PDF file is open in same window this is what i try <script type="text/javascript">
//$(function sumdata() {
function mypdf() {
$('#tabledata').tableExport({ type: 'pdf', escape: 'false' });
window.open(mypdf);
}
//});
</script> <a href="#" id="pdf" onclick="mypdf()" style="background-color: #3399FF;color: #FFFFFF;font-weight: bold;display:none;font-size: medium;PADDING:
$,ajax vs $.post - $.ajax data format causing error
Hi, Need explanation of where I'm going wrong. I have to process the var str to properly call $.ajax but don't know how. See Source below to see value of str. var str=$("#imageForm").serialize()+"&recId="+recId; var request = $.ajax({ // get data from database url: "revise.php", type: "POST", data: str, // wrong way here, I think dataType: "json" }); // ajax request.done (updatedData); request.fail(function( jqXHR, textStatus ) { alert("Bad
.index with context
I am working on a grid widget and I recently found an issue with my code when grouping columns. The grid displays the data inside a table element where each row that display's the model's data has a class called .data-row. This allows a row that actually contains model data to be easily distinguished from rows used to show group headers or aggregates, etc. When running my tests, I found that when there is more than one grid on the page, the .index() function doesn't maintain context. When editing
.each() not returning data
I have the jQuery function below that is not returning the data back to my table. This line: window.alert("Userlist: " + JSON.stringify(usersList)); returns the data but this line: row = $('<tr id="row-' + item.id + '"><td>' + item.FullName + '</td></tr>'); is not returning the item.id and item.FullName. Ideas??$.each() $(function () { var usersList = []; function init() { $.ajax({ url: '@Url.Action("GetNames", "UserNames")',
Request headers and evil.com
I was recently looking at the network tab for something and found in the Request Headers. Evil.com Attaching screen shot.
How do you get Jquery to run with cascading dropdown lists?
Hi, Have a cascading dropdown list (DDLB) that refreshes with results from after a selection is made from DDLA. It also appends another list item with a value of -2 with text of not listed. The default value is -1 with text of make a selection I finally have some working jquery that shows/hides a separate textbox column. My question is, how do you make the JQuery load/run after the list has been received from user making a selection in DDLA? The process would need to also run if the user changes
File input Blob.slice error
I've got a form that I'm submitting by ajax, but I guess during the ajax sendoff, I'm getting an error: Can only call Blob.slice on instances of Blob I don't see a console.log immediately after so I assume the ajax is choking? I create a simple object that contains all the inputs in key/value pairs - shown as the last log entry. I'm guessing this has something to do w/ file attachments, but I don't know what I've done wrong. An example page is running here: http://www.partiproductions.com/mailshield_test/
2.2.0 to 3.1.0 upgrade: .serialize() will not serialize disabled objects?
UPDATE 08/05/2016: After looking into the issue closer, it turns out that the .serialize() method is no longer serializing the values of any disabled objects or their children. This is a breaking change, as it is common practice to disable a page, or portion of a page, during a post to prevent additional clicks/selections/whatever. I don't see anything in the notes that this was intended, but that is the current functionality. Is this new functionality intended? If so, is there a way to serialize
how to create data list as rows for more attributes by jquery
Hi i need to create data list as rows as following shape id 1 name ahmed salary 1000 id 2 name mohammed salary 2000 how to do that by jquery or html
Script conflict
I have two scripts which are conflicting: smooth scroll and Popup Overlay. When smooth scroll is included, Popup Overlaywill not pop up.Remove the smooth scroll and the pop up works. Any thoughts? Smooth Scroll $(function () { $('a[href*="#"]:not([href="#"])').click(function () { if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) { var target = $(this.hash); target = target.length ? target : $('[name=' + this.hash.slice(1)
how to increase counter of click button every time click in run time
Hi I create web page have input type text and button add when write value of course name in text box and press click add button it added in table as following c# 0 0 like dislike What i need actually is when press click on like button increase value of 0 depend on how many time click i will press button like suppose i click like button 5 times click it will start 1,2,until it reach to 5 my fiddle to my code as bellow https://jsfiddle.net/d900eyvu/
Custom Ajax Response Methods
Hi, I was wondering if there is a way to implement a custom Ajax response method, besides what's already there, like "done" or "fail". For example: // Assign handlers immediately after making the request, // and remember the jqXHR object for this request var jqxhr = $.ajax( "example.php" ) .done(function() { alert( "success" ); }) .fail(function() { alert( "error" ); }) .MyCustom(function() { alert( "Item Already Exists In the List" ); }) .always(function() { alert( "complete" ); }); }
Dialog Box
Full name Username Password Submit
Visual Studio 2015 with Microsoft Edge, Unexpected Error starting up the application. Assignment to read-only properties is not allowed in strict mode
The error message in the title comes up in an alert box when I start my application from Microsoft Visual Studio 2015 using Microsoft Edge as the browser. Its OK in IE11 and Firefox. Initially I thought it was something about Edge and VS2015, but actually when I did a hello world app or a fiddle, it didn't happen. So a lot of alert statements later I found the problem, it turned out that this bad line of code was accidentally left in there: $(document).on("focus", "input,textarea,select,button");
How to change the copy of object of dom without affecting base dom?
Hi Team, I am creating object and setting with part of innerHTML of dom and sending it following function to make sum changes before i process it for print pdf. however whenever I am applying any change on that object it is getting effect on main dom. I am trying to remove all the href from innerHTML and it works fine but after this on main page hyperlinks stop working. function RemoveHyperlinks(obj) { var innerhtmlobj; var array = obj[0].innerHTML.split('href=\"');
ol li click ie8
hi, I've got a problem using an OL click, I would like to click each LI in ie8,but only when click decimal is nice,when i click after area of decimal is no effect. thank you for help !
export data in pdf
I populate data in table through jquery now i want to export that data in pdf /excel For this I try this link export data link link I try this work successfully then i this code add in my file <a href="#" onclick="$('#tabledata').tableExport({ type: 'excel', escape: 'false' });">XLS</a> <a href="#" onclick="$('#tabledata').tableExport({ type: 'pdf', escape: 'false' });">PDF</a> I create table with the help pf jquery success: function (result) { var final = JSON.parse(result.d).response;
IF user name and password found in local storage go to index2 with user name and password
I have two page index.html source page index2.html destination in source page (index.html) i have two input boxes for user name and password and check box remember me and button login 1-if client write user name and password then checkbox remember me checked then it will store data of user name and password in local storage when open web application again it must open index2.html directly and index2.html have user name and password in this case 2- if check box not checked it will not store data
selectors: how to replace :eq with .eq()
I am trying to switch from `:eq()` to `.eq()`, for two reasons: 1) I find it easier to read, especially in my case where calculations are used to compute the index 2) jQuery docs saying: Because :eq() is a jQuery extension and not part of the CSS specification, queries using :eq() cannot take advantage of the performance boost provided by the native DOM querySelectorAll() method. For better performance in modern browsers, use $("your-pure-css-selector").eq(index) instead. However, I'm not sure how
Get out of jQuery IF context
I modified this code from another project. I want a slider that goes both directions. I did not want to siled all panels at once. Like I see a lot of sliders do. I wanted the content to show in kind of an “in-demand” once requested way. This being one of my first jQuery projects, I figured I would learn, so I tried it out. I seem to get pretty much what I wanted. The place I am stuck with is this. I cannot seem to get out of the IF statement context in the sliderMultipanel function. I need this,
Show div one at a time using button, with default div showing.
<!DOCTYPE html> <html class="no-js" lang="en"> <head> <script src="https://code.jquery.com/jquery-1.10.2.js"></script> </head> <body> <button class="btn btn-danger">Edit</button> <div>1</div> <div style="display: none">EDIT</div> <script> $( "button" ).click(function() { $( "div" ).toggle(); }); </script> </body> </html> I want to show/hide div but there will be default div showing.. This is my code, whenever I tried to put div inside each div it's how showing. Maybe show/hide will be easier?
[jQuery] For Loops vs Each Loops while optimizing efficiency
I have a trac plugin named DynamicFieldsPlugin. My studies show that this piece of code takes the most time. I know there are a lot of each used here. So I need your advice to improve its performance. Here is my layout.js code: /* * Layout 'class' */ var Layout = function(name){ this.name = name; // Selector for all field tds/ths this.selector = ''; // Return the given field name's td/th element this.get_tx = function(field){} // Return the given td/th element's
Last row total not updated when change in salary or bonus or deduction
n my task below i have only one point. when i changed in cell of bonus or salary or deduction it can changed in total of row but i cannot change in total of columns when i change in cell of salary or bonus or deduction automatically to explain Name salary bonus deduction total Ahmed 1000 500 500 1000 Ali 2000 400 600 1800 total 3000 900 1100 2800 total=salary + bonus - deduction(for row) the wrong in when i change in bonus cell for name Ahmed from 500 to 700 total for column bonus not changed it
When Done
Hi, I'm trying to write an example for when done here: When Done I expect that the box get blue after 3 seconds (when the first function is done), but it get blue right after document.ready. What is wrong with my code? Thanks
Can we remove sizzle code from jquery? If no is there any licence issue for end user?
We are using jquery in our application which in build include sizzle js I want to know is there any GPL licence issue for customer if they use jquery in application? Can we remove all code of sizzle from jquery file? Thanks in advance
Select value from table
I have multiple records in table .. Scenario when i click on row then chart is display according to ID now i want to specify that which owner have this data so for this i try to display owner name .. i have data in table now i want to display value in label ID Owner RegNo 26626 John B82 26634 David BE49 26642 Roh A5 26640 Julie B5
Element visible in body but can't be find by id
I am having an issue with finding certain id in my body with jquery. As seen below I have created three logs each indexed with either 0,1 or 2. 0 - as expected returns empty object, though page hasn't loaded yet. 1 - returns empty object even though app already loaded and $("body") call returns object which includes the element I am looking for 2 - returns the element I am looking for any advises how to solve my problem? I can't find why body object contains the element I am looking for, but
img refreshing
Hi there, I use code to upload image to server through ajax POST, following the image upload I update an image on page with the following code - var img = new Image(); var d = new Date(); var fName = "/myfolder/" + $('#File')[0].files['0'].name + "?" + d.getTime(); $(img).load(function () { $(this).appendTo("#imgDIV");}).attr("src", fName); The problem is after loading the image and setting the src attribute it shows only part of the image. Any idea how to overcome this issue ? Regards,
Replace
Hello, We have this price range automatically provided by API and we would like it replaced. Example is. <p class="price-range">$0 - 50, 0000</p> or <p class="price-range">$20,000 - 49,000</p> How do we replace those via jquery? Instead of showing those numbers, we would like to change it like "Negotiable" if price range is less than 50,000 Thanks.
Selected Option assistance
Hi, Im trying to format a particular row based on the option selected from a dropdown list (that has a value of -2). Ive got the formatting working previously before introducing the rest of the code. Thanks to Jakecigar its been established that my environment plays with the code but after mucking around with this query for a while now, I was hoping to just check the format & eliminate any issues there before troubleshooting id issues. Code below, thanks in advance $(function(){ $("#CategoryID").change(function(){
total of row cell not get color red if greatest than 1000
I have 5 column Name Salary,Bonus,Deduction total ahmed 500 200 100 600 calculation per total total=Salary+Bonus-Deduction if total>1000 make red color per cell total as sample above i need to get red color per row added When click button add row must add and total must have red color if greatest than 1000 I try more time to color my cell total only if total greatest than 1000 but not come my code as following @{ Layout = null; } <!DOCTYPE html> <html> <head> <meta name="viewport"
Is it expected that my script runs this slow?
I have added a small script to a wordpress site, being developed locally inside a LAMP-stack. It's just a few lines, the entire file is what you see below. From when the html+css is drawn in the browser (current FF and Chrome) it takes about ½ second until I see the new script-inserted margin-bottom having its effect. I thought this small change would be applied without the eye noticing it. Is it normal that it takes such a long time? var setThumbMargin = function () { var calendarItemMargin
Learn jQuery debugging by examples
Hi, since I have started learning jQuery I learned a lot. However one of my weakest side in working with jQuery is that I don't know how to debug the code and find mistakes and problems. Specially in a big project where many different JavaScript files are in use, it's very difficult to find the part of code which causes the problem. Is there any book, or tutorial which explains the right way for debugging and finding JavaScript (jQuery) problems? Especially in a larger project? Are any tools or plugins
Next Page