How can I check a value for null in jquery without getting an error?
I've got this code: if (returneddata.daterangeparams.TimeUnitsFrom != null) { ...which throws this error (as seen in the Chrome Dev Tools console) when the value is, indeed, null: Index:1031 Uncaught TypeError: Cannot read property 'TimeUnitsFrom' of null So how can I check for null in a way that I can avoid the error? Based on a suggestion here, I even tried this: if (returneddata.daterangeparams.TimeUnitsFrom != null && variable !== undefined) { ...but I still get the same whinging from the guts
jQuery installation
Hi all, I found in Autocomplete in combobox mode, what I need for a piace of code. So I decided to use it. The question are: - Which is the best way to include libraries: online, local? And which files? - I used the combobox by downloading the "View code" part from demos, why it doesn't work with the complete package? I'm sorry but I don't know jQuery, because I do other for job.
No lightboxes work in multiple plugins
Hi, I'm hoping that if someone can't help me I can at least be pointed in the right direction. I have a personal website www.greglumley.com/wp using NextGen Gallery Pro, to create a mosaic on the front page. This works perfectly but when clicking on any image instead of a light box opening the direct link is shown. Pressing the back button suddenly activates the lightbox. I keep on seeing Jquery being mentioned in the console output but I'm not at the level to understand what the actual problem is.
on click function on a special webpage
hi, everyone. I am new in this. I have a doubt regarding anchors and onlick functions. This is the webpage I am working with: http://www.ccttxx.net/testara-ubp/ The images are between <a></a> to active the flipping function when scrolling (I may think that from what I have seen on the code) But now, I need to link each of the years on the bottom menu to the images and I cant do it with a simple anchor. <nav class="menu"> <div class="icon-list"> <a href="#uno"><span>1992</span></a> <a href="#dos"><span>1993</span></a>
increase height of treadmill so as to display complete unit
Dear Sir please http://prajaktasoftware.com/amogh/About-End2End-Financial treadmill works fine however the last div is not completely visible especially the bottom line Please help how do i increase the height by 2-3 pixels my css #mycontainer { max-width:710px; margin:2px auto;} .treadmill { /* main div in which smaller div with class "treadmill-unit" are embeded */ overflow: hidden; background-color:#; padding:0 5px; } .treadmill-unit { /* Smaller div embeded in main (teadmill) div
How to implement filter search result with JSONP result?
I have seen this done in many places and I like to implement this feature in my search result. I have a page that shows all the result of a search term(s). On the same page, there are two tabs (All and Refine) and the by default all the search results will be displayed in the All tab. Once the user clicked on this "Refine" tab, put check marks on a bunch of checkbox (search result's parent) that he's interested in narrowing down his search. He clicked the submit/filter button and the search results
How to retrieve data via JSONP with dynamic IDs?
Here's an example of how the API works from a third party provider. https://app.example.com/api/head/category.json?_authbykey=56a7d8c531231c4058361687&_fields[]=name&id[$in][]=56d0b73131231c210d494e3e&id[$in][]=570fa55491231c001d4aeb98&id[$in][]=570fa55f12331cdf3d804b86&id[$in][]=570fa56d32123ce53f804ab0 I gathered all my IDs into a variable "parentIDs" and below is my code thus far. $.getJSON('https://app.example.com/api/head/suggest.jsonp?', { _authbykey: "56a7d8c531231c4058361687",
Get group of radio button selected value
Dear All, I am having bunch of questions and each question is having options and need to get the value of selected radio button by using jquery. And the below written javascript is working fine in chrome ,But I see no luck in IE browser Can any one help me how can I achieve it using jquery <form id="q1"> <fieldset> <legend>Course Content:</legend> <label>How is training</label><br /> <label> <input type="radio" name="test1" value="Excellent">Excellent</label><br
closest returns undefined
<input type="text" name="statuteCode" value="" id="txt_search_statuteCode" maxlength="40" size="14" /> <input type='button' id='btnSearchCode' value='' class='button-search' /> var ele = $(this).closest("input[type='text']").prop('id'); // returns undefined, I would expect it to return txt_search_statuteCode while inside the event handler for btnSearchCode Does anyone know what the problem is here? It does find an object, but I don't know what object I fixed it like this: $(this).siblings('input:first').prop('id');
Why the table is misplaced when refreshing the easyUI datagrid?
This phenomenon is as follows: as you see now,the table's head and body are not accorded and go to the left one side.why? thanks! ps:the normal phenomenon as follows:
How to avoid auto selection in datepicker
I implement functionality with datepicker and dialog you can click datepicker's title then dialog title. As a result you can go any month or year with few clicks. But when i select month it will show the current date in input box. I want to avoid that. Any suggestion here? Thanks, regards http://jsfiddle.net/x1j739pt/19/
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
lookup search
First, I don't know anything about jQuery but I'm looking for a solution to my problem and it sounds like jQuery might be the tool to fix it. I manage the content for a school website and at the beginning of each semester our student schedules change and on the first day we need a way to inform them of where to report for first period. I can get this information for each student in any format (text file, spreadsheet, etc) from our student information software, but I need a way to have the students
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';
Problem with select menu in Android with Chrome version 50
I have updated my Chrome browser to last version and I have the following problem: When I select an option of a select menu it does not appear selected, I repeat the process of the selection and then it is selected OK. If I try to select other option it happens the same, first time bad, second time OK. It is happening since I have update to version 50 of Chrome, with previous version 49 it worked OK. I am using a Huawei Y5 with Android 5.1.1, it happens the same with a Nexus with Android 6. The
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);
I need to create an accordion similar to the table. I need to have the tabler headers in the accordion link and rows are seen after expanding the accordion. could some one help ?
Hi All, Could some one help me to know how I can create an accordion similar to table header and rows?
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
Autocomplete Json Array
Hi Experts, I am having issue parsing a List of objects at the client side. My servlet sends a List through JSONArray. Servlet: AjaxRequest.java protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // TODO Auto-generated method stub PrintWriter out=response.getWriter(); response.setContentType("application/json"); response.setHeader("Cache-control","no-cache, no-store"); response.setHeader("Pragma", "no-cache"); response.setHeader("Expires",
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
How to test if an array is defined, empty, or null?
I am retrieving JSON data via API from third party services. Below is my code: $.each(data.data, function(i, article) { var txtSum = article.summary.toString(); var txtTitle = article.name; var re = new RegExp('\\b(' + searchValue + ')\\b', 'gi'); txtSum = txtSum.replace(re, '<span>$1</span>'); txtTitle = txtTitle.replace(re, '<span>$1</span>'); output += '<h6>'; output += '<a href="../kb/article/'+ article.url_hash + '">' + txtTitle
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
in select menu tab key is not working
Hi, In select menu,after selecting any value, focus out and tab key not working please help me. Regards, Guruprasad N
jquery-mobile slide overlay menu
Hi, I am using jquery-mobile slide overlay menu in my application(hybrid mobile application).To make this menu global.i kept a separate menu html as menu.html and i am loading it as $("header).load("menu.html"). The issue is During loading in each page where it is loading Ui is being broken down and after it gets loaded It's coming fine.But issue is during loading time. please suggest me is there any alternative way to make this menu as global.I am using only html,css,js.
Jquery UI slider with textbox input
down votefavorite I am trying to change value of UI slider from textbox's value but the slider method seems to do nothing on the textbox's change event i.e it doesn't move. What am I doing wrong? Check the Fiddle
Sortable stealing from Droppable?
I'm creating a system where users can reorder a list of their sites, but also throw them into a "bin" if they don't want it on the main list. These are just two sortables, it works fine, saves and loads from database, the works. However, I want to have the bin be shrinkable. No problem, the bin toggles open and closed with a click. But while the bin is closed, I can't drop stuff onto that list, because the list is hidden. No problem, I'll just make the bin label a drop target, and anything dropped
jQuery UI Datepicker 2 dates in the same week
Hey Guys, i hope u can help me... i need two date inputs with datepicker and the second must be after the first date choosen... thats no problem with my code... but i've need a second rule: after first choose the second date must be max the sunday in the same week than the first date. thats my code now for the first rule: $(function() { var dates = $("#holiday_from, #holiday_to").datepicker({ prevText: '<zurück', prevStatus: '', prevJumpText: '<<', prevJumpStatus: '',
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
using js with less elements
Hi, as i seen this page, i wanted to ask for help, today i've wanted to write a "randomize text code without the javascript display in the elements but i couldn't do it can someone tell me what i did wrong and correct me it? also this is an example i want to be same as this. https://api.rtainc.co/twitch/8ball and this is my code <html> <shadow><script type="text/javascript"> var textarray = [ "Hi, $(user)", "Welcome, $(user)", "how r u $(user)", "HYD $(user)" ]; function RndText() { var rannum=
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).
Divide content div/section by height and pagination it
Hello, I need help from experts with plugin jQuery. I found this plugin: oryginal plugin But this only work with text and not split/divide content < -from div (like img,h1 etc.) to more divs. It's only hide text below declarated height. I tried change this plugin but i can't I need to advice. Best regards
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');
Next Page