jQuery 3.1.1 errors
Running in FF. Seeing it in Firebug. Doesn't seem to impact performance. 2 errors. ReferenceError: Class is not defined (a mile long but starts) return opts.setter.call (this... TypeError: a.Browser is not defined Any clues on these?
how to use 'for' to shorten my code ?
Hi, I would like to replace this part of my code : $('.home').on('click', function() { $('html, body').animate({ scrollTop: $("#home").offset().top}, 1000); }) $('.qui_suis-je').on('click', function() { $('html, body').animate({ scrollTop: $("#qui_suis-je").offset().top}, 1000); }) $('.competences').on('click', function() { $('html, body').animate({ scrollTop: $("#competences").offset().top}, 1000); }) $('.CV').on('click', function() { $('html, body').animate({ scrollTop: $("#CV").offset().top},
Bootstrap detect visibility of element
I have a span element that is toggled with a bootstrap class "hidden-xs" I want to detect if it's visible in an onclick event. I've inspected the style. display and style.visibility values and they are always empty. What properties are changed when the class is used? html: <span id="CommissionersTableHeadingFlagUp" class="hidden-xs glyphicon glyphicon-triangle-top"></span>javascript: var elemDisplay=document.getElementById('CommissionersTableHeadingFlagUp').style.visibility;
alert(elemDisplay+elem2Display);
Why doesn't the other radio button's images go back to original opacity?
I am doing a webpage as part of a project at school, but I have come over a problem that simply doesn't make sense to me. My webpage is here: http://folk.ntnu.no/williamo/prosjekt2016/bestill.html The idea is that whenever I press a radio button, the image under should get opacity 1. It works, but whenever I press a new radio button, the image still has opacity 1, contrary to the expected 0.5, and I don't know why. Here is the code I use: radioImages.on("click", function() { if( ($(this).is(":checked"))
Split comma seperate string and add the parts as values to post function
I have the following values stored in a variable called 'data' 46/lee jones/csf But thats just an example how they are sent to me to use. And I gain that with the following code if (data != 0){ var stuff = data; alert (stuff); } So then what I want to do is seperate those values up into single items, and attach as values to post as below. I have put the values in to demonstrate how they need to line up, but obviosuly I need to use the values in maybe array values I think, but not sure how
How does .first() work?
Hello all, suppose, that I have two divs with IDs: #nav and #content ...and #nav comes first in the DOM. Which one is selected by: $('#content, #nav').first() ? i.e. is the first one in the DOM selected, or the first one in the selector? Thanks in advance!
draggable posotion "right"
How to make a "draggable" change the css value of "right"? P.S. Sorry for my english it's Google Translator :)
Show button when checkbox checked.
Hello guys, i have a small script to show the button when the checkbox checked. But the problem now is.. that I have multiple checkboxes and when I checked them all and uncheck one.. the button hides again here is my code: $(document).ready(function() { var $sub = $("#removImg").hide(); $(document).on('change', 'input[name="chkboxplat[]"]', function() { $sub.toggle(this.checked); }); }); I really appreciate your help :) Kind regard, Henk
Post returns 404 after 40.09 seconds (consistent +/- .01) After executing code?
Hi, I've got a csv that I'm uploading via web form. Long story short, to appease my boss, I had to submit the form to a page that forwards the actual processing of the csv by ajax request to another script in the same directory. After exactly 40.09 (again, +/- 0.01 seconds) my browser receives a 404 error. During that 40.09 seconds, however, the csv file is being read and my database is being updated by the script that the server can't find? I feel like there's an implicit timeout somewhere since
trying to mimic dropdown menu of website
I noticed the dropdown menus at stripe.com are really nice. I inspected the code and it appears that they are using jquery, but I cannot tell if it is a plugin or all coded from scratch. Does anyone know how I can mimic that dropdown menu effect on our site? Thanks Mike
Custom/Dynamic variable name
Hi, In jquery variable, how can I have variable like below opts.[dynamic name]+'Func' opts is an object variable inside function var opts = $.extend( options );I can access with passed in variable name but in one of my case, I will be getting a [dynamic name] from another variable and I would like to check or access it. /* name "mobile" cannot be fixed as below statements will be checked within .each loop. Therefore "mobile" need to be dynamic. Got other name(s) may appear in the loop. */ if (opts.mobileFunc)
How do I get the max-width of a TD
I have a TD that is styled with a class that gives it a max-width as follows: #newDivCenter { background-color: yellow; text-align: center; min-width:788px; max-width:840px; } When I try to retrieve that max-width, I fail. I tried plain JavaScript: var newDivCenter = document.getElementById("newDivCenter"); alert(newDivCenter.style.maxWidth); but that failed, so would jQuery work instead? How would I try it in jQuery? So far, it fails on a TD, and also on a TABLE element (I
zoom slider with separate title for images
http://materia.dnsdojo.com/jQueryImgZoomSlider/demo/ this slider has common text for all image. pls help for the same slider with change title for each slide
Wrapping the Ribbon Title
Hi, I am using the Ribbon Js http://codepen.io/jswaldon/pen/AFjKB I have a requirement that the tab list like Main, Reports, Admin, Client may run into 30 or 40. In those cases what is happening is the some of the menu titles are going outside the window and hides. Please refer screenshot below. I have upto Tab Heading 30 but only upto 16 are displayed. Can some one help how to make it wrap after the view ends? Perhaps a blend of jquery and bootstrap can help?
Referencing multiple elements at once?
Assume I have the following source structure: <div id="aaa-bbb-ccc-3263262623627" ....> .....</div> < div id="aaa-bbb-ccc-4568458573737" ....> .....</div> < div id="aaa-bbb-ccc-56747" ....> .....</div> < div id="aaa-bbb-ccc-8679865998080600" ....> .....</div> How can I reference all elements in ONE jQuery statement? Actually I need something like a wildcard to write $('div[id="aaa-bbb-ccc-*"]') But this does not work. How do I have to re-write it? It would be even better to have something more advanced,
$(this).find('option:selected').css("color") doesn‘t work in firefox 49.0.2
when i use $(this).find('option:selected').css("color") to get the color of the selected option, it give me "rgb(255,255,255)" , not my real color. But when i try in on chrome , it works well.
How to Change textbox on combobox selection while adding table rows
I have a table that adds rows dynamically it has a selection box that changes the value of a textbox when the onchange function is fired but the problem is that it resets all the textboxes instead of that particular empty one. Please see the fiddle below thanks https://jsfiddle.net/josephat/xd7zknyc/3/
How do you target the select box for the table below and fire an onchange function...Thanks
<div class="container"> <div class="row"> <div class="col-xs-12"> <div class="invoice-title"> <h2 id="me">Orders</h2><h3 class="pull-right">Order # 12345</h3> </div> <hr> <div class="row"> <div class="col-xs-6"> <address> <strong>Billed To:</strong><br> <input type="text" value="" placeholder='name' /><br> <input type="text" value="" placeholder='address' /><br> <input type="text" value="" placeholder='street' /><br> <input type="text"
A pure JS question, hope it's ok: How to reset onclick event
The line 13 in the code below attempts to reset an onclick event first to null and then on line 14, attempts to set it to another action, however, it's ineffective and how to do it? Thanks. Line 1: var config = function() { Line 2: // display config / usage info but no dupe display Line 3: if (!document.getElementById('confinfo')) { Line 4: var i = document.createElement('info'); Line 5: i.id = "confinfo"; Line 6: i.style = "color:green"; Line 7: i.innerHTML = conf.usage; Line 8: document.body.insertBefore(i,document.body.firstChild);
Trigger event after clicking on combination of two buttons
So I have a page with multiple buttons and I want something to happen once the user clicks on a specific combination of two buttons (for example, x happens if I click on button 1 and 3, y happens if I click on button 3 and 5). I nested the two click functions and it is not working. What am I doing wrong? Is there a simple and elegant solution? https://jsfiddle.net/pwyz3kbL/ Thank you!
Download Fail
jQuery file download from official download page failed. What should I do? Screenshot of the problem is attached.
fullpage smooth scroll then hide previous
hi @all, i made a fiddle for my problem: https://jsfiddle.net/j0naz5qc/1/ i have more fullpage divs but only one is active at the same time. on page load i show the first one. on click to a button i want to show the second one smooth scroll down to it and then hide the previous one. can somebody help me? best regards
how to wrap $.ajax.then() correctly?
Hi there, I'm new to this forum, hoping someone can help me out understanding promises and deferrals correctly. in a small hobby project i'm using an ajaxwrapper like this: var APIlib = { 'ajaxWrapper' : function (url, params) { return $.ajax({ type: type, url: url, async: false, data: JSON.stringify(params), }); }, }; loading this snippet first, in my following code i can use APIlib.ajaxWrapper("url", data).then(
i am getting byte array stream of pdf from database,so can anyone plz tell me how to convert this stream into pdf and show it on html page
i am getting byte array stream of pdf from database,so can anyone plz tell me how to convert this stream into pdf and show it on html page
values from table to text box
in this line data is like this 23 4 abc .. i combine 3 columns data in 1 column before combine data was value 1=23 value2=4 value3=abc after combine this comes in singlie td 23 4 abc now i try to to get these separated values in label how i do this i got type in text box when i select row now i want to get info values in these 3 texbox .. value1_txt = 23, value2_txt=4 value3_txt=abc <script type="text/javascript"> $(function () { debugger; $('#table1').on('click',
How do you extract data from input box that uses dynamic id -> uid?
I need to pull the data from an input box. The problem is that the id associated with the input box is dynamic.. If you look at the script below you will see the following ->"uid_loanAmount_16597654821991736" . However that number changes each time a visitor to the site. so next time it could be "uid_loanAmount_234568385923" or some other random number. So when I write the script to pull data from this id I can't include the number portion of the id. Does anyone have any suggestion? <input id="uid_loanAmount_16597654821991736"
addClass hasClass problem
Hi all Im using this code. if( $("#personalpoints").hasClass("completeajax")){ console.log("1"); } else{ $("#personalpoints").addClass("completeajax"); console.log( "2")); } Console is printing 2 1 2 Im using it within a ajaxcomplete function. Why is there a second 2, shouldnt it be impossible
Show hide problem on page load
Hello, My form is not hidden on page load but the jquery code works perfectly as soon as I start clicking on the radial buttons. After the page load, the form is visible even if the second radial has been set(via php) to "checked". Do the change() even needs a manual change? Or does it only needs a "value" change? $(document).ready(function(){ $('[name="radios"]').on('change', function() { var radio = $(this).val(); if(radio == "delivery"){ $("#delivery_address").fadeIn();
Append checked checkbox values to another Table
Hello, I have a modal popup that populates the following html shown in the link below. When I select the checkbox(s), it's respective row/column values need to be appended to another table inside div ("ResultTable"). Currently, only one row gets appended. Please assist. <table id="mytable"> <tr> <th>FileName</th> <th>Period</th> <th>Select</th> </tr> <tr> <td>Ginger Ale</td> <td>2015</td> <td><input type="checkbox" name="case[]"/></td> </tr> <tr> <td>Mocha
JQuery select dropdowns by id using AND and OR operators combination
How can i able to perform all the combinations of the dropdowns of the select tag example code as follows <!DOCTYPE html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script> <script> $(document).ready(function(){ if( $("#disaster_1,#genre_id_1,#area_id_1").change("background-color", "yellow");) { alert("threee changed"); } else{ $("#disaster_1,#genre_id_1").css("background-color", "red"); } }); </script> </head> <body> <h1>Welcome to My Web Page</h1>
content type setting
$.ajax({ url:url, contentType:"foo" }) $.ajax({ url:url, headers:{ content-type:"foo" } }) what is the differences between the two code snippets?
display messages from server in my contact form with jQuery Ajax and JSON
hello everyone i habe a problem to display my successes and errors messages in Browsers Firefox and IE. my messages are displaying in a different browser window and not in he set Tags from my html. Here you can see my code: $('#abschicken').click(function() { event.preventDefault(); // get the form data var formData = { 'name' : $('input[name=name]').val(), 'email' : $('input[name=email]').val(), 'tel' : $('input[name=tel]').val(), 'bemerkung' : $('textarea[name=bemerkung]').val() }; // process
Very strange behaviour after regex-test ?
Hi guys, I got a very strange behaviour and I really want to know why it does what it does. This is the page: Please remove the"-" signs and use the correct protocol: yttp://p-r-o-f-o-r-m-a.s-c-i-e-n-c-e-a-n-d-m-o-t-i-o-n.com From line 189 to 193 on this page I simply want to color the content of a <label>-tag in red if the email-field was not correct. works fine in all browsers I tested. // Test if valid email
if(!regex.test($('input[name="email"]').val())) {
flag = false;
emailregex =
Adding span or div tags to checkbox and label
I've created a checkbox list in .net, but as part of a responsive design I need to keep the checkbox and the label on the same line. I thought that this would be a matter of inserting a span or div tag before the checkbox and after the label, and then I could add a nowrap class to keep them on the same line. At first I thought that .before and .after were what I needed, and these work fine if you add some random text, but not with html tags. If I add the span tag before the element, jQuery closes
what's wrong with this jquery?
I have a radio button list with a name of "ReportTypeId". For each radiobutton I want to display an alert with its value when it's clicked. I wrote the following jQuery which gets all 5 radio buttons the list with a name of "ReportTypeId": $("[name='ReportTypeId']").toArray().forEach(function(reportTypeId){ reportTypeId.click(function(reportTypeId){ alert(reportTypeId.value);}); }); When I set a breakpoint and examine tthe variables at load time the variables look as expected. However, when I click
Problem Jquery and .one function since firefox update
Hi there, i've found a bug that only occurs in newest Firefox or Chrome. In older Versions it works, in Internet Explorer 11 it works too. I have 2 Layers: "maincontent" and "subcontent". The "maincontent" layer shows a Link to hide "maincontent" and show "subcontent". In "subcontent" is a link to hide "subcontent" and show "maincontent" again. Simple. When i klick the link in "maincontent" i have a small fadeout effect with animate.css: maincontent fades out, wait for animation ends, after animation
js.foundation
Surprised there has been no announcement either in these forums or on the jQuery blog about this... Apparently, jQuery Foundation has morphed into (or been absorbed into newly-created... or something like that...) js.foundation. (I learned about the "apparent" equivalence only from a news article - you'd be hard-pressed to glean that from the official js.foundation website.) js.foundation has a broader vision, encompassing a good number of Javascript projects, which do include jQuery, jQuery Mobile,
how to store and use value of variable in jquery
Hi, following is a working code for displaying the value in 2 div's disp and bus. $.ajax({
type: "POST",
// url: "Busbooking.aspx/ConductorTable",
url: "Busdetails.aspx/BindData1",
data: "{}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (msg) {
var s = msg.d;
var k = s.split("--");
$('#disp').html(k[0]);
filter1();
$('#bus').html(k[1]);
Button not starting ajax call
Hello, My button, when clicked is not start the ajax call, I cannot work out why. This is my button: <button class='btn btn-default pull-right cart-delete' onClick='event.stopPropagation();' id='$product_id'>X</button> The reason I added onClick='event.stopPropagation();' is because my button is in a bootstrap dropdown toggle and I need to keep the dropdown "down" even after the click in the cart. And this is my jquery code: dataType: 'json', <script> $(document).ready(function(){ $(".cart-delete").click(function(){
Contact Form is not sending all info
Contact Form info is not sending from my PHP/jQuery contact form, only name: email: Here's the code: <form id="ajax-contact" method="post"> <table class="table10"> <tr> <td> <label for="name">Your Name:</label> <input id="contact-name" type="text" name="name" required> </td> </tr> </tr> <tr> <td> <label for="email">Your Email Address:</label> <input id="contact-email" type="email" name="email" required> </td> </tr> <tr> <td> <label for="message">Message:</label> <textarea id="contact-message" type="text"
Next Page