Avoid finding readonly text inputs
$(this).closest('form').find("input[type=text], textarea").val(""); I would like to change the above to avoid finding any readonly inputs. The documentation for the :not doesn't meet my needs.
Whats wrong with the jquery?
<form> <input type="text" id="inputs" > <button id="mybutton">Write here</button> <div id="list"><ul> <li> </li></ul></div> </form> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"> $(document).ready(function(){ $('#mybutton').click(function(){ var mytext= $('#inputs').value(); $('#list').append('<li>'+ mytext + '</li>'); }); }) </script>
append value to an element dynamically
I want to put values into an array dynamically and get the same from a click event and put some text into the element. All this happens on the fly. I am not sure why the following piece of code fails. Everything worked except this line : $(gval[0]).append(" Bro, whats up? "); Code : var gval = []; // Headers to initialize jquery $(document).click(appendThisHere); function appendThisHere(e){ gval.push("\"" + e.target.nodeName + "\""); $(gval[0]).append(" Bro, whats up? "); } Any help appreciated !
capture iframe window as a image??
there any js libraries out there to capture iframe windows I render 3d model from 3d rendering platform in to my web page using iframe so i need to capture that 3d model from web page
Ajax problem ?
Hi guys. I am new here and apprentice jquery. I am using ajax to send data to a php file, so far so good. the problem is that the ajax does not get the response that comes from php? below follows the scripts: Jquery: $(document).ready(function() { // $('body').hide(); $('body').fadeIn('slow'); // $('.data-send').text('Enviar').click(function() { // var ws_safe_email = $('.ws_safe_email').val(); // $.ajax({ type: 'POST', url: 'datacheck.php', data: { ws_safe_email:
call a php function to autofill a form field
I have a php function string_creator($length) to create a random string. When I want to autofill a form field with that php function via a link, I was using sajax script. It was something like: <?php sajax_init(); sajax_export("string_creator"); sajax_handle_client_request(); ?> <script type="text/javascript"> function string_creator_complete(key) { if (key == "") { alert("error"); } else { document.forms.formName.fieldName.value = key; } } </script>
How to find the next element above an inner element with class=bbb?
Assume we have the following web page source code ... <p> .... <p ....> <span class="aaa"> <a class="bbb">....</a> ...sampletext </span> </p> </p> How can I address/refer only (!) to the next <p> element above an inner leement which is defined by class=bbb? If one can refer to a simple string like "sampletext" then one could write successfully: $("p:contains('sampletext')").eq(($("p:contains('sampletext')").length) - 1).css("display", "none"); But what if I do not have identifying string like "sampletext"
Convert jquery string to object
I have var a = 1; var b = $("#abc").val(); here i am getting b as "a" only, but i am not able to access the value.Please help me on this
Ajax, problems of transaction between two div
Good morning , I have a problem with this script that performs the dynamic transaction pages without making the visual effect of page load , typical od server side languages. The Script is : /* <!--<script type="text/javascript"> $("#panel_container_sx a").click(function (e) { e.preventDefault(); // $("#submenu_11 a").click(function() { var param = $(this).attr("id"); $.ajax({ type: "GET", url: param , success: function(response) { $("#panel_container_dx").html(response); } }); }) </script> */
Ajax GET and POST method
I am currently using ajax GET method to pass my value into the same page. I look at the console.log, the requestURL is able to pass the value like www.example.com/test?q=1. unfortunately,when it request by the server site, the get value is not assigned to the variable $_GET['q']; As a result, i couldn't manipulate the value after the request. Do you have any idea what've I missed ? or it is fundamentally not allow to do in the same page. $anyvar = $_GET['q']; function showData(str) { bool = false;
Currently i am doing a school project, i want to do a mouse over on canvas element which is the draw image motion to display the date and time in my sql database
<script> window.onload = function() { var outputx = <?php echo json_encode($outputx) ?>; var outputy = <?php echo json_encode($outputy) ?>; var outputid = <?php echo json_encode($outputid) ?>; var c = document.getElementById("canvas"); var ctx = c.getContext("2d"); var backgdImg=document.getElementById("bg"); var motion=document.getElementById("mt"); var pat=ctx.createPattern(backgdImg,"repeat"); ctx.rect(0,0,1020,600); ctx.fillStyle=pat; ctx.fill(); var i = 0; var
Disable back button in All the browsers using Javascript
I'm trying to find a way to disable the browser back button. After some googling I found this page: Disable back button in browser According to this page the best method is using this code: history.pushState({ page: 1 }, "title 1", "#nbb"); window.onhashchange = function (event) { window.location.hash = "nbb"; }; But, there is no explanation for the code. What is "title 1"? nbb is just an ID? Can some one please explain the whole code a bit more? Thanks
Rotate image follow mouse jquery with smooth transition
I am trying to make an image rotate when you hover over certain items on the page. It uses the solution provided here (with edits for my purposes): http://stackoverflow.com/a/10235298. You can see an example of what I am trying to achieve here: https://jsfiddle.net/t100gq25/ HTML: <div class="container"> <a href="#" class="menu-1"> <img src="http://placehold.it/140x35&text=4" class="animation-trigger"> </a> <a href="#" class="menu-2"> <img src="http://placehold.it/140x35&text=1"
Show and hide div, css, ancher point
Hej, my first post here and really need your help. I have made this site http://tinemuller.dk/gis-afdelinger/ with info for each council and hope all 98 councils will use my service and then it will be a very long doc. I found this site https://www.zetland.dk/ and really like the way they use +/- to show a div. and would like to use the same on my site so when people click on a council they see the info for only this council. Would also like if it was possible to anchor to each councils info so it's
Jquery search between two dates
I have problem with Jquery searching between two dates. If I search like this: 18/02/16 - 30/05/16 I can find files which is between them. My problem is that im searching it like filename because file date is in filename. (When file is created) My directory tree: function DirTree(title, ajaxcall, post_action){ $('#big_modal-2').html(' '); var output = '<p class="lead text-search-info">'+title+'</p>'; output += '<hr />'; output += '<p id="dir-links" class="lead"><?php echo
how to append values in dropdownlist box using another dropdownlist
I have 3 textboxes.I need to append values according to previous dropdownlist .I have retrieved val for 1st textbox from json file(autocomplete) I have some values in 2nd field , I need to append values to 3RD field according to 2nd field.. I have retrieved values. But need to append to dropdownlist. I need to get the length of retrieved values.(count the retrieved values) I am getting undefined. please check the updated link.. and screenshot. https://plnkr.co/edit/C6ODswCppxH6uZlOtjCB?p=preview
Do selectors make a copy, or do they point to the actual element?
I have the following code: var elementList = document.querySelectorAll(".dotImageCommentClass"); top = elementList[0].offset().top; A diagnostic alert tells me I have an image (or array of them) but I get an error that the 'offset' property is not supported! Why is that? Thanks.
If I iterate through a selector, what order of elements do I get?
Suppose I dynamically add three images, one after the other, to my document. They all have the same class, so I can use a jQuery selector for the class to retrieve them all. The third image has a position on the page near the top. They are all within a DIV. I would like to retrieve them in order that the appear to the human eye. But a class selector would retrieve them in the order that they were added, so the image nearest the top of the page is retrieved last. I suppose I could sort the images
Build HTML document with jQuery to set it in iframe
am receiving from server full HTML code of different pages as string: $.post($form.attr("action"), $form.serialize(), function(responseText) { console.log("text received"); //Setting dynamic content to iframe method * }).error(function(p1, p2, p3){ alert("error!"); console.log(p1 + p2 + p3); }) ; Setting dynamic content to iframe method 1: var s = $(responseText); $('#FileFrame').contents().find('html').html(s); Setting dynamic content to iframe method 2: var $frame = $('#FileFrame'); var doc =
more.. after 50 chars
I have a field which has a lot of content. I want to apply a logic where i would extract out content with 50 chars and will be aadded by (more..). However, i want to apply it in such a way that the content can be less than 50 chars but should involve all the full words. So that "This is a test" should not become This is a t(more..). rather it should be This is a (more...) How do i achieve this in Jquery or javascript. thanks
Stop scrolling page if menu item not contain a function into link
Hi at all in my web site www.iomla.net I have an accordion menu animated by this script: www.iomla.net/acc.js. It work very well but clickin into an item not containing final link the page scroll to top instead of staying steady waiting for next choice. It'ld can scroll the page to top only clicking last choice containing link to page that is a function. Thank you very much
Access to nested JSON
Hi, I tried to to access the following json: var data = [{"nodes":[{"id":"node_id_1","label":"node_label_1","title":"","group":"0","content":"","x":"-305.451","y":"-173.162"},{"id":"node_id_2","label":"node_label_2","title":"","group":"0","content":"","x":"-234.961","y":"-98.5864"}]},{"edges":[{"id":"6","from":"node_id_8","to":"node_id_5","label":"6","title":"6","group":"node_id_8","content":"node_id_5"},{"id":"undefined","from":"node_id_8","to":"node_id_5","label":"undefined","title":"undefined","group":"node_id_8","content":"node_id_5"}]}]
AJAX -> storing result in variable using callback (undefined)
I have a question to a very common problem. Probably dozens of question have been asked with regard to this. But unfortunately, I am not able to solve my problem anyway. Maybe you can help me! I have the following code: function get_network_from_database(callback) { $.ajax({ type: "POST", url: "load_network.php", data: "json", success: callback }); } function myCallback(result) { return result; } var matrix = get_network_from_database(myCallback); Now, when I alert matrix then it says undefined but
Help required formatting a Jquery form?
I am using some JavaScript code which I have copied which created a book now button for booking a hotel room. When I add to my Joomla website template the form is not displaying as it should. It should display in just one line but it is currently displaying with line returns and over several lines. I have found some of the base code in the JS file but I cant work out how to get it to display correctly in just a single line. What it is displaying like can be seen at the following WEBLINK you need
Removing Web Referrer
Hello, I advertised a website. Problem is visitors coming from that site with "Web Referrer" . I want to remove "Web Referrer" . I think referrer showing because that website have frame. Anybody can give me a solution for removing web referrer ? Regards...
How does Twitter shows data - How does the logic behind works?
Hello, Today I wanted to show users comments on my website in a twitter way, no refresh, new comments showing up on all the user browsers. My first question is, what kind of logic would you use to show comments: 1)Use Jquery in a way that it detects when the user is not touching the screen or using the keyboard and send an ajax call after a given amount of time(let's say every 10 seconds when the user does not touch his screen or keyboard). 2)Check time of comments insertion in the database and add
Return value to parent function, how to wait for asynchronous function
I have Following code, I am checking height and width of image. this is a part of script. Please help me for this. Thanks in advance _filesCheck: function() { var result = false; if(n.ftype=='image') { var reader = new FileReader(); //Read the contents of Image File. reader.readAsDataURL(f.files[0]); reader.onload = function (e) { //Initiate the JavaScript Image object. var image = new Image(); //Set the Base64 string return from FileReader as source. image.src = e.target.result; //Validate the File
Update Stock Input Value for each Same Item Selected
I have a problem, I need to update the stock value (real-time) for each select box that has the same Item, for example on the image attached, there are two select input that has the same item. I want the stock quantity on the second row to be updated depending on the difference of stock quantity and quantity input. Example: 1st Row: QTY: 3000 , STOCK : 6000 2nd Row: QTY: 5000 , STOCK : 3000 (3000 because on the 1st row the stock has been deducted by 3000) Hope you can help. Here's my code below,
Why is my jQuery button handler not being fired?
I have this jQuery to respond to a button being clicked and call an AJAX method: $(document).ready(function() { $("#btnGetData").click(function() { alert("The button was clicked."); var unitval = _unit; var begdateval = _beginDate; var enddateval = _endDate; var model = JSON.stringify({ unit: unitval, begdate: begdateval, enddate: enddateval }); $.ajax({ type:
How to hide keyboard when element is on focus is a dropdown
I am trying to stop mobile keyboard from showing when the element on focus is a drop-down but it still does not work. My code looks like below. Any ideas how I can achieve this. The problem is only on mobile. Please note that the HTML is structured the by author of the plugin that I am using. It is the "marital status field" on this page. // jQuery $("#s2id_autogen1").attr("readonly", "readonly"); // HTML <div style="width: 100%; max-width: 1903px; display: block;" id="s2id_marital_status" class="select2-container
show or hide div based on mysql count value without reloading page
good day everyone. I am newbie to programming and trying to build a web site. In this site, i want to show or hide a div based on the row count returned by mysql table without reloading the page. If the row count is 0, the div should be hidden. If it is greater than 0, the div should be shown without reloading the page instantly. Any help would be greatly appreciated. Thanks in advance. Good for all.
inport jquery in html
im trying to use jquery in html. this is what i got so far but it doesnt work: is it the code or am i inporting it wrong? screenshots in attachments
Is there a way to count video playback views after 30 seconds?
Hello, I am going to host a video website with Vimeo players, I would like to know if there is a way for Jquery to actually detect the play button being pressed, then counts to 30 seconds and finally sends an ajax call to a PHP script to insert +1 view in a video_view table? I can manage all the php and mysql part but I am unsure on how to detect a click on a "play button" and then starts a counter that works on any devices that kick start an ajax call 30 seconds later. Any help would be more than
open menu on map jquery
check this js fiddle I try to show menu .. menu is display but also display immediately whereas i want menu display and when click anywhere then want to hide and now when i display map then menu not display check jsfiddle please https://jsfiddle.net/kcpppzmf/2/ like this
struggling to combine jquery with asp.net
Hi firstly i am not an experienced programer or web developer so my code is basic. I have a simple carousel which works however when i try to add a text box or any other asp control i cannot seem to recognise the control so that i can add code to an event like click a cmd button. ultimately i want to select the an image in the carousel and trigger an event that will update the text box with a value relating to the image. can someone please give me some code that either shows me how its done
Move from 2.1.0 jQuery version to jQuery 3.1.0, I'm getting following error "angular.min.js:107 Error: Syntax error, unrecognized expression: #"
We are switching to 3.1.0 jQeury recent version. It was everything working fine earlier version of jQuery 2.1.0. The version of jQuery 3.1.0 I'm getting issue of selector (#) Error: Syntax error, unrecognized expression: # at Function.ga.error (jquery-3.1.0.min.js:2) at ga.tokenize (jquery-3.1.0.min.js:2) at ga.select (jquery-3.1.0.min.js:2) at Function.ga [as find] (jquery-3.1.0.min.js:2) at r.find (jquery-3.1.0.min.js:2) at r.fn.init (jquery-3.1.0.min.js:2) at r (jquery-3.1.0.min.js:2)
Script Question
I came across this script: <script> $( "<div/>", { "class": "test", text: "Click me!", click: function() { $(this).toggleClass( "test" ); } }) .appendTo( "body" ); </script> Is the script above, setting up a function for the newly added "Click me!", in that it is supposed to disappear from the page it is on, when someone clicks on it? if not, what should be expected from this script; I "tried this code out"; and "Click me!" is unfunctional.
Classic Jquery scroll with Flexslider
Hi, I have a index.php with very menu items. When i click on my menu anchor link, the page scrolls to it's own anchor name attribute and, WITHOUT FLEXSLIDER everythings works fine. With flexslider fullscreen activated i can't scroll down slowly anymore. It seems like anchor tags on my menu items are disabled by flexslider. Is there a way to fix it? In the Flexslider folder I have found slider.css files and at this row: body, html {margin:0; padding:0;width:100%;height:100%!important; overflow-x:
jquery trigger
I am using jquery 1.8.3.I have to populate two dropdown based on the value from another dropdown.I did it but the problem what i facing is the dropdown working great in chrome it is not working perfect in firefox.Here is my code <script type="text/javascript"> $(document).ready(function(){ $editid = '<?php echo $addid ?>'; //$pages.trigger("change"); var $pages = $('select[name=adPages]'), $positions = $('select[name=adPositions]'), $dimensions = $('select[name=adDimensions');
what properties can we make animate on?
In addition to style properties, some non-style properties such as scrollTop and scrollLeft, as well as custom properties, can be animated. that is from the documentary i want to ask,beside scrollTop,is there other properties can we make animate on?
Next Page