replace a 2-part class value by 1 part?
Assume I have a source code like <div ...... class="aaa bbb" ....>....</div> How can I replace the class value by another one resp. more precisely how can I delete the "bbb" class? The final code should look like: <div ...... class="aaa" ....>....</div>
css('border-top-width' ) bringing back 5 decimals.
I have some code that creates a box: The baseCell$ on line 9700 that it starts from is a clone of a box template defined a few lines earlier: baseCell$ = $('#boxTemplate').clone(); The problem is that even though the value I'm setting for border width is 1px (see line 9735) the value I read back with css('border-top-width' on line 9736 is 1.11111px. Here's the actual console.log output from lines 9735 and 9736: Does anyone have an idea what might be going on here? Thanks Steve
Form being redirected but elements not being posted in mobile web-pages built using jquery-mobile
Just discovered that jquery-mobile interferes with HTMLs File Uploader's functionality. Refer to my post on StackOverflow. Only solution I could find on my own was to remove the jquery-mobile file from the web-page. Has any one else encountered the same problem and whether some other solution is available? The version I am using is 1.4.5.
Using UI 1.12.1 Does not work
I just downloaded UI 1.12.1. both jquery-ui.js and jquery.js are in the same fold my html page is in. I proceeded to review a jQuery tutorial and copied the sample; ran it in Firefox:nothing worked. I have tried .hide(), .append(), and alert(); no jQuery script works, nada, zero, and zip works. Regular JavaScript still works. This is my code: Why doesn't this work? <body> <div id="divOne"> <p id="pOne"> </p> <p id="pTwo"> This 2</p> </div> <script> document.write("Ready");
How to reload current web page every 20 seconds?
Is there a way to reload the current web page every 20 seconds with jQuery? Peter
May I get explanation for this Map method
What is going on here, what is the scenario that makes one understand these following two statements: $("div.dcell").map(function(index, elem) { return elem.getElementsByTagName("img")[0]; }).css("border", "thick solid red"); $("div.dcell").map(function(index, elem) { return $(elem).children()[1]; }).css("border", "thick solid blue");
Argument in a Function: How does a function get its argument in jQuery
I don't really understand how the following function gets its argument, where from. Is there a calling statement that passes the said argument to to the function. <script type="text/javascript"> $(document).ready(function() { $("img").filter("[src*=s]").css("border", "thick double red"); var jq = $("[for*=p]" ); $("label").filter(jq).css("color", "blue"); var elem = document.getElementsByTagName("label")[1];
How to bind a jQuery class to a dynamically create INPUT element?
// define a jQuery getdate class for datepicker below (function() { var d = new Date(); var maxD = new Date(d.setDate(d.getDate())); $('.getdate').datepicker({changeMonth: true,changeYear: true,yearRange: "-31:+0",maxDate:maxD}); // ,dateFormat: "MM dd, yy" })(); // goal: add a defined jQuery class to a dynamically created INPUT field // defined jQuery class = getdate; and it works fine with regular reference // create a dynamic INPUT element var cellText = document.createElement('input');
Validate date - User should select only next month data from today's date
Hi, I have a date field to which, I want the user to select only dates from next month from today's date. The date field is in MM/DD/YYYY format. I tried the below code, but it is not working var validflag = true; var msg = "Please provide a valid details for the below: "; var isMessaged = false; var inputStartDate =""; var dtStartDate = $("input[title='My Start Date']").val(); var todaysDate = new Date(); var newtodaysDate = todaysDate.setMonth(todaysDate.getMonth() + 1); if(dtStartDate.length
1.5 Timeline?
Hi jQuery-Team, Since your last blog post is already half a year old (http://blog.jquerymobile.com) and there are no recent meeting notes on https://meetings.jquery.org/category/mobile/ either, could you give as a brief update concerning the timeline of version 1.5 and the future of the project? Greetings
I know that asterisk means (anything) but how here.
In these statements: var labelElems = document.getElementsByTagName("label"); var jq = $("img[src*=daffodil]"); $("img:even").add("img[src*=primula]").add(jq) .add(labelElems).css("border", "thick double red"); }); </script> </head> <body> <h1>Jacqui's Flower Shop</h1> <form method="post"> <div id="oblock"> <div class="dtable"> <div id="row1" class="drow"> <div class="dcell">
Cloning a page and event on click.
Hi, I am trying to clone a page, change the require ID's etc, then have one of the links call a function. I have include a brief example in this fiddle - https://jsfiddle.net/vs2jfqaa/17/ But I can't seem to get it the ID that is changed to (btnDuplicate_2) to do anything? Thanks in advance,
onclick only works once
This is my HTML <div id="divlisting_status<?php echo $row['sell_detail_id']; ?>"> <?php if($row['listing_status'] == "0") { ?> <img id="approve" src="https://pencopyediting.com/images/not_approved.png" sell_detail_id ="<?php echo $row['sell_detail_id']; ?>" listing_status="not_approved" /> <?php echo "<span class='status_list'>Not
question about the jquery u.s. map thing..
Before I begin, I would like to say I am comfortable with javascript, and html, I kind of know php, but not enough to use it to do what i need to do. That said, any help would be welcome, but if I can get a jumpstart on what I need to do in php, thats even better, because I don't see me having 50 different html files, lol... Anyway I am using the interactive U.S. map found here: https://newsignature.github.io/us-map What I want to do is, when I click on a state, load a page with information specific
hammer.js vs jquery.touch.events vs zingtouch vs ?
I need to support touch events for a sketch tool in a hybrid mobile app (Rhomobile Rhodes). I'm interested in what jQuery plugins (or other JS libraries) others are using. I figured this would be of great interest, and didn't really find anything here from a search. I've done the sketch part before in jQuery Mobile - we adapted the venerable sketch.js - fixing the bugs and (horrible) inefficiencies - added a number of new tools, and hooked it into JQM "v" events (vmousedown, vmousemove, etc.).
Jquery and css3 mediaquery problem
Hi I have a strange problem involving jquery/jquery-ui-accordion and css3 mediaquery. I have a site where the jquery works fine ( image swap, accordion and so on). But i have a mediaquery in my css and when the windows hits its size the jquery stop working. All of it.. nothing works anymore. I use jquery 3.1.1/jquery.min.js and query-ui-1.12.1.custom/jquery-ui.min.js from Googles CDN Is it someone out there that can tell me what is going on? Why does the jquery stop working? Link to the problem
elevateZoom Plus - Screen Mode help needed!
Hi guys! I'm using elevateZoom Plus plugin from Igorlino GitHub user! (the original plugin is from elevateWeb GitHub user) I'm trying to implement a Screen Mode Image Zoom workaround, as you can see in this link! (html code) There are some issues I want to fix: - the scrolling is inverted (wheel up = zoom out \ wheel down = zoom in), I want the otherwise! - if (image width\height < screen width\height), the image is positioned to the top\left screen (I want it centered instead) - the "zoom in"
IE11 TypeError
I'm doing calcualtions with jquery and all works well in firefox. In IE11 I get the following message, "TypeError: Object doesn't support property or method 'trunc'" I'm using trunc to drop the decimals. What does IE11 need for trunc to work? Thanks. function calculate_net(loan_table){ $(loan_table + " input[name=net]").calc( // create the equation "(borrowed_v) - (lofa_v)", // define the variables used in the equation { borrowed_v: $(loan_table + " input[name=borrowed]"),
Is jquery-1.11.3.min.js the most stable & optimized plugin version?
We are currently using jquery-1.11.3.min.js on our site and I wanted to know if this version was the most stable and optimized version from a speed and browser parsing perspective? We are looking to make our site load speed as fast as possible.
Adobe Muse + JQuery Amazing SLider problem
Hi guys & gals, I use Adobe muse and create my header slideshows using Amazing slider and then inserting the html into adobe Muse - works great, looks good. As soon as I add a Muse widget into this page (via any widget source) - my slider gallery disappears? (but the widget I have added works fine).. Help !! Cheers Steve
elevateZoom jQuery Plugin - How to hide ZoomLens when the mouse is not hover the images?
I use elevateZoom jQuery plugin for image zoom effects in my blog! This is the original plugin / this is a modified version EZ+ Both of them have a problem while exiting ZoomLens if mouse is not hover the images! (when mouse is not hover, the ZoomLens should be hidden!) Here is a practical Example \ (HtmlCode) The example uses the modified version (elevateZoom Plus), but the original one has the same problem too! (the EZ+ plugin code is included in the Html code from the link above) I really would
jQuery Calendar question
I recently bought a JavaScript book that showed me how to build my own calendar. However, when I run the code in Firefox it has no style at all. The functionality works but looks very bland as you can see. The link to the CSS code is:<link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/ui-darkness/jquery-ui.css"> As you can also see it doesn't do anything. Is this a broken link? I saw a similar question asked by dashtetanhaimein, but it didn't help my situation. Thank you in advance. The
JQuery & PHP
Hi . Very new to all this. I have the following form: <form id="name="UpdateStatus" action="" method="post"> <select> <option value="1">Defcon Green</option> <option value="2">Defcon Amber</option> </select> <p><input type="radio" name="StatusMessage" value="default" checked>Default Status</input> <input type="radio" name="StatusMessage" value="last">Last Status</input></p> <textarea rows="5" cols="70" name="status"></textarea> <p><input type="submit" name="submit" value="Update" /></p> </form> I
The url of $.getJSON
I use asp.net mvc. Now when I login the page, I want to display an icon and a number. For example. The url is localhost:23567The image is similar with So in the _LoginPartial.cshtml. I have <ul class="nav navbar-nav navbar-right"> <li class="notifications"> <a href="#"> <i class="glyphicon glyphicon-globe"></i> <span class="badge js-notifications-count hide"></span> </a> </li> And in the _Layout.cshtml, I put the script <script>
Contribution to jquery-ui slider widget [version 1.12.1 mod]
Hello guys, I would like to contribute to slider widget/control (currently working on it, forked jquery-ui in GitHub). Planning the following changes: - dynamic handle size (fixed axis relative to orientation)(not css-based). - strict option, when handles doesnt move beyong the scale. - internal handle type, when handles positioned inside the slider scale. how do you find these features? are they acceptable? sorry for language, im not native to English. I will create codepen demonstration if it's
if function not exectuiing
Hello guy, I'm new here. My problem is i have a few functions on my <script tag> : a POST, GET and a function which is supposed to change a buttons text if the true condition is met. Everything works except for the if statement(the last function). I Have been trying to resolve it but no luck. It's not executing. Here is the code: <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>demo</title> <link rel="stylesheet"
Explanation of scrolltop() & scroll() in depth
Please explain Scrolltop() scroll() AND ALSO please explain following in depth what that does $(window).scrolltop()
Check object type and create dynamic content accordingly
I'm working on application which will create dynamic content based on the type of object. The object type can be 'company' or 'employee'. The objects with the type 'employee' are created using bootstrap modal. I'm facing with a small problem when I'm doing that. The dyamic content is getting duplicated when I'm generating that. Also, when I add consecutive objects using modal, the content gets refreshed or lost. How do I fix it? Here's the JSfiddle.
IE 11 reload page
Hi, I am using jquery 1.11.3 and want to close popup after some information is submited using POST method. To be exact, i have a page with listed calendar. User at first inserts as a filter which year and month he wans to show. When calendar appears user chooses (on popup) day to to enter event for example 15 (day) event (birthday). When user submits data and closes popup, firefox works pefectly: - reload page on filtered year and month with inserted event IE 11 reloas page without any filters ,
This code snippet do nothing in IE and crash on Edge, while it's supposed to be supported
Hello, I have what seems like a compatibility problem between this little JS code: https://jsfiddle.net/b9rgachd/ and Internet Explorer and Edge. I have in my HTML a personalized Select (rendered via TWIG in response to PHP, so a bit hard to put in the fiddle): instead of a plain list, each option of the select is displayed inside a div on its own. The div is larger than the label, and, by default with only HTML/CSS, the only way to select an element from those options is clicking on the label,
How to post data / login to a web site via XMLHTTPRequest
Hi everybody, I need some help. I'd like login to www.mywebsite.com/login.html and keep the cookies in order to be used when I will submit the Travel Form as you need to login first before to submit the travel form. Nothing is happening when I try to click on "Login" button. Below is my code and the screenshot of the form. <!DOCTYPE html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <script> $(document).ready(function(){ $("button").click(function(){
Disable next button in the last page
I'm fetching some data through JSON in a container(it is a table), which has previous & next buttons. In each page, I'm displaying 20 records from the JSON. Now, I need to disable the 'next' button, based on the value of the property 'totalRecords' in the JSON. Calculation: So, let say, the value of totalRecords = 238. Which means I should have (238 /20 = 11 pages with 20 records and the last page with 18 records = 12 pages overall). So, how do I ensure that 'next' button is disabled on 12th page
How to get dynamically added elements in jquery
Hi, I've a requirement to add product items dynamically. We've the jquery functions to do so. But on submit I need to fetch these dynamically added row data and submit to server. Im unable to read the inner elements nested within divs :(. can someone guide with some example. I tried to class name to fetch the element(dropdown in my case) but after getting the data Im not able to pull the selected dropdown value. Here is my code $(".tripDataRow").each(function (index, item) {
How to set hover/active pseudo style to element?
My jQM app doesn't have input device such as mouse or tap sensor, only arrow keys. So the buttons should first show the active/hover state programmatically, then user can hit enter to confirm the click, where click event is triggered. I've tried $('#radio' + radioIndex).trigger('hover'); and $('#radio' + radioIndex).trigger('mouseenter'); which didn't work. Do I have to refresh button? How? From Chrome Developer Tools I can see that what I want is actually pseudo style :hover or :active. But it doesn't
jQuery UI Slider with multiple ranges - background bug
I'm trying to create slider with 2 ranges and add some color to background, it's OK with max value 100 (line 9): jsfiddle - ok Problems appear after changing it, from max:100 to max:95: jsfiddle - bug Maybe where is a better way to do this, maybe i miss something, please help me. Thx for attention.
Custom Build jQuery Namespace (NOT $ or _$)
We would like to consume jQuery as a library but need to define the namespace specific to our application and allowing consumers of our application to not be depended on our code as well as not wanting to require the developers to add jQuery noConflict. ~ this is a design requirement ~ How would we go about recompile jQuery to have the global variable to be something other then $ or _$; more like pvt$ that only we have use. We don't want to add any new logic to jQuery but should be able to later
Why I am getting no data through JQuery?
Hi, I am using below code to get list of birthdays. I have one birthday in my database on 23/9 and I am able to see it when I check the URL: https://www.softnames.com/the_blessed_tree/ws/populate_birthday_GET.php?day=23&month=9 but getting nothing when I check this URL: https://www.softnames.com/the_blessed_tree/ws/populate_birthday.php?day=23&month=9 The only difference between both is (populate_birthday_GET): $day = $_GET["day"]; $month = $_GET["month"]; and (populate_birthday): $day = $_POST["day"];
Comparison sometimes works and sometimes not
Hi! Can anybody tell mee how the comparison in the script below can sometimes work and sometimes not? It just told me that 355 > 250, but also that 37 > 3587. How can that be possible? <script> $(document).ready(function() { $("form#form-voorraadlijst input[type='number']").focusout(function() { if ($(this).attr('value') > $(this).attr('max')) { alert ($(this).attr('value') + ">" + $(this).attr('max')); } }); }); </script> Hope to hear quickly from you guys. Thanks
Write a date in a datatable search field
Hi at all ,sorry for english , i have a datatable ,with your's search field input , i add an id to this field(id="ricerca_data")in the jquery.datatables.min.js and if i see in console i see this id . I insert a new field to search data by datepicker : <label>Ricerca per data</label> <br> <input type="text" name="" id='select_data' value=""> <br> <br> <input type="button" class='btn btn-warning' name="name" id='ricerca_button' value="Ricerca"> And
i need help.. how to get this work on media?
i'm not good at it and i realy need help on it. As i got thumbWidth:300 how can i get it smaller on media? ;(function($) { "use strict"; $.fn.extend({ youtubeVideoGallery:function(options) { var version = '1.3.0', isLegacyIE = (/\bMSIE [4|5|6|7]/.test(navigator.userAgent)), defaults = { assetFolder : '', fancybox : { arrows : false, closeBtn : true,
Next Page