find and replace content based on a pattern
<tr> <th></th> <th class="ms-acal-month-top"><nobr><span>Sunday</span></nobr></th> <th class="ms-acal-month-top"><nobr><span>Monday</span></nobr></th> <th class="ms-acal-month-top"><nobr><span>Tuesday</span></nobr></th> <th class="ms-acal-month-top"><nobr><span>Wednesday</span></nobr></th> <th class="ms-acal-month-top"><nobr><span>Thursday</span></nobr></th> <th class="ms-acal-month-top"><nobr><span>Friday</span></nobr></th> <th class="ms-acal-month-top"><nobr><span>Saturday</span></nobr></th> </tr>
each or map but deferred
Hi, Just getting my hands on jquery. $('body').find('div[id^="plugin-load"]').map(function(i, elem) { var plugin_id = $(this).attr('data-plugin-id').trim(); $(this).PlugLoader({data: {"pid":plugin_id} }); }); PlugLoader is custom jQuery plugin. It is doing so many stuff like ajax get request, compilation of template using handlebars when data is received and some other stuff. I would like to change code in such a way that until PlugLoader is not done, each/map should wait before executing next
Parted jQuery library
Hi, I developing new project on embedded system, which has a lot of limits, for example web server has max file size 64kB. I have built jQuery without sizzle and a few other features, it takes 63kB. However, I looking for some else solution, for example, parted jQuery library file into 2 files. Is it possible ?
Issue - outerHeight(), innerHeight() and height() cannot computing on element that have load() function.
Hello iam new member on this forum. I have a problem to get height with 3 function jquery : outerHeight(), innerHeight() and height() when applied on element that have a load function. My code is very simple and here is that code : var content = $(".main_profile"); var csp_height = content.outerHeight(); var csp_scrollableHeight = content[0].scrollHeight; console.log( csp_height ); console.log( csp_scrollableHeight ); console.log( csp_scrollableHeight > csp_height ); if ( csp_scrollableHeight
Change Page Using Anchor Tag Then Scroll to Div
Hi, I'm using an anchor link to scroll to a div on another page containing the id="contact" tag. I have tried to use the header background image div 'head-bg' for the offsetSize, The JQuery function works just how I want it to; however, the browser console shows the following error: Uncaught TypeError: Cannot read property 'top' of undefined, I'm an absolute beginner at JQuery. The code below is a combination from snippets I found available to use online. If I understand correctly, the error
Need the big size image to be resizable
My coding is : <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <meta http-equiv="content-script-type" content="text/javascript" /> <meta http-equiv="content-style-type" content="text/css" /> <title>DRAG & DROP</title> <meta name="description" content="DRAG & DROP"
How do I Properly Add jQuery Scripts to my WordPress blog?
Hi, I have my own website done in php. I now a lot about jquery but my problem is wordpress. I dont now wordpress and I want to add some jquery scripts to my blog. the website is abswheels.se (build with php) the blog is on a path folder abswheels.se/blog/ (made in wordpress) My question is how I can add something like this http://callmenick.com/_development/slide-down-menu/
How to move a div above a section?
Hi everyone, I'm new to JQuery and this group and I'm hoping someone can help. I have some content that is generated by software and I need to change the order of one part. I need to move a div above a section. I've tried a few things but have been unsuccessful so far. I'm not sure if it is because I'm dealing with a section or because of a mistake on my part. I need to move the custom-header-container div above the main-section section. What is the correct way to do it? <section class="main-section">
How to enlarge thumbnail image into large image by drag and drop in same page, b keeping the thumbnail as it is in the same place?
Any of you know the procedure in Jquery?
jquery.js Problems
Hello, i have a Problem again.. When i am link jquery.js in my html file no other js functions are available <!DOCTYPE html> <html> <head > <meta charset="UTF8" /> <script src="jquery.js"></script> <script> function OpenWindow(window) { if(window=="login") {document.getElementById("login").style.display = 'block';} else if(window == "register") {document.getElementById("register").style.display = 'block';} } </script> </head> <body > Test ob Erstellt <div id="login" style="display: none;"> LoginLoginLoginLoginLoginLoginLoginLoginLoginLoginLoginLogin
Ayuda con Jquery
Buenas noches amigos de este foro.... estoy utilizando un buscador con su respectivo paginador jquery en tiempo real que funciona excelente. A la vez en esa misma pagina tengo un formulario para ingresar nuevos registros a mi BD el cual tambien los registra sin recargar la pagina. El problema es que cuando termina de realizar la insersion el buscador queda sin efecto... tengo necesariamente que refrescar la pagina F5 para que todo vuelva a funcionar. Por favor ud. expertos en este tema necesito de
How to parse json object with collection
Hi! I need to parse the following json: { "customerId": 0, "customer": null, "cultureId": 0, "culture": null, "entrys": [], "id": 0, "uId": "26a8dabd-30b1-4a54-8781-70f209c8dbca", "dateCreated": "2017-08-12T17:11:28.9080481+02:00" } this is what I have so far: var obj = JSON.parse(data); but how can I access the number of items (count) in the "entrys" collection?
Filter Content Based on Dropdown List Selection.
How Can I make these 3 dropdown lists to filter the content. They are filtering it individually at the moment. How can I make them filter if 2 or 3 choices are selected. JSFiddle link is attached? https://jsfiddle.net/8no2j42m/
Upload file and JSON data in the same POST request using jquery ajax?
Hi, I am trying to send a POST request using jQuery Ajax, where I would like to upload a file and some json data. Please find below code, var logoImg = $('input[name="logoImg"]').get(0).files[0]; var formData = new FormData(); formData.append('logo', logoImg); var objArr = []; objArr.push({"id": id, "name": userName}); var obj = [{"objArr":objArr, "formData":formData}] ; $.ajax({ type:"POST", url :url, dataType:"json", data : JSON.stringify(obj), contentType:"application/json",
CSS Transition Infinite Loop
I have a CSS transition that I want to loop infinitely. I put it on plunkr but it doesn't loop there at all. You would have to create a Web page from the plunkr in order to see it loop. Here is the plunkr: plonkr
how to check file name?
hi guys need some help. i have written a code that checks now if i have uploaded 2 file with the name which have been defined. but now i would like to check for each file name and show an alert message to the user which file name is missing. var files = $('#file').prop("files"); var fileNames = $.map(files, function(val){ return val.name; }); var toCheck = ["Query", "Entities"]; $.each(fileNames, function (i, name){ var Filename
Prevent image loading to show
Hi, I am using below to show an image based on date and if not then display default image. It is working beautifully but I only have one problem. I am displaying a loading screen until the image is displayed but it is not happening and the loading will go off before the image is display then the user will see the image loading which is ugly How can I fix this please? $("#imgHomeSplash").attr("src", "https://people.softnames.com/images/home/splash/NASSER/" + special_date + ".png"); $("#imgHomeSplash").on("load",
Array
I have this array: var aLang = new Array(5); aLang['fr'] = new Array(350); aLang['en'] = new Array(350); aLang['es'] = new Array(350); // [languish] [key] =" item text" aLang['fr']['Menu1'] = 'Acceuil'; aLang['fr']['Menu2'] = 'Programs'; //---- Key aLang['fr']['3'] = 'jQuery'; aLang['fr']['OP'] = 'cSharp'; aLang['fr']['OC'] = 'C++'; aLang['fr']['OM'] = 'Lisp'; aLang['fr']['OMT'] = 'Fortran'; //Html tags <li><a key="Menu1" class="ctext"
wrapAll around two elements?
Hi, I'd like to wrap a section around two elements. What I understand from wrapAll is that I could only either wrap all h4 or p but not combined... The current structure is: <section id="questions"> <h4>Question</h4> <p>text></p> <h4>Question</h4> <p>text></p> <h4>Question</h4> <p>text></p> </section> I'd like to archive: <section id="questions"> <section class="question"> <h4>Question</h4> <p>text></p> </section> <section
Make 6 divs look like grid but with 2 ways to scroll??
This is really more than a JQuery problem and any help would be greatly appreciated. I've created a .JSFiddle of my problem. I've got a grid cut up into 6 div tags. Top1 | Top2 Mid1 | Mid2 <-scrolls vertically Bottom1 | Bottom2 <- scrolls horizontally Mid2 and Bottom2 are set in css to scroll-y & scroll-x respectively. the rest are set to hidden. When Mid2 scrolls (vertically) I need Mid1 to scroll with it but leave Top1, Top2, Bottom1
datepicker Validation
Hi All, Help me, <div class="input-group m-b bootstrap-touchspin"> <i class="fa fa-calendar input-group-addon"></i> <input id="ActualDeliveryDate" type="text" class="form-control datepicker" maxlength="10" data-attr="ActualDeliveryDate" placeholder="mm/dd/yyyy"> </div> </div> In the above code ,i need validation, if i select date=08/03/2017 after getting current date if i modify date=0/0/0 . It Should fire Validation error ,that given date is not valid. hope you understand ,what i mean. Thanks
Native jQuery date format
Hi, Is it possible to format a date without having to use a pluging? I mean native jquery only? I want to get the current date in ddmmyyyy.. for example: 21122017 01072017 Thanks, Jassim
Check if image exists on server
Hi, I am trying to check if an image exist on the server then I can display it otherwise display a default image. Using below code: $.ajax({ url: 'https://people.softnames.com/images/home/splash/NASSER/4.png', crossDomain: true, success: function (data) { alert('exists.. display this image'); }, error: function (data) { alert('does not exist. display an alternative default image here;'); }, }); but it returns an error although the above url does return an image.
How to change select-option width?
Hi all, I have created a select option dropdown list. But when a text in the option is too long, the option box is longer then a select box ... I write here, because I think this is possible only with jquery ... thanks ... here is an example jsfiddle it should put longer text to the new line ... but I dont know how tnx for answers, indeed
SyntaxError: missing } after property list
Here is my json data. Json validator shows this is valid in javascript. But I got error of missing } at position 78 ( jquery.jqGrid.src.js:1:78). {"total":1,"PageSize":1,"Page":1,"records":10,"rows":[{"id":"CaSNP01900516","cell":["CaSNP01900516","Ca8","2449175","Substitution","T ","C ","Ca_02342","Uncharacterized protein At1g04910"]},{"id":"CaSNP01900521","cell":["CaSNP01900521","Ca8","2449198","Substitution","T ","G ","Ca_02342","Uncharacterized protein At1g04910"]}]} let me know why this error.
Problem using nth-child selector inside table
Hello, I have a problem with the nth-child selector by using it with Jquery. Normally my code defines what I want, but either there is a conflict between my row and column selections or I do not use the correct selectors or there is a bug in the browsers. JSFiddle Problems : A) Friday from 12:30 pm to 1:00 pm should not be in black since the club is open from 8:00 to 21:30 B) the club closes at 19:00 on Saturday - all time slice from 7:00 pm must be in black color. The problem (A) should not be displayed
Checking if video source is empty
I have 20 videos displaying onto screen. How can I check if any of the video src's tags are empty <source src="" type="video/mp4" /> Here's my script so far $('video').children().each(function(index) { //console.log(index + " " + $(this).attr('src')); if($(this).attr('src').length == 0){ console.log('hide' + index + " " + $(this).attr('src')); $('.row-5 div.col-1-5 .icon').addClass('disable'); $('a.icon').removeAttr('href'); $('div.vid').hide(); } else { console.log('show' + index+ " " + $(this).attr('src'));
call a function within $(document).ready(function() {
First of: I know it's something which has been written (well, typed) about a lot, but even though I found workarounds, I haven't been able to get around this limitation. To get into details, a while ago I set up a page with a Highcharts graph, most of the code is pretty much the same as https://blueflame-software.com/using-highcharts-with-php-and-mysql/ , I based it on that. The data.php was originally written in such a way that it got the data from the MySQL database between the moment of accessing
TypeError: $(...).Jcrop is not a function
var jcrop_api, boundx, boundy; function updatePreview(c) { // croping image preview if (parseInt(c.w) > 0) { var rx = 220 / c.w, ry = 220 / c.h; } } function showCoords(c) { // show all coords $('#x').val(c.x); $('#y').val(c.y); $('#x2').val(c.x2); $('#y2').val(c.y2); $('#w').val(c.w); $('#h').val(c.h); } $('.thumbnail-img').Jcrop({ onChange:
Loops and array
Im just starting to learn jquery and having a bit of trouble with loops. I am trying to create a variable array that contains certain product names, if the product name in the array matches the heading inner text, then add a class to the product image. I have come up with the below which works fine when there is only one individual product in the variable, but if i add more than one product to the variable, it breaks. Can anyone tell me where I'm going wrong? Code looks like this so far: var product
how to reverse bit?
Hi, I don't know how to explain but let me put it this way.. I have this in my js file: visible: is_organization this should be reversed so if is_organization is true then visible should be false and it should be in the same way, I mean: visible: is_organization and not with if statement. How can I do this please.. Thanks, Jassim
How to allow special characters in jQuery “contains”?
Original question asked here . So when this function is triggered it selects an item in a list via filtering elements with that class and with the text that the user provides through the var text. If the above exists then it simply clicks that element, else show an error. However if the user provides text like "hi(hello world)", this would be seen by jQuery as part of the function and not text, so it doesn't work. So any special characters like "!/-()" will be seen as part of the function and
Reading "natural" size with jQuery
The image below has a natural size of 3264x2448 and has been resized to 600x450. Is there a way with jQuery to read the natural size from the image element? Thanks
jquery post without page reload in jquery-3.2.1
there is a working solution for jquery 1.9.1 with $.ajax /* jquery-1.9.1 */ $(function () { $('form').bind('submit', function () { $.ajax({ type: 'post', url: 'worker.php', data: $('form').serialize(), success: function () { alert('form was submitted'); $( "#result" ).html(result); } }); return false; }); }); i tried the code above with the newest version
trying to select the first parent of type section
I'm trying to get the nearest Section element with class name lc-local-section-wrap. I've tried $(this).parent().closest("section") and about everything else, but now I'm stuck! Html: <section class="lc-local-section-wrap"> <div class="lc-local-button-wrap"> <input type="text" id="TextCount" value="1" /> <button type="submit" value="@Model.ToString()" class="btn btn-danger lc-buy-button"><i class="fa fa-cart-plus" aria-hidden="true"></i></button> </div> <div class="lc-buy-button-done">
hide and show objects within same parent DIV
this is the html for my button: <div style="width:100%;"> <div class="lc-local-button-wrap"> <input type="text" id="TextCount" style="width:36px;text-align:center;position:relative;top:2px;margin-right:2px;" value="1" /> <button type="submit" value="{?value?}" class="btn btn-danger lc-buy-button"><i class="fa fa-cart-plus" aria-hidden="true" style="font-weight:bold;font-size:22px;"></i></button> </div> <div class="lc-buy-button-done" style="display:none;text-align:center;">
Click event doesnt fire - multiple buttons
I reference a js file that will contain some logic when an user clicks a button and there is multiple buttons on the page with the same name. I use alert for testing, but it never fires when clicked. Html: <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Smokers | Rullepapir</title> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" integrity="sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ"
How to insert current timestamp in format DD.MM.YYYY HH:MM:SS ?
How can I insert the current timestamp in format DD.MM.YYYY HH:MM:SS ? Peter
making multiple ajax/jsonp requests doesnt seems to work!
I am using the following code to make multiple requests var a1 = makeRequest(config.servers[0]); var a2 = makeRequest(config.servers[0]); var all=[a1,a2]; $.when(all).done(function(results) { console.log(results); }); function makeRequest(server) { return $.ajax({ url: buildUrl(server), type: "GET", dataType: 'jsonp', jsonpCallback: "datasource " }); }Intermittently I am getting the following error! Why? Uncaught TypeError: datasource is not a function
Display JSON Object in Drop Down List
Suppose my AJAX call brings back the following json objects from the backend: [{"FName":"Jane","LName":"Doe", "ID":"ABC123"}, {"FName":"Joe","LName":"Bloe", "ID":"XYZ456"}] Below is my AJAX call but I have not been able to display the JSON contents in a drop down list. var custNames= $("#Customers"); //Drop Down List ID $.ajax({ url: 'http://localhost:32388/api/service', type: 'GET', dataType: 'json', contentType: 'application/json; charset=utf-8',
Next Page