Scroll to problem
I have a problem with the scroll to. I have more ul tags and inside this tags it must scrooll to a point. In the first ul tag it works all fine but in the second ul tag it donst work. this is the jquery with i'm using. $jq(document).ready(function () { $jq(document).on('click', '#letterstripe li', function(e) { $jq(this).toggleClass('active').siblings().removeClass('active'); var letter = $jq(this).html(); var id = $jq('li.[data-value="'+letter+'"]'); var xid = $jq(id); if (xid.length
Error assigning id to element in append
I have the following code $('md-menu-content').append ( ('#md-menu-item/>', {'id': 'child')). eval('element _' + indentif).input ); In which md-menu-item is added in md-menu-content and receives a 'child' id, id that I use in find to add another item, now in md-menu-item, however it does not add id The query does not advance, unless I swap md-menu-item for another tag, example ... $('md-menu-content').append ( $('<a/>', {'id': 'child')).find('# child').append ('
Issue using Append
Hello Everone, I created the code below, however, I believe I should use something like an array because when I call the function several times, then it's appending the same name(xnome) and id. //EXAMS $('#idexame').change(function () { var doc = document.getElementById("idexame"); $("#xnome").html(doc.options[doc.selectedIndex].text); $(".selecionado").append('<div class="alert alert-warning alert-dismissible"> <button type="button" class="close"
Multiple button multiple images
i have the below code <!DOCTYPE html> <html> <head> <style> /* The Modal (background) */ .modal { display: none; /* Hidden by default */ position: fixed; /* Stay in place */ z-index: 1; /* Sit on top */ padding-top: 100px; /* Location of the box */ left: 0; top: 0; width: 100%; /* Full width */ height: 100%; /* Full height */ overflow: auto; /* Enable scroll if needed */ background-color: rgb(0,0,0); /* Fallback color */ background-color: rgba(0,0,0,0.4);
Return the split path if the JSON key/value exists else return blank
I need to display the name and split path of the path entered by a user dynamically. For that, I had split the path entered by the user and grab only certain part of it. For e.g. if the user enters path as: /content/mypath/myfolder/about/images/abc.jpg Then I am displaying images/abc.jpg. However, let's assume that some of the users do not have a picture, at least the name should be applied & displayed in that case. Please check the function refreshDisplay() for details. But it throws an error-
Better way of writing this block of jquery code
I've the following code block that works just as expected, but I'm sure there's a better and cleaner way to write it. Would appreciate if you could show me how - $(function () { $("#show_only_to").bind('change', function () { if( $("#show_only_to").val() == 'loggedin') { $("#access_redirect").hide(); $("#access_member_roles").show(); } else if ( $("#show_only_to").val() == 'loggedout' ) { $("#access_member_roles").hide();
Show Loading image while Image is loading
Hi, I have an image which might be slow in loading depends on the internet connection. How can I show a progress / loading icon on the image until the image is fully loaded? Thanks, Jassim
how to chain a promise across js modules?
I have a js module which calls another js module: /* InitModule */ //sets hdnMyUIWidget value to a defined template MustacheTemplateLoader.LoadMustacheTemplates(); //calls Mustache.to_html(template, date) UIBuilder.LoadMyUIWidget(); I'd say about 80% of the time the mustache template is available as expected in the hidden field by the time UIBuilder.LoadMyUIWidget() gets called. But 20% of the time it's not available. So it seems that I need to figure out how to tie a dependency to start the execution
IE vs ajax PUT file upload (works in Chrome)
Hi :) The following works in Chrome but not in IE. Long story short: I'm trying to upload a binary file (used for firmware update) to a box running Lighttpd. $.ajax("api/dupdate", { method: "PUT", contentType: "application/octet-stream", processData: false, data: dupdateFile, success: function(data, status, jqxhr) { console.log("OK!"); }, error: function(jqxhr, status) { console.log("Error, status: " + status); } }); In IE when trying to
Regarding native code error
Hi, I'm working on Highcharts and maps in ASP.net pages using jquery. When I run my application , at the time of navigating to another page in middle of current page, I'm getting "native code error". I have tried and google searched regarding this problem, I didn't get any solution. Could you please help me to eradicate this error Regards Venkateswari
Passing conditional referral code based on URL string and form selection
How can we pass the appropriate referral code in the following scenario based on the URL string and color selected? Form select (Colors): Red Blue Black White Scenario 1: If user accesses page with a URL string that includes any CLR, such as testing.com/?CLR=somethingHere, then mktrfl="default" Scenario 2: If user accesses page with following URL string (testing.com/), and selects "Red", then mktrfl="groupred" Scenario 3: If user accesses page with following URL string (testing.com/), and selects
Enlarge Div on button click
Hi, Is it possible to enlarge a div's height/width (from the exact middle of the div) when a button is clicked? Thanks
How to pass a value
Hi var Id; $('.btn.btn-danger').on('click', function () { var Id = $(this).data('id'); // Here Id value is correct and i want to pass this value below click function }); $("#deleteConfirmModal").on('click', "#deleteConfirm", function () { Id = Id; // Here it is showing undefined $.ajax({ url: '/test/Delete', data: { 'id': Id }, type: 'POST', dataType: 'json', //data: xsrf, //cache:
ajax return is null
I'm trying to get back confirmation that a file has been written to using php. Here's a php code snippet: // Check that write has been successful if ($fwrite !== false) { $output = json_encode(array( // create JSON data 'type'=>'success', 'text' => 'Congratulations ! The key has been successfully created.' )); return ($output); die($output); // exit script outputting son data } This is my ajax sending stuff: // upload text to file $.ajax({ method: 'POST',
Exporting string to file w/ double quotes
I'm trying to write a string to variable & then write that to a file, but the quotes are coming in as " I've tried several things & not having success. Currently have this: var keystring = "$easydb->key="" + usersalt + "";"; Which yields the following string in the file: $easydb->key="GN86rI4pZ5ggGGjp"; I want it to end up as: $easydb->key="GN86rI4pZ5ggGGjp"; So how do I write it to get those double quote to actually show in the file?
Not Enough arguments error
I'm getting a Not enough arguments error. This script basically collects key/value pairs & gets them ready to be ajax'd to a .php handler file. var obj_data = {}; obj_data['key'] = keystring; // Ex. Keystring: $easydb->key="x2nrdIpAmdorqMj4"; var textData = new FormData(); $.each(obj_data, function(k, v) { // apply object key/values to formData console.log(['Key, Value: ', k, v]); textData.append(k, v); }); $.ajax({ method: 'POST', url: 'assetPath/easydbkeysetup.php', data:
upload a file using jquery ajax function
Hello again, I am trying to create a possibility for users to 1) select an image using an input field --> the image is displayed in a preview box by the function readURL --> that works fine 2) upload that image to process sever side wise by clicking a div calling a function uploadImage --> HERE IS THE PROBLEM The html code: <input type="file" id="imgInput" /> <div id="submitAddImage" class="messageBoxSubmitButton">Bild hinzufügen</div> No <form> tag around used. Also functions are called on
AJAX sub-menu not working in DIV tab
After I added the div tab, the AJAX sub-menu is not working anymore. I am stuck here for whole day. <div class="tab"> <button class="tablinks" onclick="openProgram(event, 'add_item')" id="defaultOpen">Add Item</button> <button class="tablinks" onclick="openProgram(event, 'list_item')">List Items</button> </div> <!--------------------------------------------------------------------------------------------------------------------------------> <div id="add_item" class="tabcontent"> <div id="list_item"
jQuery not working properly
0down votefavorite Hello I have problem regarding jquery. Well the problem is, the input text value stays the same everytime. Instance: I click on the edit button and the customer details are populated using ajax. and then when I try to change for example the name of the customer, it submits the old value. it does not change. Here's my code. $(document).on('click','#editcustomer-btn-save',function(e) { var params = { id: $('#editcustomerform .customerid').val(), name : $('#fuck').val(), address :
How to remove <br>?
Assume the following code <a class="foobar" ....>.....</a> <br> How do I remove the <br> tag following (all) <a> elements with class="foobar"? The following does not work: $("a.foobar").next().remove(); Why not? Peter
Open Menu after append NOT WORKING
Hello guys I have this <a href="#menu-toggle" class="btn btn-default" id="menu-toggle"></a> It is opening a side menu. But when i remove this code from html and append it with jquery like this: $('.vertical-center').append('<a href="#menu-toggle" class="btn btn-default" id="menu-toggle"></a>'); it it not working. Can someone please help me ? It is urgent. I dont really understand why this happends.
Help with jQuery Function needed
I have a list view created using a 3rd party module in DNN called XMOD Pro. I want to update a single field in each row using AJAX and a "feed" so that I can refesh the value of "STATUS" from the database without the user having to refresh the entire page. (cant use ajax for full listing as need the links and edit facility in each row) I have created dynamic IDs on the elements I need to read from and write to. I have managed to create a function that iterates through the list and using alerts at
jQuery CSRF issue on jQuery.get(...)
HPE Fortify Static code analysis flags the below lines as a CSRF issue in all versions of jQuery. return jQuery.get( url, undefined, callback, "script" ); return jQuery.get( url, data, callback, "json" ); Ref: 1 & 2 Fortify issue description: The HTTP request at jquery-3.2.1.js line 9307 must contain a user-specific secret in order to prevent an attacker from making unauthorized requests. Are there solutions to mitigate this issue?
Modal / Pop up using Jquery
I am working on a modal / pop up. On clicking an anchor tag I need to Open a modal/pop up. In the modal/pop up, Prompt the user to enter a start date, add 1 year to the start date entered by the user to display an end date, match that end date to the current date and display a message whether the end date is expired or is still active. Can I get a working example for this.
detecting screen size when resizing browser
Hi, I would like to prepend an element on my screen when the bowser is resized. my code works if I refresh my browser less than 500px but it doesn't work if I resize the browser please help $(window).resize(function() { if ($(window).width() < 500) { $(".last-col").prependTo(".celeb-quote"); } });
h:selectManyListBox not working after upgrade jquery version 1.8.3 to 1.12.3
Hi Team, After upgrading jquery 1.8.3.min to 1.12.3.min version ,the <h:SelectmanyListBox> is not working properly. In selectmanylist jsf component, the selection of item is not happening for the first time and after next time it is not able to select the same item again. please have a look this issue. Br, Ankit
Meu slide não funciona nem a pau.
Olá amigos. Estou estudando para depois colocar um site no ar mas estou desanimando. Fiz tudo como funciona o vídeo, mas as images estão paradas e o slide não gira. O que deve estar faltando? tem algum outro segredo? <! DOCTYPE html PUBLIC "- // W3C // DTD XHTML 1.0 Transitório // PT" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <Html xmlns = "http://www.w3.org/1999/xhtml"> <Head> <Title> htmlCSS </ title> <Meta http-equiv = "conteúdo-tipo" content = "text / html; charset = UTF-8" />
Help getting asp labels to toggle
So basically I have an update panel and inside that updatepanel I have a checkbox(Which i have set to autopostback because I need the page to reload for something else). When I click the checkbox I would like it to toggle off and when the checkbox is uncheck I want it to toggle on. These labels are outside of the updatepanel. my code is below.. $(function () { $(".kk").change(function () { $(".ff").toggle(1000); }); });
Why doesn't the setInterval's function get invoked?
Hi, I am trying to develop a number selector widget. It has a minus div on the left, a plus div on the right and a number div in the middle. My goal is to allow the user to press the minus (or plus) div continuously and while the element is pressed, the numeric value should change accordingly. Due to a technical problem, I cannot get my setInterval's function to be invoked. I tried to base my solution on this code sample: http://jsfiddle.net/8FmRd/ which works nicely. However, in my code (http://jsfiddle.net/Lcp52t7L/2/),
Unclear mousedown event behavior
Hi, I'm new to jQuery, so I apologise if this sounds silly. I'm referring to the the mousedown API documentation: https://api.jquery.com/mousedown/ Using the example at the bottom of the page, I was expecting the mousedown event to get fired as soon as the mouse is pressed. Instead, when using my finger on my chrome mobile browser, both mousedown AND mouseup events get fired together when I lift the finger off the element. Why is that? Thanks in advance, Nir
Calculate Total
Hi I have below code and i want when user changes Quantity row total & grand Total should also change. Quantity should not be -ve <div class="container"> <div class="row"> <div class="col-sm-12 col-md-10 col-md-offset-1"> <table class="table table-hover"> <thead> <tr> <th>Product</th> <th>Quantity</th> <th class="text-center">Price</th> <th
JSON to Table
Hi, I want to ask how can I populate this json into HTML <Table> with two columns Currency and Rate when populating through ajax success? http://www.apilayer.net/api/live?access_key=6942e4bd7fcd69b95d0ed7f77951697c&format=1 Thanks, Jassim
Webpage's Scroll should be visible When Overlay is Active
Goal: When you open the overlay, the webpage's scroll (not overlay's scroll) should be visible but not active to use. Problem: It is irritated to see that the page moves to the right side when you invisible the scroll and when you visible the scroll the page moves to the right side in relation to overlay. Is there a way to do it? Thanks! http://jsbin.com/lacajijuce/edit?html,css,js,output
running function based on elements id
Hi, I am trying to put together a small function to change the class of a form's input field. I know that I can do this for a specific if but I would like the function to run for multiple fields using the appropriate id. My Javascript experience is limited and so is my jQuery. I am already using jQuery on the page for a dropdown/hamburger menu so would like to use jQuery for this. I would also want to use onChange rather than something like onKeyUp to trigger it as someone might paste with a mouse
Facing Issue on Loading JSON to Bootstrap Tab
Can you please take a look at this demo and let me know why I am not able to load the second layers of data in the JSON to bootstrap tab `tab-content`? var data = { "action": [{ "id": "1001", "name": "Matrix" }, { "id": "1002", "name": "IP Man" }, { "id": "1003", "name": "Revenge" } ], "comedy": [{ "id": "2001", "name": "Iceman" }, { "id": "2002", "name": "Pat & Mat" }, { "id": "2003",
function that returns a element on passing X Y [on hold]
Is there any function that returns a element on passing X Y, if there the location is over a element. We can not use mouse over. Thanks in advance
Two errors: scroll is not a function & Cannot read property 'top'
Hi everybody! I am trying to solve some errors of an online printing company website and I´m stuck in a couple of them. I do not find solution. Both are jQuery errors that can be seen by going to https://www.imprentaonline24.es and you pressing examine and you going to the console tab. Error 1: Uncaught TypeError: $(...).scroll is not a function at www.imprentaonline24.es/:216 Error 2: Uncaught TypeError: Cannot read property 'top' of undefined at HTMLDocument.<anonymous> (www.imprentaonline24.es/:184)
MP3-jPlayer: show the track timeline
On this page I have the MP3-jPlayer plugin with the Text Skin, slightly modified. I need to show, for every track (mp3 files), the timeline instead of the volume bar. How do I do that?
Jquery 1.12.4 selector for href
I was using with jquery version 1.8.2 var hasContainerTab = $("#tabs").find("a[href='#container'").length == 1; I upgraded jquery to 1.12.4 Now that statement is failing saying unrecognized expression: a[href='#container' I referred lot of blogs ( https://github.com/jquery/jquery/issues/2829 ) around this, but I could not find a fix. Can any one tell me how to re-write the statement as per the new version?
trim the length of url text
I have a table that contains links and i want to reduce the visible text for a url if it is over 35 chars. I have managed to do this. However, my script is replacing the link as a string, so users can't click on a link because of my script. I want to keep the url but change the text displayed, how do i keep it all together? here is my fiddle https://jsfiddle.net/wqwyx0tn/1/
Next Page