Why is this ajax call failing?
I'm hitting the "error" part of this ajax call, seeing "'error in btnTestProduceUsageSettings'": $("#btnTestProduceUsageSettings").click(function () { var dom = $('#dayofmonthselect').val(); var ord = $('#ordinalselect').val(); var dow = $('#dayofweekselect').val(); var wom = $('#weekormonthselect').val(); var daterangefromval = $('#produsagefrom').val(); var daterangetoval = $('#produsageto').val(); var unitval
Advice on Loading third party plugins
Hi, i'm looking to improve the way i use jquery and third party scripts. At the moment my site structure has all the JS at the bottom of the page including the jquery library. After jquery i have a couple of other scripts e.g below. jQuery Moment.js (for date time picker) Basecore.js (minified version of a bunch third part scripts i.e bootstrap, lightbox and slider plugin) core.js (third party plugin functions wrapped in document.ready and any other custom jquery) Whats the best way to call the functions
get SRC attribute from image tag that is coming from database
I'm getting a string back from the database that is: var x = ImageValue; the ImageValue= <img alt="" src="/newImage.gif" style="border: 1px solid;"/> //this is what is coming from the database how can I split [ImageValue] to only get the src tag, so I get it as: src="/newImage.gig" that's the only section of this string I need
Jtable Cascading dropdown not showing in display
This is the code I am using to generate cascading dropdown works great in edit mode but wont show value of field in list ProjectWorkOrder: { title: 'CWO', width: '5%', dependsOn: 'ProjectID', options: function (data) { if (data.source == 'list') { //Return url of all countries for optimization. //This method is called for each row on the table and jTable caches options based on this url. //alert(data.record.PWOID); return appRoot_Append + '/tlm/GetCWOListAdmin?ProjectID=0';// '/Demo/GetCountryOptions?continentalId=0';
How would I make debounces?
I tried doing var isAnimOn = false function buttonClick() { if (isAnimOn == false && isOption1Clicked == false) { isAnimOn = true anim('#Sub1', 0, computing["0"], function() {}) anim('#Sub2', 250, computing["0"], function() {}) anim('#Sub3', 500, computing["0"], function() { anim('.SubText', 0, {opacity: 1}, function() { isAnimOn = false isOption1Clicked = true }) }) } else if (isAnimOn == false && isOption1Clicked == true) { isAnimOn = true anim('#Sub1', 0, computing["1"], function() {}) anim('#Sub2',
Calendarextender function is not working with jquery clone
Hi All Here my problem is , ajax calendarExtender not working in Jquery clone , in parent class calendar working fine when i clone it that the text box not displaying the calendar Extender i dont know what to do ... pls help me my Javascript code $(function() { $('#Button1').click(function() { var hfAnswers = $('#<%=HFeducationdetails.ClientID %>'); var answers = parseInt(hfAnswers.val()) + 1; alert(answers); hfAnswers.val(answers);
WINDOWS APP jquery encoding error
I have written a windows app and it has failed validation on 1 issue the format of the jquery files I have tried saving them as Unicode (UTF-8 with signature) -codepage 65001 but still get the following errrors any ideas ? <br> File Scripts\jquery-2.1.3.intellisense.js is not properly UTF-8 encoded. Re-save the file as UTF-8 (including Byte Order Mark). File Scripts\jquery-2.1.3.js is not properly UTF-8 encoded. Re-save the file as UTF-8 (including Byte Order Mark). File Scripts\jquery-2.1.3.min.js
getting all attributes and values of an element
Hello. Let's say I have an element such as: <div class='my_firstClass my_secondClass' data='my_data' myCustomAttr='my_custAttr">test</div> I would like to be able to get all of the attributes and their values with an output similar to: [0] class: { my_firstClass, my_secondClass } [1] data: { my_data } [2] myCustomAttr: { my_custAttr } Does anyone know of a way to do this? Thanks!
Why is my prompt not working?
I adapted the following code from here: HTML: <button class="btn" name="btnAddlEmail" id="btnAddlEmail">Add Another Email</button> Javascript: $("#btnAddlEmail").click(function () { var email = prompt('Please enter the email address', 'name@provider.com'); if (email != null) //&& (email != "name@provider.com") { alert(email); } }); ...but it's not working; I thought maybe it was some unrelated problem
When focus is on input, add a class to it's closest label
Hi, Looking at my example here: Find the closest label Could you please help me to find out why this part of the code is not working?: $(this).closest(".text-label").addClass("text-label--floated"); Thanks
Modifying $._data by removing events
I am extending a plugin and have a problem. The initial plugin defines a 'click' event handler like this: $(this.cssSelector.next).click(function(e) { e.preventDefault(); self.next(); self.blur(this); }); I want to provide my own 'click' event handler instead of this one. However, as it doesn't have a namespace I have no way of just removing this handler without affecting the others on that element. My own event click handler gets binded straight after this one in the next
Add additional link using jQuery
Hi there, I have set a link in my WP-website using jquery which gets triggered by the event of "click". The jquery i used looks like this: jQuery(document).ready(function() { jQuery('.cart-outer a').removeAttr('href'); }); jQuery(document).ready(function() { jQuery('#side-cart .close-me2').click(function(){ var rightVal = -500; jQuery('#side-cart').animate({right: rightVal + 'px'}, {queue: false, duration: 500}); jQuery('.cart-outer a').attr("href", "javascript:void(0)"); jQuery('.cart-outer a').click(function(){
Select / autocomplete with Search
Hi, I would like to ask how can I have a select / autocomplete with search similar to the one in below link for Cuisines and Areas? http://www.talabat.com/bh/en/food-delivery Thanks, Jassim
Is anything wrong with this code?
Hi, Is anything wrong with this code:? $("input").each(function() { if ($("input").hasClass("error")) { $(this).parents().find(".text-input-large__wrapper").addClass("text-input-large__wrapper--error"); } }); Thanks
Catch ajax error
I'm loading some data via $.ajax() from an api on a different server. CORS is setup so that I can load data from this API. But, sometimes, the API, written in php, displays some error/warning, which it will output before the http headers is sent. Which again will make the $.ajax()-request fail with the message: "XMLHttpRequest cannot load http://<server>pdf/A5Landscape. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://intra.quercus.palustris.dk' is therefore
How To Make An Element Animate/Move Back and Forth (ON ITS OWN)
I am trying to make a DIV move up and down on the page, by itself. How do I do this? I want it to move as soon as the page loads, without pressing or clicking anything. And I want it to go in a "loop", so it will go back and forth constantly (side to side/up and down).
click trigger not working after ajax load....
i am working on a smarty template where i am using some filter options to filter products using different options. the products are loading via ajax after selecting any option. i want to trigger click event after ajax load the results from another smarty template. but click trigger not working after ajax loads the results. any idea? i am using this code to trigger the click event $("label.labelclass").trigger('click');
toggleClass() not working from text editor, works in web inspector
hey! I'm having a strange problem, I tried to use toggleclass(), when I put it in the editor doesn't work (the rest of the js runs correctly, so I know the file is well linked) but when I try in web inspector it works perfectly any ideas? var main=function(){ $('#lucas').click(function(){ $('#lucas').toggleClass("perfil2"); }); }; $(document).ready(main);
Stop floating scrollbar when reaching to footer
I need to stop floating scrollbar when reaching to footer. I tried the follwing code but no luck. var $sidebar = jQuery(".cartitemsguy"), $window = jQuery(window), offset = $sidebar.offset(), topPadding = 15; var footerwraptop = jQuery('.footer').offset.top; $window.scroll(function() { if ($window.scrollTop() > offset.top) { $sidebar.stop().animate({ marginTop: $window.scrollTop() - offset.top + topPadding }); if (jQuery('.cartitemsguy').offset().top + jQuery(".cartitemsguy").height() > jQuery(".footer").offset().top)
Get stored input data form window.localstorage when browser is closed suddenly ,Few scenario i cant able to get data
Test1 = <input type='text' title='Tags' id='tags' name='test1' /> <br/> Test2 = <input type="text" id="idfield1" name="test2"> <br/> Test3 = <input type="text" id="idfield2" name="test3"> <br/> Test4 = <textarea id="tr" name="test4"></textarea> script : $(document).ready(function() { var aTags = ["ask", "always", "all", "alright", "one", "foo", "blackberry", "tweet", "force9", "westerners", "sport"]; $("#tags").autocomplete({ source: aTags }); }); $('#idfield1').keypress(function() { $('#idfield2').val($(this).val());
copy given elements to another div
let's take this image: <li class="mix shoulders check1 radio1 option1"><img src="images/exercises/shoulders/Single-Arm Linear Jammer.jpg" alt="Image 1"></li> I am getting it by this function: $(function(){ /* elements is a name that preceding the selectors. get all img tags found inside li tags and fire the function. Then bind to the elem-msg div (which is inside the info_box) the elemText value. */ $('.elements li img').click(function(){ $('.body-inactive').show(); $('.info_box').fadeIn(2000);
How can I access a value returned via AJAX in jQuery?
I need to select values from some html select elements based on what is passed back from an AJAX call. The data is being retrieved, but I can't seem to access the data so as to use it to set the html select elements to the appropriate value. This is the html that describes the html selects that need to be manipulated: <div class="row"> <div class="col-md-6"> <div class="containerforproact"> <div> <select id="dayofmonthselect">
Uncaught SyntaxError: Unexpected end of input
Hi, I have just added a datepicker to my order page but started getting this error: Uncaught SyntaxError: Unexpected end of input and when clicking on the datepicker I get this error: jquery.ui.datepicker.js:1970 Uncaught TypeError: Cannot read property 'inline' of undefined Not sure what could be the reason.. here is the link: https://www.cakeboutiquebh.com/before_submission.php Kindly help... Thanks, Jassim
Modify table text
Her is my html I want to refer to the italic text (target-text) and change it(and only that) to something else like "new-text". Is it possible with jQuery? Thx I. Lesher <tr class="odd"> <td>monthly recurring</td> <td> <strong>ILS 50.00</strong> target-text<strong>ILS 50.00 לפי חודש עבור 12 חודשים נוסף</strong>. </td> <td> <a class="pmpro_btn pmpro_btn-select" href="http://triplebit.com/kityopo/membership-account/membership-checkout/?level=5">בחר</a> </td> </tr>
Add text box for each element (image) given
I have multiple <li> items in my code: I want to add to each image (wrapped in <li> tag) a text box that will pop out for each image when I click/tap on it. that partial code is an e.g.: <li class="mix biceps check1 radio1 option1"><img src="images/exercises/biceps/Alternate Hammer Curl.jpg" alt="Image 1"></li> <li class="mix biceps check2 radio2 option2"><img src="images/exercises/biceps/Barbell Curl.jpg" alt="Image 2"></li>This is currently the code for contenteditable div: <div id="test" class="test"
How to send a form without refreshing the page
I make a form in Wordpress Template that makes certain calculation and displays the result in a modal Bootstrap. HTML: //FORM <form method="post" id="myForm"> <span>Name</span><br><input type="text" name="name" id="name" required> <span>Email</span><br> <input type="email" name="email" id="email" required> <span>Altura</span><br> <input type="number" name="altura" id="altura" required> <span>Peso</span><br> <input type="number" name="peso" id="peso"
jQuery only loads after refresh
Hi, I am using WordPress on my site and I have created a custom jquery in order to add the qty input fields again: jQuery(document).ready(function($){ $('.quantity').on('click', '.plus', function(e) { $input = $(this).prev('input.qty'); var val = parseInt($input.val()); $input.val( val+1 ).change(); }); $('.quantity').on('click', '.minus', function(e) { $input = $(this).next('input.qty'); var val = parseInt($input.val()); if (val
How To Move An Element (with arrow keys) Consistently???
I have a DIV set up to move whenever I press an Arrow Key. It moves fine with one push, by holding the arrows is a little messed up. When I hold an Arrow Keys, the DIV moves in one increment THEN it continues to move, as I hold the Arrow Key. How do I get rid of the first increment? I want the DIV to move consistently when I hold an Arrow Key. Here is my JavaScript code: $(document).keydown(function(e){ switch (e.which){ case 37: //left arrow key $(".ball").finish().animate({
Problem get data from select, input-hidden value in Firefox
My code is: <div class="blockTxt"> <input type="hidden" name="item_type" value="<?php echo $r->cat;?>"> <div class="foodName"> <h4 class="item_name"><?php echo $r->name;?></h4> </div> <div class="btnFood"> <select class="quantity-select"> <option selected="selected" value="8">8 </option> <option value="16">16 </option> <option value="24">24 </option> </select> </div> <?php echo $r->cont; ?> </div> <button class="btn" data-id="<?php echo $r->id;?>">
maintain position when positioning is changed
Consider the following <div id="pearent"> <div id="child"></div </div> the pearent has static positioning Is there any easy way to read what the top and left properties of the child would be if it had fixed positioning. answer this question for both a child with absolute and a child with relative positioning.
How can I make this shorter? Maybe as a function?
Hi Guys, Is there any way in which I can shorten this code?: $(document).ready(function(){ $(".radio__label").focusin(function(){ $(this).addClass("focus"); }); $(".radio__label").focusout(function(){ $(this).removeClass("focus"); }); $(".checkbox__label").focusin(function(){ $(this).addClass("focus"); }); $(".checkbox__label").focusout(function(){ $(this).removeClass("focus"); }); $(".checkbox__label--error").focusin(function(){
jquery accordion with radio buttons
Hi, I have an online delivery page and I want in the last page to let user to select the delivery from existing addresses or enter a new address. I though of having a jquery accordion with radio buttons so it will be like this: ( * ) My Work ( * ) My Home ( * ) My Brother House ( * ) Enter a new address so the first three populated from the database and will show the details of the address when the user expand it and the Enter a new address will expand with a textbox to enter the new address. What's
Show photo gallery from database
Hi, I would like to show a photo gallery from a database but I don't want to download all pictures during the page load because there will be hundreds of photo so what;s the best way to do this without having to load all pictures? Thanks, Jassim
event.preventDefault(); still post on production server
I use event.preventDefault(); function to prevent the page default post. The function works on my local developer server, but when I post my code to production server, it still refresh the page. Are there any configuration to set for the server? Your help and information is great appreciated, Regards, Iccsi
sequence of js and css files
Hi, I am always confused how to order the js and css files for jquery and jquery mobile and jquery ui? where to put every file? is there an template to use and to include in every page? Thanks, Jassim
$(...).buttonset is not a function
Hi, Why I am getting this error: ncaught TypeError: $(...).buttonset is not a function here: https://www.cakeboutiquebh.com/before_submission.php Thanks, Jassim
redirect using QueryString
Hi, I have enter.php page for signing in and I am authenticating the user using ajax when done, and if the url enter.php has a paramters redirect like this: enter.php?redirect=http://www.mydomain.com/my.php I want the jquery to redirect to that page.. How can I do that please? Thanks, Jassim
Sharepoint Jquery Conditional dropdown validation
I have a dropdown named "Status" with a "Yes" and "No With Reservation" as options. If the user choose 'Yes", form can be submitted, if "No With Reservation", user must fill out an "Explanation" multiline textbox below the dropdown. I have access to Sharepoint Designer so any help to achieve this is highly appreciated.
One Select list populates itself with different values depending on which array is chosen by another select list
I want to have one select list populated with different values (price) depending on which option was chosen in other select list (sale or rent). The procedure of the code looks ok what the logic refers but it is not working So what I have done is first create the arrays for sale and rent. Then get the jquery and do an change event to pick which selection was made. then a Switch statement that should populate the select list in question, but it is not showing anything. While jquery is a library for
Writing a dynamic code which you don't need to write the same code for each input
Hi, Whit this code I can check if an text-input is empty or not and add an error message and some accessibility attributes to it if it's empty. Accessible validation form Now how can I make it dynamic, so I don't have to repeat the same code (almost the same code) for each input? Thanks
Next Page