Adding readonly property to dynamically added input
Hi! Please help me in adding a readonly property to dynamically added input element. Event delegation method? How?
How to queue nested replies below comments on a comment page
Need some assistance to get around this please guys. I’m building a nested comment page on my website with the comments/replies stored in an sql table with colums id, name, title, body, parent_id and time. Parent comments are to have parent_id of 0 while replies to the comments have a parent_id of the id of the comments been replied to. That works perfectly well. Now I have a php page that echoes the output of the sql select statement of these columns as json encoded data : $stmt=$conn->prepare("SELECT
Radio button change.
Hi, I need your help to implement the procedure that allows me to assign status to a student through radio buttons. When set to Deferred or Transfered, it must automatically activate a dialog. I tried different solutions, this is the last attempt, but it doen't work: $ ('input: radio [name = status]'). Click (function () { Alert ("stato ->" + $ ("# status"). Val ()) This is the html code: <?php if ($row['stato'] == 'F' || $row['stato'] == "") { ?> <input type='radio' name='stato'
Serious newb question about disabling a form element when a radio button is checked
Hello! I've been at this for a good portion of the day on and off! A bit of Googling and bit of trying this and that with out much luck! This is my little test form. There's three radio buttons with the name of locations and the id's of a-pos, b-pos and c-pos respectively. Now here's the crazy part. I can't figure out for the life of me why when I click the radio button a-pos that the tday form element disables but when I choose another radio button it still stays disabled. So what am I doing
Remove and Add class at different window width size
Hi there, I am new in this community, Its my first day here. I have a simple problem which I cannot solve, In a div tag I want to assign two classes in different window sizes using jQuery. Two classes are fulsnavi and navigation. I want to remove "navigation" and add "fulsnavi" at window width > 980px and vise-versa. <div id="respcontrol" class="fulsnavi navigation"> <ul> <li><a href='#'>Home</a></li> <li><a href='#'>Products</a></li> <li><a href='#'>About</a></li> <li><a href='#'>Contact</a></li>
$.post [object Object] xhr fail
Hi guys! I'm rly new at jquery, so sry, if it's really obvious for you. I tried debugging for like a day or so, without success. So what I want to do is: Instead the submit I want to do an ajax jquery ($.post) method , which sends the form's data to http://213.181.208.168/tryhard/ URL. So the data should contain a 'token' with a value of 'asd123' (i solved it with a hidden input field if i'm right) and the other forms' values. If the post was successful then under the form a message should appear
reuse result in ajax call
Hi there! I'm using Ajax to get some data from an API. What I need to do is to use store the data into Local Storage when I call get the call back. Next time I'll update the page, I want to get the data from the Local Storage instead of geting the data from the API all the time. I do also have a timer that gives new data from the API after 1 hour. Actually, everything works fine, but my question how I can reuse (and not duplicate) the data in smart way. If you looking into the two functions 'getFromLS'
Beginner need help
Hi everybody, i'm supposed to do something like "2.jpeg", the app is in Ruby on rails but the question is about my jquery script, the cobweb and the words are already placed, but i'm in trouble to display the little cobweb behind a word when i click on a word, if someone could help me please (i know the sass is pretty ugly and not responsive, but this is just for a project and i don't have time to do this right) PS : I'm french sorry if my english is not good enough there is my code here index.html
Loading jquery causes web pixel to be requested twice
MacOS 10.12.5 Jquery versions: 1.12.4, 2.2.4, and 3.2.1 Browsers: Chrome 58, Firefox 53.0.3, and Safari 10.1.1 If I load jquery before the image, there are two requests for the web pixel when the page is loaded. <!DOCTYPE html> <html> <head><title>Before</title></head> <body> <script src="http://code.jquery.com/jquery-1.12.4.min.js" type="text/javascript"></script> <img src="http://example.com/pixel.php"> </body> </html> However, if I load jquery after the image, there's only 1 request for the web
Displaying the array using the index from another.
Hi, I have a two arrays, one numbers and one letters. On output I want to know the best way to display the output so the number, in this case 1,4,3,5,2 would display the correct letter from the other array at that index. This would give me the output of: E?&^@ Is it a simple loop or is there a better way? https://jsfiddle.net/4pk2g966/5/ Thanks in advance.
lambda vs anonymous differences.
so I am trying to to this line of code. $('li:contains("sad")').click(()=>$(this).hide()) and through testing variations on this line I have determined that for some reason when using lambda, ()=>{result}, the $(this) returns a window jquery object but in an anonymous function, function(){return result}, $(this) returns the li element I am looking for. Why would these two notations run differently but serve almost the same function. [included html and js files in txt format for testing.]
Problem with arrays.
Hi, this is not strictly a JQuery problem but I would be grateful for your help. I have created a fiddle - https://jsfiddle.net/a4poster/bLvs827n/. I can't understand if I have a two dimensional array and change one of the values why both arrays change - hopefully the fiddle will be more helpful than my explanation of the problem. Thanks in advance.
How to check if a post already exist on the page before refreshing and appending new posts
kindly guide me on this. I'm building a forum page on my website with functionalities for posts/comments. In my jquery file, i have a variable which holds the html wrapping the posts as below: var postHtml = '<div class="col-md-1"><img src="images/user.png" alt="image" width="50px" height="50px" background="#FC6806"></div><div class="col-md-11"><h5 style="color:#FC6806"><strong>'+user.name+'</strong></h5><h6 style="color:#FC6806">'+user.time+'</h6><h5 style="color:#0269C2"><strong>'+user.topic+'</strong></h5><p
jQuery Conflicting with Other Plugins
First off, thank you in advance for any assistance in this matter. I've inherited a website from another web developer and they're currently using the Top Up Lightbox for all clickable images and videos. My dilemma is this, I'm also trying to use a jQuery Pop Up Overlay on this same site. However it appears that the script CDN's for jQuery that I'm adding seem to be cancelling out the functionality of the Top Up scripts. How can I prevent this from happening and still use both the Lightbox and Pop
How do I avoid this problem
I use this code to load datatable with this method show,add,edit,delete <div class="panel-body" id="content"> </div> function ajaxLoad(filename, content) { content = typeof content !== 'undefined' ? content : 'content'; $.ajax({ type: "GET", url: filename, contentType: false, success: function (data) { $("#" + content).html(data);
Multiple jquery ajax calls to be made from the same page --
Hi All. I need a little help with just a jquery implementation on a particular scenario. Actually I’m a little unsure/mixed up with the concept/what to do in the case I’m about to describe, that’s why asking. Basically, I have a page, where I have a dropdown list. Also a span tag. Now, on the document ready event I’m executing some jquery, filling up the dropdown with items fetched from database; also setting the text of the span tag to the first item from the dropdown. The flow of my application
Passing Soap Action for Post Method using the Ajax/jquery
From the wsdl file by passing the Soap Action with the Post Method in Ajax/jquery need to get the required response . Tried out but getting as XMLHttpRequest cannot load (wsdl url ) Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access. Please let me what is the issue. below is the code I had tried out $.fn.getProducts = function(CustID) { var products
Error as XMLHttpRequest cannot load
Error as XMLHttpRequest cannot load url. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access. how to resolve this . error
html element creation problem
While creating html elements with jQuery, attributes specified in html prevent attributes specified with parameter. http://jsbin.com/tesaviribi/1/edit?js,console function test(html, attribs) { var $a; if (attribs) $a = $(html, attribs); else $a = $(html); console.log($a[0].outerHTML); } test("<div />", { html: "TEST10"}); test("<div />", { text: "TEST11"}); console.log("---------------"); test("<div data-a='x'>TEST20</div>"); test("<div class='x'>TEST21</div>"); console.log("---------------");
Display additional column\field in SP2013 Calendar mouseover tooltip
I'm a fairly new SP Admin, still learning along the way, so please go easy on me.
Have inherited a SP2013 site that has a calendar with various items populated from the associated list. As it is a calendar, I am able to click on the items in the calendar and view the properties (i.e. Start\End Time, Category, Description, etc.). I modified the list to add an additional column (field) to include the name of the person owning the particular event (the Project Manager).
What I am trying to accomplish
Error with Stripe in Woocommerce
Hello we just strart to configure payments, we are in test mode : https://wear.edenweb.ch when i try to send the payment and put the test number i have this message ;: PLEASE ENTER YOUR CARD DETAILS TO MAKE A PAYMENT. DEVELOPERS: PLEASE MAKE SURE THAT YOU ARE INCLUDING JQUERY AND THERE ARE NO JAVASCRIPT ERRORS ON THE PAGE. I asked to Stripe and they told me to see with you Who can help us because all is ok about the configuration, thanks
How to select name attributes of dynamically generated elements in jquery
I have a forum page with dynamically generated reply buttons to reply to comments. Since i cannot use an id for multiple elements, i gave each button a name attribute with the value being the id of the particular comment been replied . How do i select these buttons using jquery? This is what i've been trying but has been throwing up syntax uncaught errors: $(document).on('click', 'button[name='+postId+']', function(e){ e.preventDefault(); alert("it worked!"); });
Read the value from Web.config file
I am using .js file. I want to read the value from Web.Config by Key. I am using this code, but it's not working. var appSetting = '@(System.Configuration.ConfigurationManager.AppSettings["systemAdministrator"].ToString())'; It should take the whole value as string. Can anyone pls help how to get the value ?
// how do I hide only the one I click on and not all of them
<h4>Booleans</h4> <p>Booleans are either <kbd>true</kbd> or <kbd>false</kbd></p> <div id="boolean" class="solution"> <ul> <li> <pre> <code> function testBoolean(val) { if(val == 7) { return "true"; } } </code> </pre> </li> </ul> </div> <h4>Booleans</h4> <p>Booleans are either <kbd>true</kbd> or <kbd>false</kbd></p> <div id="boolean" class="solution"> <ul> <li> <pre>
Array in attribute callout
I'm trying to target a specific class that has an attr (myfield) equal to something from an array & then change the bottom padding: var ipd = 'field1,field2'; console.log('Img Pad string: ' + ipd); var ipdarray = new Array(); ipdarray = ipd.split(','); console.log('Img Pad array split: ' + typeof ipdarray); console.log('Img Pad array: ' , ipdarray); for(var i = 0; i < ipdarray.length; i++) { console.log('field: ' + ipdarray[i]); $('.my-cell[my-field="ipdarray[i]"]').css({'padding-bottom':
jQuery Upgrade from jQuery v1.10.2 to v3.2.1
Problem: Our site has some code that allows for viewers to see the results of thousands of cancer patients, following cancer treatment. The goal is to help folks understand which treatments work the best. This code uses library of code called HighCharts, along with jQuery. We are migrating from an old template to Elegant's Divi Template. Unfortunately, there seem to be issues between the version jQuery code we are using and the Divi Template. The version of jQuery currently loaded on the server
Scrolling div so that checked radiobutton is horizontally centered to the screen
I have some HTML and jQuery code. The idea is that if a radiobutton is checked, the div #kaaviotaulukko should be scrolled to left position of the checked radiobutton. And the checked radiobutton should be horizontally centered to browser window. The problem is that my current jQuery code does not center the checked radiobutton horizontally. $(document).ready(function(){
$('#kaaviotaulukko input[type=radio]').change(function() {
var container = $('#kaaviotaulukko'),
scrollTo = $(this);
Help is this possible - jquery - php - socket - update php variable?
Hi I am new to jquery and I need an answer to this. I have: Index.php: session_start(); $page = "/update.php"; $sec = "100"; header("Refresh: $sec; url=$page"); update.php session_start(); $start_word = "temp"; $FirstArrive = shell_exec("python /share/word.py $start_word"); $stringFirstArrive = explode(',', $FirstArrive); $stringFirstArrive = preg_replace('/[^A-Za-z0-9\+.:]/', ' ', $stringFirstArrive); // Removes special chars. $_SESSION['FirstArriveString'] = $stringFirstArrive; header("Refresh:
Why exist is not determined?
Hi, I am using this code to signup a user and check if the user exists. When I enter an exists user my PHO correctly returns "exist" but my jquery is showing it in a normal alert not the DevExpress alert as if it's an error is there any issue in my if (data == "exist") this is my code: $.ajax({ type: "POST", url: 'https://www.mydomain.com/ws/signin_user.php', async: true, data: formData, dataType: "json", processData: false, contentType: false, success: function (data)
[Concept development] Quiz Start Button, without revealing anything!
I need help with the concept development so that I've some 'starting point' before I can think about the code. Here's what I want to do: I'm developing a quiz software using PHP and I want all the users to land one a 'Quiz Start' page. This page would show a countdown timer and once the specified unix time is achieved, it should convert the timer into a button that takes the user to desired page. Problem: The 'smart' users can view the jQuery and therefore can quickly know which URL I'm going to
Global variable in different scripts not working
Hi Need your help!!! I am new to this and seeking help. I am trying to pull data in an html using xml. For this i have few script used (taken from other sites) 1st script will fetch the data from xml and store in a global variable and the same variable is used in the second script. However when i am trying alert global variable in first script showing the value but alert in the second variable is retriving blank. Please help me. the html code is given below <!DOCTYPE html> <html> <head> <meta
Search omdb api and if no matches are found search local js object
Is it possible to search for a movie with the omdb api and is no results are found search a local javascript object? Here's a jsFiddle of what I have tried so far. I am just learning the basics of jquery and I think this one is beyond me. It does require an api key that I have if required for testing, but the omdb part is working fine. I just can't get the local javascript bit to work
Add Add-ons data to Payment Summary
I have add-ons list with plus, minus icon for increment and decrements count. When user click on + icon name and price with count should added to payment summary. I have used foreach but its not working. $('.js-plus-icon').on('click',function(){ //code } $('.js-plus-minus').on('click',function(){ //code } //html <div class="input-group" style="margin-bottom: 5px;"> <span class="input-group-btn"> <button type="button" class="btn btn-torq js-minus-icon 1" data-minus-addon="1"
jquery dropdown navigation link
I've been trying to use jquery as my dropdown all to no avail. The code below runs like a static href code that goes nowhere whereas the link in the anchor tag is valid. How can i get it to work? Here's the Jquery code: function DropDown(el) { this.dd = el; this.placeholder = this.dd.children('span'); this.opts = this.dd.find('ul.dropdown > li'); this.val = ''; this.index = -1; this.initEvents(); } DropDown.prototype = { initEvents : function() { var obj = this; obj.dd.on('click',
Calling multiple functions with code within fails to call both, only calls the first one
Hi, I need help please. trying to call multiple functions but it fails. it only calls the first one, not the second, I mean it has to call both of them. I use native Javascript then JQuery but still failling. When I take out the code and just leave the alert("") message, it successfully calls multiple functions. The problem is my functions have to contain codes, not only simple alert statement. Please see code in attached TXT file.
A better alternative to window.scrollTop?
I am relatively new to jQuery but I've been able to use it to create a header that changes when the user scrolls. I've been using the following code to make it work: jQuery(document).ready(function($) { $(window).scroll(function() { if ($(this).scrollTop() > 0) { if ($(window).scrollTop() > 20) { $('.move-logo').css({"transition-duration":".4s","height":"60px", "width":"90px","left":"44.7vw"}, 800); $('.site-header').css({"transition-duration":".4s","border-bottom":"solid","border-color":"#4494cd"}).removeClass("site-header-clear").addClass("site-header-white");
My script is returning a full string instead of values.
I have a project I am working on for my own use. I need just the values returned with each in it's own div and to clear the divs if no results are found. I am learning jquery, but I'm having a bit of a struggle working it out. I have setup a jsFiddle if someone has the time to have a quick look at it for me. This is the reponse I get: [{ "title": "Rocky", "rating": "PG", "year": 1982, "plot": "Movie plot goes here Rocky rulez", "poster": "<a href=\"/image name.jpg\">" }]I would like to have a div
callback functions arguments
callback functions can ether be a reference to a normal function or a anonymous function ie $( "#dataTable tbody tr" ).on( "click", function() { console.log( $( this ).text() ); }); or function notify( event ) { alert( "clicked" ); } $( "button" ).on( "click",{name:bob}, notify ); my question is if there data is provided via an event object is there any way to pass the event object to the function if a autonomous function is used?
What is "contextmenu"?
I saw an example on jquery-practical-exercise The entire code <!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<script src="Scripts/jquery-2.1.0.min.js"></script>
</head>
<body>
<script type="text/javascript">
$(document).ready(function () {
$(document).bind("contextmenu", function (e) {
return false;
});
</script>
</body>
</html> My question is what is "contextmenu" here? By the bind Inside the parentheses,
How to save updated text file?
In this post I got response to my question on how to read the text file (using jQuery) and show the information on the page. Reading text file: $.get('Files/Address.txt', function(textData,) { aLines = textData.split("\n"); $.each(aLines, function(n, sLine) { // your code comes here }); }, 'text'); Now the natural following of my previous post: How to update and save the text file with edited contents? Tom
Next Page