Using URLs as ids
In our markup, we often use full URLs as ids. example: <li role = "treeitem" aria-selected = "false" aria-level = "2" aria-labelledby = "http://anode.com/someidhere_anchor" aria-expanded = "false" id = "http://anode.com/someidhere" class = "jstree-node jstree-closed" ><i class = "jicon ocl" role = "presentation" ></i><a class = "janchor" href = "#" tabindex = "-1" id = "http://anode.com/someidhere_anchor" ><i class = "jicon jthemeicon" role = "presentation" > </i> funnode
jQuery slideDown() not actually animating
I'm trying to use slideDown() when displaying dynamically created elements. I find that the delay works, but there is no animation, the div just pops up. I've set the width, I've read you need to have a fixed width in order for jQuery to run the animation smoothly, but that still has not helped. I had no issues when using slideUp() when removing the element, only on creation with slideDown(). Any help would be great. $(document).ready(function(){ //Stop the form from submitting $('#submit-form').submit(function(e){
JQuery Ajax AND Form Post
Hi, is it possible to have both jquery ajax and form post action so if the JQuery ajax failed for any reason then form will be posted via normal post action? Thanks, Jassim
JSON parsing
I need help on why this jQuery JSON query is giving me some errors. If I put in a comment in the log, it works. The URL also works but when I tried to output the data, it doesn't. $.getJSON('http://api.openweathermap.org/data/2.5/weather?zip=55101,us&appid=44db6a862fba0b067b1930da0d769e98', function (){ console.log(data); }); The errors: Uncaught ReferenceError: data is not defined(anonymous function) @ script.self-42c73cab471cc6fce85758d31965f2a5447440b79e37b9eaf5ce8a80e800805b.js?body=1:2fire
background function
I need a function which continuously runs in the background. it must have the following characteristics. 1) Does not interfere with other code which runs procedurally when the page loads or in response to specific events. 2) Can be started and stopped at any time. 3) Can be paused at any time (and of course started again where it left off) how can i do this
JSONP
Can JSONP be used with any API/server which returns JSON or does the server have to support JSONP
cross domain AJAX call
I am attempting to make the AJAX call at the bottom of this post using JSONP The URL is a vocab server - it takes text strings and returns search suggestions. The (this).val() value is the content of a input box. When I make this call from Chrome with security turned off (so that cross domain restrictions are removed) it works. It does not work in normal mode because of the cross domain restrictions. I cant seam to get JSONP to work. I have tried copy/pasteing the following attributes from a different
content-security-policy flagging globalEval
I'm implementing the header content-security-policy and cleaning up code as I go. My main sticking point on the javascript side of things is that jQuery-1.11.3 violates the eval policy: Uncaught EvalError: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'self' Is there a way around this other than the unsafe 'unsafe-eval' policy? It seems to me that to go down that route negates a large
TypeError: view is null Line 5645 of jquery-2.2.0.js
Just upgraded from 1.11.2/2.1.3 to 1.12.0/2.2.0 and I get the following error: TypeError: view is null https://hqcuiwebi2ms.area52.afnoapps.usaf.mil/i/jQuery/js/jquery-2.2.0.js Line 5645 Code: // Support: IE<=11+, Firefox<=30+ (#15098, #14150) // IE throws on elements created in popups // FF meanwhile throws on frame elements through "defaultView.getComputedStyle" var view = elem.ownerDocument.defaultView; if ( !view.opener ) { view = window;
window doesn't close
HTML <button>open window</button> <button>close window</button> <button>has i been opened then closed?</button> JS var myWin; $('button:first').click( function() { myWin=window.open('','myWin'); } ); $('button').eq(1).click( function() { if (myWin) { myWin.close(); } } ); PROBLEM If I click 'open window' button it opens a new window. If I proceed to click 'close window' it doesn't close. Why?
Crate a drop down with LDAP condition
I want to make an drop down that will only show certain results depending on the group a logged on user belongs to. I have no idea where to stat and hope someone could guide me in the right direction.
transform: translate not working after jQuery has set CSS transform
Hi I would be grateful for any help here. If I set a transform:translate(x,y) using jQuery I don't seem to be then able then set another transform:translate(x,y) using CSS. I've provided a Codepen example. If you comment out line 13 (where jQuery sets the CSS transform) of the JS window and click Run, when clicking the button, the transform works fine. If you remove the comment and allow jQuery to initially randomly position the element and then click the button, translate(x,y) doesn't seem to work.
jQuery image sliders
Hi, can you advise jQuery plugin image sliders you use or know? Animation should include slide and fade. I also want images allowing text overlay and hyperlinks. So is there any which has all in the package?
Update the data of the table without using refreshing function based on input textbox
Goal: When you write any letter or number in the id="searches" you should display new data in the table without refreshing the website. The effect of using the "refresh" or similiar effect is to use F5 function. You update and not refreshing the table. When you empthy the input text box (id="searches" ), the default data should display. Default data is: <table border="1"> <tr> <th>a</th> <th>b</th> <th>c</th> </tr> <tr> <td>1</td> <td>2</td> <td>3</td> </tr> <tr> <td>3</td> <td>4</td> <td>5</td>
Update the Formula not refreshing the page
Goal: WHen you press on the feedback button, you add som data in the formula and then you send it away. In the last approach, you retrieve a feedback message "Thank you for your feedback!" Problem: How should it changed from Feedback formula to the feedback info "Thank you for your feedback!" in the same page without refreshing the webpage. What technology do you need to use in order to achieve the goal? I was thinking about json, angular etc. You update and not refreshing the page. Info: I'm using
Trying to replace text in a paragraph - but breaking other <p> tags on page
Hi guys! This is my first post here on this forum. I've searched around here and can't seem to find the answer to my particular issue. So, the issue I'm battling is probably elementary for most folks here. What I'm trying to do (and failing at) is replace a phone number wherever it appears in paragraphs across a website. While I've been able to get the .replace to work, somehow it is breaking other elements on the page(s). For example, on a blog post page, it nukes the links for the blog author and
Passing an Array of Dates to Datepicker - Issue with Date Format
Hello Everyone, Im using datepicker to highlight a few dates that are pulled from my Database Ive Followed Instructions by Jake From the thread below & got almost everything working(Thanks Jake) Original Thread However im facing issue with date's Format Ive Noticed Dates work When i pass them as : var datesArray=['2016-7-1','2016-7-2'] However the same date when Passed as: var datesArray=['2016-07-01','2016-07-02'] Fails to be highlighted In the Datepicker My problem is The Array in Which my Database
Malformed selector fails when using $el.find(..), but not when using $(..)
I came upon what I think is a bug when trying to refactor some code to use a common parent element. When splitting the selector up into a common part and using .find for the specific part it suddenly failed with a Syntax error since the attribute selector is missing the closing bracket. Using just the specific part as the selector in the main jQuery function works though, as does using a compound selector. Is there a difference in how selectors are parsed in the $(..) function and in the find(..)
howto migrate jQuery 1.6 (!) AJAX requests to work with jQuery 2.0
Dear all, sorry for this (probably sounding stupid) question, but I have to migrate an existing application (which was developed by someone else years ago) from jQuery 1.6.2 (I know...) to a recent version (let's say 2.2.0). Whenever I use any version of 2.x jQuery the application breaks, however it seems (at least partitially) to work with jQuery 1.12.0. I do positively know the problem is with the usage of AJAX requests, so I hope someone could guide me towards a kind "howto migrate jQuery 1.9
Sub Total Basket
Hi, I'm trying to create a sub total cart using jQuery. I create a pen which you can see here: SubTotal with jQuery Although it seems to be working but I'm not happy with the code. One big issue is that because I want to have the cost, subTotal and the Total-Cost all calculated when you first open the page, I have to repeat the same code once inside the document ready and once after click on + and - sign to increase or decrease the quantity. Could you please help me to improve my code? How can I
fixing some issues and adding some buttons for simple calculator
Hi, I'm just trying to fix some issues on my simple calculator. I only have 3 issues right now that I am trying to fix. 1. When I'm trying to click the +,/,* and - twice the result will be NaN, how can i fix it like even if I click it twice it will be the same in clicking it once. 2. How can I create a default value of 0 that when i click a number the default value will automatically remove. 3. How can I add a maxlenght on my textbox? I also want to add 2 buttons. a backspace button and a decimal
Trying to refresh a div on a form submit to display the newly added array values without the page refreshing.
I have a form to create a new item in the db, it does this through ajax. I also have an array on the page displaying all the current items. When I add a new item using ajax i want the items array to update and display the new item. I'm using ruby on rails with the gon gem to make the js array so the js array isn't getting the values from the db its getting them from the rails array which is getting it from the db. If I update the js array on form submit it will still grab it from the rails array
Get form element
I am unable to get the form element due to some reason. Infact these elements are on bootstrap modal called by ajax. Below is my code <form action="#" method="post" id="myform"> <input type="text" class="name" placeholder="Your Name" id="name"> </form> Below doesn't work: name=$("input#name").val(); name=$("#name").val(); name=$("form#name").val(); name=$("#myform #name").val(); name=$("#myform input#name").val();
disable message and show dialog
Hi, I am using jquery validation and I want to disable the appended or inline messages and display it in a dialog instead. So is it possible to set the: messages: { firstname: "Enter your First Name", lastname: "Enter your Last Name", email: { required: "Enter your Email", email: "Please enter a valid email address.", } } but then show in it: $('#msgAlert').html(message); $('#dialogAlert').popup(); $("#dialogAlert").popup("open"); Thanks, Jassim
Responsive design
I have a rather elaborate website that was designed without considering responsive design. I am now trying to rebuild the site as a responsive site. I am a newbie to j query with a background in animation(After Effects and Flash). I want to be able to load and entirely new page when I minimize the screen to under 650 pixels. Is it possible to this? Thanks in advance.
How To Retrieve 'lat' and 'lng' from google maps 'location' object.
Hi, I have the 'location' object from a google map listener event. alert(location) shows something like this. (46.05734091267766100, -114.173083371296539075) I want to have the var 'latitude'=46.057340 and the var 'longitude'=-114.173083 . I will then use AJAX to insert the value of these variables into my DB. Nothing I do seems to work to split 'location' up. R
How to add a class to a string with characters longer than...
Hello, here is what I have so far. The problem is that, my class is added to every instance even if characters count is less than 50. What is wrong here. I will appreciate your help. var slideTxt = $('.homepage-two-column .jcarousel-wrapper.slideshow .slide .caption .inner .desc h2 a'); $(slideTxt).each(function(i) { var iTotalWords = $(this).text().length; console.log(iTotalWords); if(iTotalWords > 50){ slideTxt.addClass('Class60'); }
multiple arguments with the same name
regarding the data argument of .ajax() is it possible to have two keys with the same name (but different values) is data : { month:'june', month:'july' } is not how would I go about makeing a get request where multiple values have the same name as per the bellow example from here https://lucidworks.com/blog/2009/09/02/faceted-search-with-solr/ This is a sample GET request where multiple fields are called facet.query so that multiple values can be passed &facet=true
&facet.query=price:[* TO 100]
URL encoding double quotes
I am using ajax{} to make a GET request part of the data attribute looks like this data : q : 'pub_title:' + solrCompatableMainQuery, solrCompatableMainQuery is input from a text box the : in pub_title: gets converted to %3A (url encode) as it should. However solrCompatableMainQuery needs to be surrounded by double quotes and these are not getting encoded I have tried this data : q : 'pub_title:' + '"' + solrCompatableMainQuery + '"', and i have tried this (before the ajax call) solrCompatableMainQuery
File upload issue when more than 1 file field
Hi, I have a form with 5 <input type="file" .....> fields each with different names. I have the form in a bootstrap modal so am using jquery to post my form and on successfull uploading I will close modal and give a message saying files uploaded successfully. As the user adds a file I want to add it to some sort of structure then when the user clicks the submit button I want to loop through this structure and upload the files, I have used the functionality at http://abandon.ie/notebook/simple-file-uploads-using-jquery-ajax
Getting drop-down select value for each row
Hello , Having some problem reading data from each row from this table. Given http://codepen.io/caim/pen/pggZOx I'm trying to replace the first column from input to select dropdown but having trouble figuring out how to read the data for each cell. It was working fine with an input and normal td but now the select entered the picture and it's skipping one column. The day drop-downs are for newly added rows currently. This is how I'm trying to read the data $BTN.click(function () { var $rows = $TABLE.find('tr:not(:hidden)');
Issue On Using Text() or append() in a loop to add Markup as String to a div
what I need to do is adding some html markup as string/text to a div .result I already tried to do this by using .text() function for (i = 0; i < 5; i++) { $('.result').text('<p class="para-' + [i] +'">Paragraph</p>' ); } <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <div class="result"></div> but this only adds the last paragraph into the .result then I tried to use the .append function but this one taking the string a markup and adds it to the page
Menu collapse flickering
<header class="head-section"> <div style="background-color:black;"> <br/</div> <div class="navbar navbar-default navbar-static-top container" style="background-color:black;"> <div class="navbar-header"> <button class="navbar-toggle" data-target=".navbar-collapse" data-toggle="collapse" type="button"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button>
formvalidation vs jquery validator
Hi, I would like to ask, from your experience which one you prefer to use, jqueryvalidation.org or formvalidator.net because I am having unresolved issues wth jqueryvalidation and thought if you have another better option. Thanks, Jassim
Windows 2012 Compatibility
Hi Team, We are using 'Jquery-1.8' currently for our production environment which is on a Windows 2008 (64 bit) box. We plan to upgrade our servers to Windows 2012 (64 bit) with IIS 8.0. Kindly let me know whether 'Jquery-1.8' is compatible with Windows 2012 (64 bit) server with IIS 8.0. Thanks in Advance Sanjay
Need help to delay 2 seconds before sending json request
Below is my script. It's a autosuggestion search script. The problem is that it penetrates the server with a huge amount of requests (it sends a request after each inserted character). I need to change the script so that it waits 2 seconds after user has finished typing (and has inserted at least 3 characters) and only then sends request to the php file. (function($){ $.fn.fsearch = function(){ var $searchInput = $(this); $searchInput.after('<div id="divResult"></div>'); $resultDiv = $('#divResult');
return from function creates: detailed error: TypeError: retData is undefined
Yesterday I submitted a question 'Google Map Not Loading'. A disaster!! Before I can deal with the google mapping issues I have to be able to pass the data properly from the database. The idea is to access a MySql database containing Marker information, create a 'dynamic select options list', make a choice, create an array of data from the choice and return the results as an array to a function which will create a 'google map'. This is my re-write and I can't get the data to pass the array from
How To count 1 to 10 and in every number wait 5 seconds
hi friends, how to do: count from 1 to 10 and wait 5 seconds, sample: 1 5Seconds 2 5Seconds.. 9 5Seconds 10 here i am try to do: https://jsfiddle.net/jamiguel77/Ld11bnn3/ The count start when user click on button Greeen: "calcular" immediatly i see an alert and the div green witha 11 how to animate this? thanks
function attached with a button not working after changing its id in ajax success callback
When I click the button its id, name and val attribute change successfully in ajax success. But if If I click it again the old function attached to the previous id is called not the one attached to the new id. I checked other posts but they did not worked for me either. <input type="submit" name="textareaInsert" id="textareaInsert" class="textareaInsert" value="Insert data"> //script $(document).ready(function() { graph_post_data(); graph_update_data(); });
Question about val() method on drop down select
Please refer to https://jsfiddle.net/edby27mL/4/ HTML <select multiple> <option value="volvo">Volvo</option> <option value="saab">Saab</option> <option value="mercedes">Mercedes</option> <option value="audi">Audi</option> </select> <div></div> JS $('select').change( function(event) { //selArray=$('select').val() || [] works // this doesnt selArray=$('select option:selected').val() || []; $('div').text(selArray.join(', ')); } ); Here $('select option:selected').val() doesn't
Next Page