How to periodically check if I have a link on the html page or not?
I have a DIV in my html page. and within the DIV I have a link that shows up when I am online. Any way to hide and show the DIV depending on if anyone is online or not? like only show DIV when online link is active? How can I periodically poll using an AJAX call or Jquery every n minutes or seconds to check if someone was online and update the CSS class accordingly based on if the function returned true or not and make DIV visible accordingly?
How to make infinite scroll smoother
I have a timeline on my application that will load more items via AJAX as you scroll closer to the bottom, it works great, I just think that the scrolling is a little jerky, it seems to jump around when it loads the item. The scroll will jump to the half of the scroll bar then back down to the bottom. Does anyone have any idea how to make that a bit smoother? Code: var scroll_threshold = 25; var total_items = 123; var loading = false; var $items_loading = $('#loading-items'); var $timeline_id =
select Option based on value
Hi, I would like to select the value of select option dynamically using jquery. I am calling service to get country name, based on country name, i need to set that country as selected. I will get country in full name from service( like "Canada") and not in two letters. <select> <option value="US" text="United states" /> <option value="CA" text="Canada"/> <option value="Mx" text="Mexico" /> </select> Could anyone help me on this?
Dynamic id/class values
Hello, How can I copy the classes of the first list (#first-list) and add them to list items of another list (second list) dynamicaly? Any idea? <ul id="first-list"> <li class="item-1">item 1</li> <li class="item-2">item 2</li> <li class="item-3">item 3</li> </ul> <ul id="second-list"> <li>item 1</li> <li>item 2</li> <li>item 3</li> </ul> Thanks in advance Dimitris
using .html() with .text()
To solve a problem with double quotes breaking my code in a text area, I found a solution online to convert the double quote character to an html entity (") before storing it in the database. The solution then instructed to use $(#comments).html(data.comments).text() to display the text and have the " display as a double quote. This all works. My actual question is what is the .text() doing at the end of the statement, or is it not needed? Thanks
unable to clone a row and dynamically change the second select value when changing the first select
I have dynamically added new row by cloning the last row. The row contains two select picker control. I made another function that dynamically change the value of the second select when changing the first select. This function is not working on the cloned rows. Any idea what I made wrong?? <html> <head> <script type="text/javascript" src="./include/jquery/jquery-1.11.3.min.js"></script> <script type="text/javascript"> $(document).ready(function () { $('#btnDel').attr('disabled', 'disabled');
Having issues with prependTo()
I have a timeline on my website, and it gets live updates via AJAX calls, and it prepends any new timeline items to the top of the list. Error in console: Error: Uncaught TypeError: Failed to execute 'getComputedStyle' on 'Window': parameter 1 is not of type 'Element'. Heres the exact JS code for the timeline: // Timestamp of latest item var first_timestamp = $timeline_class.find('li').eq(0).data('timestamp'); var $timeline_class = $('#timeline'); var scroll_at_top = '30'; var asset_id = [12,34,56];
Force jQuery to work when website is minimized using mobile
Can I asked for idea to make jquery work when a website is minimized and locked using mobile? I'm working on a website dealing with countdown timer. The time can be extended depends on the trigger I created. The problem is that the timer is not synch if the website is minimized or locked using a mobile and the time was extended.
Any way to load all the jquery in the html page after 5 seconds?
Question 1: I have a lot of different <scripts> in my html page like this: <script> my jquery code </script> 'Is there any way that the jquery kicks in after 5 seconds? if yes, how can I do that in jquery code? Question 2: I have also <DIV> in my html page - Is there any way that I can load the <DIV> content after 5 seconds?
Is there any way to check if DIV span have text?
I have DIV and span like this: <div id="mydiv" class="classdiv> <span>some text here<span> </div> 1) Is there any way to check if there is any text in the span? (fyi....the span does not have any id or class) 2) Is there any way to add this check and check constantly via jquery like every 2 or 3 seconds?
How to block I.P addresses from visiting webpage via Jquery?
How to block I.P addresses from visiting webpage via Jquery? I want a list of I.P addresses to block from visiting one of my website (not complete website). Is there any Jquery / Javascript that I can use in the web page and redirect blocked visitors to homepage?
understading complex animate function .
was just going through the source of Jbox and saw the following lines of code: this.wrapper.stop().animate({opacity: 0}, { queue: false, duration: this.options.fade, start: function() { this.isClosing = true; }.bind(this), complete: function() { this.wrapper.css({display: 'none'}); this.options.onCloseComplete && (this.options.onCloseComplete.bind(this))(); this.options._onCloseComplete && (this.options._onCloseComplete.bind(this))(); }.bind(this), always: function() { this.isClosing = false; }.bind(this)
Send key/text to element selected by class
Hi Guys, im trying to make a jquery for send a text and the 'enter' or 'return' key. I tried this: setInterval(function () {$(".kdview kdscrollview").trigger(jQuery.Event('keypress', {which: 13}));}, 5000); with no success every 5seconds the element not get the key 'enter'. Im using this with GreaseMonkey (firefox addon). Thanks for help.
Sourcecode working in your Local computer?
http://stackoverflow.com/questions/31723242/set-div-elememt-same-height-as-parent Based on this sourcecode above this text, I tried using it in my computer and the source code doesn't work in my local computer. Question: Does this sorucecode work in your local computer? Thanks!
load a new page without rer]freshing the page
please is there any way I can use jquery go to another page without refreshing the page
Alert on Doubletap
Hi I am new to jquery.I got task from my senior is that i have to do alert from ipad using jquery or javascript when i doubletap a div in ipad.Please suggest me some solutions. <div style="padding:50px;"> <a href="#">doubletap me in ipad</a> </div>
How can I move each instance of sidebar below the main content for each div?
jQuery(".two-col-callout .col-md-3").detach().appendTo('.two-col-callout .textwidget'); The above code unfortunately appends .col-md-3 to all instances of .textwidget on the page. I think I need to use jQuery(this) to target that single div. The url is http://vacaville.wpengine.com/admissions/ if anyone would mind helping a brother out. Thanks in advance!
Element Class with no CSS
I'd like to be able to select a specific group of elements. Is there any performance or other issue with specifying a class name for each element if there is no CSS defined for the class? For example, if I have the following: <div id="part1" class="myGroup">other stuff</div> <div id="part2" class="myGroup">other stuff</div> $(".myGroup").something... If I have no CSS class called .myGroup, would there be any problem with that? Tony
Resemble.js
I need to compare two images created at runtime using Resemble.js, but am unable to do so,.... Need Help!!!
Why does triggering event result in endless loop?
This test page illustrates a behavior that I did not expect. When an object triggers an event from a function that is a member of the object, and the event name is the same as the function name, then not only is the handler function called, but the function that triggered the event is called repeatedly. If the event name and function name differ then this does not occur. Am I doing something wrong or is this in fact intended behavior for some reason? Here is a sample to demonstrate: <!DOCTYPE html>
Detect check boxes state in multi select dropdown
I have a 'select' (dropdown) control with multiselect='multiselect' which shows checkboxes next to each item in the dropdown (code below). As you may notice, the first item is 'Select all', used to check/uncheck all other checkboxes. <select id="test" multiple="multiple"> <option value="-1">Select all</option> <option value="1">BMW</option> <option value="2">Lexus</option> I am trying to detect the checked event but it doesn't work, not sure what i am missing. Please suggest $("#test").change(function(){
How can I disable a button using jQuery?
This code is working pretty well: $(document).on("change", '[id$=boxGrandTotal]', function () { var savebutton = document.getElementById('[id$=btnSave]'); var payment = $('[id$=boxPaymentAmount]').val() != '' ? parseFloat($('[id$=boxPaymentAmount]').val()) : 0; var total = $('[id$=boxGrandTotal]').val() != '' ? parseFloat($('[id$=boxGrandTotal]').val()) : 0; if (payment == null) payment = 0; if (total == null) total = 0; if (payment == total) { alert('Total and Payment
Need Help - styling of AJAX created table not persisting
Hi guys, I'm new to JQuery and am having trouble with some css styling that I have applied to a table created via an AJAX request. I have a div off screen which scrolls into view when the appropriate link is selected. This div contains a table which is populated via an AJAX request to the database. The success function of the AJAX request contains some styling which is applied when the call is made. The table is simply a list of football teams. Once the list is in view you can select one of the
Datatype of jQuery Ajax Post
The file is successfully parsed without dataType: "JSON". With dataType: "JSON". , it does NOT work!!! WHY????? [getfromPHP.php] $(document).ready(function () { var data_json = {jenre:'jenres', querynum:'q_num'}; $.ajax({ type: "POST", url: "json_encode.php", data: data_json, //dataType: "JSON", success: function(result){ alert(data.fruits[0]); // apple }//success
Long form: scrolling to a missing checkbox/radio button?
I'm very new to js but am quite familiar with sql, html, php. I have a form that's quite lengthy. I would like the form to validate in such a way that then user is automatically scrolled to a question with a missing response (and perhaps the box is highlighted with an error message). I've seen a number of people doing this with textboxes, but haven't been able to find a neat way of doing things with radios/checkboxes.
Discover !important attribute in a ruleset
Need to know whether or not a dom element has a rule set with important priority. Example: a div with a class of class1: I need to dicover the important attributes for both cases. .class1 { width: 50px !important; padding-left: 10px !important; } Thx I. Sher
I have no idea what I'm doing, but I've almost made a nice multi-level horizontal menu.
fter using pre-rolled scripts and simple jQuery commands for several years, I decided to design and build a custom jQuery powered navigation bar. I'm quite sure my attempt could be improved upon considerably, but as far as I can tell, my humble attempt almost works. Here's a Fiddle of my creation so far: https://jsfiddle.net/8boqt6n9/ Opening the hamburger menu works as intended, exposing the main navigation Clicking the second or third menu item works as intended (exposing the sub-navigation) Closing
Cookies auto-incremented cookiesID
Hi, I am storing cookies data using Jquery in asp.net Code. My requirement is to increment the Cookie Id by 1 As I store another cookies. So that I can use this next cookies to find out the record on this behalf. E.g. <script> function SetEhsCookies(serviceID,cityID,vendorID) { var cookieValue ="" + serviceID + "," + cityID + "," + vendorID + ""; $.cookie(' ehsCookie0001 ', cookieValue, { expires:7, path: '/' }); alert(cookieValue);
Having Issue on Validating Sub Validation (Nested If)
Can you please take a look at This Demo and let me know why I am not able to validate the query properly? As you can see I have 3 groups of selections and in the top level of validation I am able to validate the `isValidQuery` but int the `Selection Group #3 ` where user has options to select `Not Sure ` or `Luxury ` or `Economics ` WHERE the the `#selected-luxury-Items ` must be validate if the `Luxury ` been selected or `#selected-econo-Items ` must be validate if the `Economics ` has been selected
Why is my change handler never being fired?
I've got this jQuery: /* Whenever boxGrandTotal changes (which it does when any amount is entered in any of the "amount" input text elements), disable the save button if there is a discrepancy between the totals */ $(document).on("change", '[id$=boxGrandTotal]', function () { //var savebutton = $("[id$=btnSave]"); alert('entered the change handler for boxGrandTotal'); var savebutton = document.getElementById('[id$=btnSave]'); var payment = parseFloat(document.getElementById('[id$=boxPaymentAmount]').value).toFixed(2);
having a problem with ajax content load event
Hello i am having trouble with a load event, this is my first attempt at jquery so please bare with me, so the purpose of this code is to load content into a div with the id of "documentation_content" div the html for this div resides in a folder called content, when the link "Filey 1" is clicked it is supposed to load the html stored inside the content folder into the div with the id of "documentation_content" instead it takes you to this rl http://mickabooh.com/document-libray/contact/about.html
jquery function to remove a particular tr
please, can somebody help me with a jquery code that I can use to remove a particular table row from the list of rows
how to unbind mouseout before get fire after mouse over
Hello i have a vertical menu which when you hover on each item of this list another list will show out . what i want to do is when the user hover on the second list which is the result of the first list hovering i want to stop collapsed and stay expand . i used this $parent_ul .find("li") .unbind("mouseout"); but this will show the effect on the second hovering . but what i want is to unbind the mouseout immediately . ul_parent_mouseover:function(event){ vertical_menu.defaults.$wrapped_child_ul.animate({left:
JS Function, cant figure out why
I may have one of the weirdest problems I have ever had. I have a portion of script (included below), which gets executed when the page loads. As far as I can tell, this function only gets called once, the weird part though, is the entire function executes twice.... I debugged it as much as I can. When I comment out the line where I call it (once), it doesnt get executed at all, when I uncomment it, it gets executed twice... I dont see anywhere in the function where it executes itself, and if it
Issue with checkbox listener in multifield
I have a multifield component with a 1 checkbox in each item. I am adding a listener so that if one check box is checked all others should be unchecked automatically. I am writing the listener with jquery. When I check the next item in multifield, the functionality works fine, however, it doesn't work when I check a previous checkbox in the multifield item. whats around with this code: Check = function(e) { $("input[name='./isActive']").each(function () { if($(this).attr('id') !== e.id &&
live scroll event?
hello, please see this demo: http://jsfiddle.net/sabeti05/gak1j2ac/ The event for class "inside" occur when scroll stops, how can i make it move the same time with scroll? Thanks,
Passing AJAX data - Result is missing formal parameter
Hi, Trying to pass two data entities in AJAX; See below CODE and ERROR. Am I trying to do something you can't do here? Help appreciated. R $('button[name="create"]').click( function() { successMsgShow(); $.ajax({ type: "POST", url: "AccountAdd.php", data: {"mykey":mykey, $('form#acctForm').serialize()}, success: storeData }); // ajax mykey
websocket
hey guys i've just set up a web socket on my server...but does anyone have a good tutorial on how to connect and how to execute SQL queries to my database so i'm able to gather rows please? thank you
Jquery $ajax onerror callback gives statustext:success & status as parsererror
function LoadLISSearch() { // //var call = $.ajax({ async: false, url: "url" + "/_api/Web/Lists/GetByTitle('SearchWidget')/items" + "?$select=*" // + "&$expand=ows_Name1" + "&$top=5000" +"&callback=?" , type: TYPE, //"GET", dataType: "jsonp", contentType:CONTENTTYPE, //'application/json; charset=utf-8', //cache: false, crossDomain: true, //xhrFields:
Unresponsive Script Warning
Hi, We are getting "Unresposive Script Warning" in our Product after some time of usage. We are using Jquery-2.0.3. Is there any solution?
Next Page