CORS request is not sending cookies
Hello, I have posted this question to different forums but didn't get a single answer. So, will try here. I use blueimp/jQuery-File-Upload script for cross domain (subdomain) uploads. The main page is www.example.com and I upload files to st2.example.com. Everything works fine but the problem is that I need to send cookies with each request and for some reason it's not possible. Cookies are being sent only with HEAD requests. The documentation of this script says: If you need to send along cookies
Spinner Doesn't Work While AJAX Does Its Job
I'm trying to get a spinner to show up while my form does submitting data. So far, my AJAX works absolutely fine and does its job; but the spinner just won't show up! Here's my JavaScript (properly queued inside WordPress) - -- jQuery(document).ready(function($){ //'use strict'; $("form").submit(function() { event.preventDefault(); $(".myspinner").css('display', 'inline-block'); var wpajaxurl = document.location.protocol + '//' + document.location.host + '/wp-admin/admin-ajax.php'; var form = $(this);
why submit on second page load not working
Hi, here: https://www.mybluefile.com/forgot_password.php when I first load the page it works and submit goes via jquery but when I go back to the main page index.php and then click on forgot password the submit doesn't work via ajax and it just do: https://www.mybluefile.com/forgot_password.php?txtUserID=731004167&btnForgotPassword=Reset+your+Password why is that? Thanks, Jassim
how to “undo” jQuery toggle callback?
Here's the demo... http://brinsterinc.com/ovnproj/app/gestation.html Click the purple stack and the menu area shows, and there's a callback to fade in the menu items. When the menu hides via the toggle, I'd like the steps to reverse. That is, the menu items to fade away before the menu area hides. Do I have to code it without the toggle? BTW, trying to avoid needing jQuery UI. Here's the code... $('div.bars').click(function(){ $(this).next().toggle("slow", function(){ $("div.ovnMenu ul").fadeTo("slow",
How to clear a function?
I'm using a basic slideshow plugin but my problem is need to have a multiple slideshow. This is the sample code: $('a.lightbox').bind('click', function(){ var aIDL = $(this).attr('href'); $(aIDL + ' ' +'.detail_list').bjqs({ animtype : 'slide', width : 458, automatic : false }); }); every time i click a a tag it will execute the function. the problem is if the user need to click multiple times. so i want to clear the function after the user click a close tag.
Learn suggestion: Select by ID with escaped characters
Hi! The page How do I select an element by an ID that has characters used in CSS notation? could also mention a simple solution that is also faster: // Does not work: $( "#some:id" ) // solution with no string replacement: $( document.getElementById("some:id"))
select specific options in forEach
Hi, guys! Could you please help me to resolve one task. I get some JSON response from backend side, it's array, now I trying to use cycle forEach for displaing each iterable on html page. It looks like: jQuery.each(data, function (key, value) { $(' + '<div>' + "'+ value.title + '" + '</div>' + '<div>' + "'+ value.price + '" + '</div>' + '<select class="hours f-left">' + '<option value="1">1 hour</option>' + '<option value="2">2 hour</option>'
"use strict" causes the error $this is undefined
Hi, The code bellow works without "use strict" but when I add "use strict" to it, it shows an error saying "Uncaught TypeError". (function ($) { "use strict"; $('.field-widget-file-generic').each(function () { $this = $(this); if(!$this.find('.table-striped').length && $this.find('.file-widget span.file').length) { $this.find('.file-widget span.file').closest('.file-widget').addClass('only-one-file'); } }); })(jQuery); I need to use "use strict" but
checkbox to disable and enable textbox
hello everyone, i have 2 checkbox(Yes/No) that act like a radio button. If the Yes checkbox is checked i want to enable a textbox and if the No checkbox is checked it will disable a textbox, using jquery
Creating a chat feature with JQuery?
I need to make a chat feature in my website and would like to know how to do it using only HTML, CSS, JS/JQ, SQL and PHP. How would it work? Would the server contact the user when a new message has been posted, or would the user have to constantly make requests to the server to check if it has been updated? What's the best way to do this kind of thing, and keeping in mind to not overload the server in case there are many separate chat rooms, each with many users. At the moment I am thinking to use
datepicker dynamic
Dear members, I am unable to add jquery datepicker to a dynamically created textbox. the datepicker is working fine on the first row, which is present on the first load of the page. here is the code. script to dynamic adding rows with fields. <%-- Document Add --%> <script type="text/javascript"> // $(document).ready(function () $(document).ready(function () { $(document).on("click", ".classAddDoc", function () { var templateRow
Submit a form by clicking on an option
Hello, I'm working on a Django app and I'm not very used with jQuery. I want to retrieve some questions and answers for a quiz and I use a form to answer. It's multiple choice. I have added on the list an event (like <li onclick="game.submit()") which is nearly what I want to achieve. I use radio select buttons so when I select an option it automatically sends the form and retrieves the next question. What I want is to eliminate that radio button select and let the user choose his answer just by
Global variable very basic
Hello everyone, I have a very basic question with global variable and Jquery. Here i is a counter. I want to know its last value and keep it out of the function <div class="aremplir"> </div> <button type="button" id="ajouter">Ajouter</button> <script type="text/javascript"> jQuery(function($){ var i = 0; $('#ajouter').click(function(e){ e.preventDefault(); var content = "<div id='input_name"+i+"'><input type='text' /></div>"; i++; $('.aremplir').append(content);
Get a value from database after onChange event of Dropdown with JQuery
Hello , Iam trying to find a solution for dropdown selected item, {{ Form::select('idShow',array('0' => 'Select one option') + $shows, $event->idShow, array('class' => 'form-control', 'id' => 'idShow')) }}. After i slect an item I want to gat from databse two other filed that have the id of selected item with onChange event in Jquery.Can you tell me please if have manner to do it ?
How to BLOCK several asynchronous gets
Hello, I've tried a couple different ways, and the best case that I had was a series of nested $.get(...).then(...) callbacks. This works, to a point, but leaves me with a JavaScript stack overflow on the client side, best guess; the ASP.NET server side is "happy", at any rate, but this is useless unless the client side can digest the results without stack overflow. I need to know how to BLOCK each $.when(), or $.get(), might be better, or if I can simply block and wait for the done handler to be
Could Jquery affect my captcha?
Has there been a new update to jQuery v1.6.4. I have a contact form that my captcha has stopped working. I check the server and they say it was in my html. Anyone knows about this. Thanks!
If input has that class, add a class to it's label
Hi guys, Could you please explain me why this code is not working: If input hasClass, add a class to it's label Thanks
Changing focus in an A-Z index
Hi, I'm working on this A-Z example with scrolling: A-Z index with Scrolling function It works fine. Now I just need to achieve that each time I click on one of the alphabets, the focus changes to the targeted h1 alphabet. To achieve this I added the following two lines to the code: target.addClass('focus'); target.focus(); But it still doesn't change the focus to the targeted alphabet. How can I change the focus after each click? Thanks
Hyperlink Problem
Hi, I am new with jQuery. Currently I am trying to integrate jQuery with PHP and MySQL (using XAMPP) and the code is: <?php include "latihan36_1.php"; $q = "select * from mhs"; $ex = mysql_query($q); echo "<a href='#' id='tambah-mhs'>Tambah MHS</a>"; echo "<table border=1>"; echo "<tr> <th>NPM</th><th>Nama</th><th>Alamat</th> <th>No Telp</th><th>Action</th></tr>"; while($r = mysql_fetch_array($ex)){ echo "<tr><td>".$r['npm']."</td>"; echo "<td>".$r['nama']."</td>"; echo "<td>".$r['alamat']."</td>";
New to jQuery... does this function look well-written?
I have a menu that I want to slide toggle in from the left to the right. I would also like to hide the menu when I click off the the menu or when I click the esc key, but I want it to slide back to the left. Here is what I wrote... It seems to work fine, but i'd like to know if it just works or if its actually well-written. //Toggle functionality for menu $(function(){ var effect = 'slide'; var options = { direction: 'left'}; var duration = 500; //Slide toggle menu $('#m').click(function
Alert is not showing
I have this code: <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> <script src="/js/jquery-ui.min.js"></script> <div class="row col-lg-5"> <h2>Get Request</h2> <button type="button" class="btn btn-warning" id="getRequest">getRequest</button> <br><br> <script type="text/javascript"> $(document).ready(function(){ $('#getRequest').click(function(){ alert($(this).text()); }); }); </script> </div> The alert is not showing when I click the button. The jquery.js
Iterate Table Rows and Color
Hi all, i have the requirement wher i have a table as attached image i need to iterate all the columns that starts with 'Pass_' (in the image Pass_Balance, Pass_Currency) and if the values of those columns is zero i need to colour the previous 2 columns(in the image SCD Balance and Calypso Balance ) For Ex: I need to color all the SCD Balance and Calypso Balance Columns except the 5th Column where the Value of Pass_Balance is one) Please help !!!
why showErroes fired when all already filled?
Hi, In https://www.cakeboutiquebh.com/enter.php?signup=true Enter any data in all fields but for the email enter jrahma@yahoo.com it should give you a message that the email already exists but it's giving all fields are required error although you have already entered all field. Why? Thanks, Jassim
Open jQuery Accordion with link
Hi there, I have inserted this jQuery accordion on my website: //accordion jQuery(document).ready(function() { function close_accordion_section() { jQuery('.accordion .accordion-section-title').removeClass('active'); jQuery('.accordion .accordion-section-content').slideUp(300).removeClass('open'); } jQuery('.accordion-section-title').click(function(e) { // Grab current anchor value var currentAttrValue = jQuery(this).attr('href'); if(jQuery(e.target).is('.active'))
jQuery onclick event is not binding to new DOM element
I am integrating jdPicker (http://jdpicker.paulds.fr/?p=demo) which is anjQuery Date picker into my jsp as follows: Supplier.jsp <html> <script type="text/javascript"> $('#calenderOpener').jdPicker({ date_format:"dd/mm/YYYY", select_week:1, show_week:1, date_min:"19/05/2010", date_max:"21/12/2050" }); </script> ..... <td><input type="text"
Textarea Character limit function
Hi, I found this solution for limiting characters inside a textarea for IE 10 and bellow: <input class='textField' type='text' maxlength="40" value='' onkeyup='charLimit(this, 40);'> And following JavaScript function for IE 10 and bellow, which don't support maxlength="40" function charLimit(limitField, limitNum) { if (limitField.value.length > limitNum) { limitField.value = limitField.value.substring(0, limitNum);} } It works. However I wonder why it uses onkeyup='charLimit(this, 40);' inside the
Detect Final Page Render
How do i detect when my website is totaly rendered, all the contents, fonts and images and every thing i want to detect the event when the browsers loading icon at page title bar stops rotating !
Only the JSON_ENCODE works for a variable from PHP to javascript
In the following, why echo 123 DOES NOT WORK? <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <script src="https://code.jquery.com/jquery-1.11.2.js"></script> <script type="text/javascript"> $(document).ready(function () { var jsvar = <?php echo json_encode(123); ?>; <---- //WORKS!!! var jsvar = <?php echo 123; ?>; // NOTHING HAPPENS!!! alert('ak=='+jsvar); <---- //WORKS!!! console.log(jsvar); // NOTHING HAPPENS!!! });//$document </script> <style>
toggle a switch status icon from an admin page then reflect it to multiple pages
I have created a link with two states, which will be a default status of [verify=false] and secondary status [verified=true], and will be changed from a manager through an admin page. jquery will toggle this status using SVG icons and change its background position through CSS. This link icon selection, will only display statically on multiple pages that this/that user has been verified or not by the manager. It is off [false] by default. The toggling works great, which I am happy with this, but
jquery validation integer only
Hi, I am using jquery validation and I would like to ask how can I make sure only integer number is entered? no dots / decimals? Thanks, Jassim
why required is not fired
Hi, In https://www.cakeboutiquebh.com/enter.php?signup=true Choose Yes for Are you an Existing Customer Then enter anything i Customer ID, leave the Last name blank you'll get a validation error asking you to enter both but when you leave the Customer ID blank and enter the last name it doesn't do the same, it proceeds with show ajax action although both required are set to true Where is my mistake? Thanks, Jassim
If one class exists and the other class doesn't exist
Hi, This code should say that: if one class exists and the other class doesn't exist, do something if( $('.file').length && $('.table-striped') == 0 ) { // Do something } Is there any error in the above code? Thanks
Create an array and explode it with \n
I need to change the var text into an array and explode it with "\n".Please help me <html> <head> <script src="https://code.jquery.com/jquery-1.10.2.js"></script> </head> <body> <form id="web2lead" action=""> <div> <label for="txtName" class="addtocomment">Name </label> <input type="text" id="txtName" class="addtocomment" name="txtName"><br> <label for="txtEmail" class="addtocomment" id="txtEmail">E-mail </label> <input type="text" id="txtEmail" class="addtocomment" name="txtEmail"><br> <label for="txtAddress"
trigger the mouse cursor automatically every 5 minutes
Hi , How to trigger the mouse cursor automatically every 5 minutes ? Because my windows display screen is locked out after 30 minutes if we are not touching PC. I want to keep the windows to display active till shut down. Please let me know if there is any other way to keep the windows screen active.
Slider with another slider isnide
Hi there Can anyone help me with this? How can I add slider inside slider. I whant normal big slider and in the bottom of this slider I whant creat brand carousel. Is there any library for it? Or simply I creat two separate sliders and using css I add position to this first one?
So simple $_GET doesn't work
[GMAIL] I sent an email by Gmail and read the link as show in the following: [GMAIL INBOX] http://localhost:8080/king/index.php?keys=39jf39jf3j3jf39j ============ king/index.php $(document).ready(function(){ alert('try') <?php $keys = $_GET['keys']; echo $keys; ?>
Disable Radio Button and textbox on Form Load
I have a form and want to disable some fields when form loads. So if Radio button was checked before the form was closed by a user, then disable those that Radio button when the same user reload the form. A save button attached to the form must also be disabled. When the user make changes by clicking on another radio button, then enable save button for submission . Any help will be appreciated
Jquery validation check for input id based on label reference
Hi , I am new to jquery and would like to know how do we check whether the input field has got an id or not..also whether the label reference is matching the input id?Please help me to do it. Right now the input id and the corresponding label reference are passed to the hidden value without any validation check <html> <head> <script src="https://code.jquery.com/jquery-1.10.2.js"></script> </head> <body> <form id="web2lead" action=""> <div> <label for="txtName" class="addtocomment">Name </label> <input
Unable to keep hide() or show() on page load
Hello, I am having a bit of a problem,I have 1 dropdown menu which has data coming from PHP. When there is a selection on that dropdown menu, it should either activate the show() or hide() function for the other inputs or dropdown menu below it. It works great at the moment but if I reload the page and the dropdown is already set to the required selection, the jquery script is not hiding or showing the other blocks. How to get jquery to act on page load please? Here is my code: <script>
Jquery animate help!
Hi! I'm really new in this amazing jquery (I'm graphic designer) and I really need HELP! with this: I'm trying to use a simple left - right scroll with a simple buttons left-right to move a wide image( in this sample my image have width: 5599px height: 440px) inside a bootstrap model so far after days and days of searching I do the script above, now I'm felling I'll lose my last hair trying this working so, this are the facts: 1- My scroll bar was made with css because (I don't know why the standard
Next Page