getJSON problem in ASP.Net
I have am trying to use getJSON() in an ASP.NET MVC 5 View: var controllerUrl = "@this.Url.Action(actionName:"EditData", controllerName:"Home")"; $.getJSON({ url: controllerUrl }) .done(function () {alert("getJSON succeeded"); }) .fail(function (jqXHR, textStatus, errorThrown) { debugger; alert("getJSON failed: " + textStatus); }); getJSON errors in this part of the jquery.js (version 2.1.3.). When these variables contain: url = undefined s.url = an object containing url: "/Home/EditData"
Autocomplete select problem
Hello, I have made an application with jquery, it have some components like selects, selects with autocomplete...etc. The problem I have, is when I run the application in chrome, when clicking (with mouse) a select with autocomplete option opens correctly, but if I did it with a touch pencil the result is not the same... I have to touch arround that select to open it, and I cant find solution for this mysterious behaviour. I try to change the firing events...from 'change' to 'tap'...but the result
session storage
Hello i'm using html5 & jquery and i look how can save my session with sessionStorage i'm using 3 inputs [ text/password/checkbox] i want when i check the checkbox my session will be saved for example i close my browser and open it it open with my session but i can't do this this my code $(document).ready(function() { $('#submit').click(function(){ //\\ var fieldValue = document.getElementById('username').value; sessionStorage.setItem('username', fieldValue); var fieldValue = document.getElementById('password').value;
Firebug returns without 'holding' last ajax call to PHP on the console
I don't know where to ask this question. However, I would think that most Linux users would use firebug to debug. What is happening is that client calls my php file via ajax and the 'call' appears in the console window very briefly and then exits before I get a chance to look at it. (There are two calls. The first one remains in the console to be examined.) Thanks for help or direction to help. R
TapHold not working on second time
The idea is long press happen, the Cropping function have to take place. But only ontime "taphold" called on first time we press, then it not executed. $(document).on("pageshow", "#pageone", function () { // simply check alert("Hello"); multiply(); }); var multiply = function () { alert("I am inside function"); $("#imgCrop").on("taphold", function () { alert("Taphold working"); //check now $("#imgCrop").Jcrop({ onSelect: storeCoords }); return false; }); } function storeCoords(c) { jQuery('#X').val(c.x);
Javascript file uploader
How to make provision for selecting only image file from file upload box? example:If i click on upload button ,one box will opens that time it only select image file.nt other file
Proper way to Call AJAX with serialization Variable plus other Variables
I am trying to pass not only the serialized form data but a couple of other variables. <script type="text/javascript" > function update() { var str = $('#account').serialize(); var request = $.ajax({ url: "AccountRevise.php", type: "POST", data: {"str":str, "recId":recId, "key":key}, dataType: "json", }); request.done(retData); etc, etc. On the PHP end I try to get the individual values and doesn't work. Need help on passing data properly please.
Split location.href for multiple values?
I have a varient that finds the current url and splits it as follows: var ehref = window.location.href.split('?',1); This is then used to match the url with a navigation link href and give an ID to the page. My issue is that when our cookie pop up is closed, # is added to the url. Subsequently the page links are passed around between users with the # and the page ids do not work. What is a simple way of splitting the url at a # as well? I am new to jquery, thus I understand the gist of what I'm 'reading,'
Problem with val in dialog
Hi, I am having a problem with a VAL() call. I have a page with a button that brings up a dialog to edit values. When the user presses save, I save the values and then call them up again if they edit again. So, here's what happens when the user presses "Edit". 1) Read the values that should go into the Text boxes on the dialog 2) Rebuild the HTML that goes into the dialog div 3) Assign the HTML to the DIV and call the dialog() method to set it up 4) Assign the values to the text boxes using .val()
Array of promises, when and output
Hello everybody, I have a list of promises ($.getJson) and I use $.when to execute all of them. My problem is that I have not understand, how can I get the successful output of these requests also if one failed. Is it possible? Thanks a lot!
trying to replicate this swipe.js, but not working
Hi, I found this : https://labdoor.com/review/sunwarrior-warrior-blend-raw-vegan-protein I like the swipe pagination of the three images, tried to do the same in jsfiddle : http://jsfiddle.net/mlotfi/85rr53fm/3/ but does not work for me. Thanks.
Links after .html() problem
Hi there! I'm trying to modify this tutorial: http://tutorialzine.com/2010/03/sponsor-wall-flip-jquery-css/ in order to add a button to flip the boxes and another to close them. I'm stuck because after adding the content with .html() the '.close' button doesn't work and I don't really understant why... Would you please give me a clue? THANK YOU!!! $(document).ready( function (){ $( '.open' ).on( "click" , function (){ var elem = $( this ).closest(". sponsorFlip "); if (elem.data( 'flipped' )) {
How to "Add Custom Header to all the HTTP request made from a Page" ?
From an X page, I need to add a "dynamic value" in the header. So that, to which ever page i am navigating from the X page, i will get that value in the page i am landing.
An interesting question in regarding element Id
Here is a simple html textbox in my form. < input type =" text" class =" form-control InteractionText" id =" InteractionFinalText" / > Now when I am accessing this textbox value in jQuery I am not getting the value entered in it by writing like this var s= $(".InteractionText").value (OR) var s = $( " #InteractionFinalText" ). value (OR) var s = $( " #InteractionFinalText" ). val() Interestingly it is working fine when I am accessing like this, it was so surprising for me why we should access by
Getting background image width
Hi, Is it possible to get the actual DIV background-image size when background-size of the DIV is set to cover ? Let say the DIV width is 800px and the actual image size is 1400px but when I set background-size : cover the actual background-image size is changing, I want to get this new background-image width.
How can I get Json data from url source code
hi, I want to json data from the website code source. Is it possible ? How do I get the current card price? [website removed]
select option problem
hey guys i'm using $("#language option[value='ar']").attr('selected','selected'); in my ajax script if successful...but it doesn't select the option...now if i run the same code above at the end of the ajax it works like a dream. i don't understand what is going on...any ideas please guys...thank you $(document).ready(function(){ $("#language").change(function() { console.log('changed'); }); $.ajax({ dataType: "text", url: "http://bisi.bid/language",
How do i do this? to put variable in a background
Hi! I did this code to put an array variable in this code below $('#principal').css({"background":"url(../copiaproj/imagem/img1.jpg) no-repeat"}); I did this form, but it did not work $('#principal').css({"background":"url("' + array[index] + '") no-repeat"}); How do i do this to work?
The return result of var x1 = $('<div>') is what?
What is x1 in the statement below? and Can I do that? Is it an object? Does it have properties that I can set on the object itself if it is an object? Or do I have to go thru jquery to manipulate it? Thanks var x1 = $('<div id="d1">some text</div>').addClass('newdiv') Thanks.
Need help with an object
I am getting data from an API cross browser. Firstly I want to get the values from the URL or form, store it in an object then pass the object in as data to my ajax call. However when I look at the request it is encoding the commas and adding room1 to each of the values I need to pass. Can anyone help? my object is var data= { room1:[3,12,11] } the request: &room1%5B%5D=3&room1%5B%5D=12&room1%5B%5D=11 I need to see &room1=3,12,11
jQuery in page
I am connecting my site to an external API cross browser. I have all my code in the page instead of linking it to an external .js file. I have all my code and functions as without using a framework i'm starting to get alot of undefined variables so to avoid this i'm just structuring my code in one script tag (neatly). I just want to know if this is ok? Does it really matter if your code is exposed like this? I guess it does not matter as it is client side anyway right and i'm just reading data?
trying to load automatically a csv
Hi ! I 'm working with database visualisation based on information edited in a csv file. I found this exemple (below). it works like a charm, but i try to get the csv without input button. If you have any idea with how to load it automatically :) thank you so much. <input type="file" name="filename" id="filename"> <div id="csvimporthint"></div> <script> $("#filename").change(function(e) { var ext = $("input#filename").val().split(".").pop().toLowerCase(); if($.inArray(ext, ["csv"]) == -1) { alert('Upload
Scroll down to load page
Hello, A website I use for research has recently limited the amount of items that can be viewed, by requiring users to scroll down before new results are loaded. This was likely done using jquery. Is it possible to disable this option on my end when viewing the page, and enabling the whole page to load? -Avner
input hidden val() returns only first word ?
Hi, I got a hidden input with a value = "vendredi le 20 mars 2015". I debugged and it is really that string in the input and with the following line I get only the first word "vendredi" var newdate = $(result).find( "input[type = 'hidden']" ).val();
Is there a legit Youtube video downloader?
Is there a legit Youtube video downloader? I have tried several from google search but none of them work, if there is a legit program to do this.
.data() Optionally Update HTML5 Attribute
As it is now, the .data() function retrieves the data from HTML5 data-* attributes when the page loads. When data is set using the function, the DOM attribute is not updated, for efficiency. If you want the attribute to be updated as well, you have to then pass the same data to .attr() . .data( key, value, updateAttr ) What I am proposing is an optional third argument (second in the .data( obj ) signature), updateAttr . It would be a Boolean (defaulting to false ). When true , .data() would also
Insert text from database into fixed text box - Spacing Issues
When inserting text into a database: Rsmmmms dnmnmnm jkkjk. dmmmms ammnmn amioiooioioioio. rmmm . Insert lines, spacing and paragraph exact from database into a fixed maximum width and height text box that otherwise has automatic flow and spacing : Prevent this: Rsmmmms dnmnmnm jkkjk. dmmmms ammnmn amioiooioioioio. rmmm. How to use "<br />\r\n" ??? I have an ecards site and all ecards have a double blank inside - -users add own greeting. (hopealley ecards) To have an option for users to
jquery keyboard mapping
Hi, am trying to map keyboard keys to different arrays, such that whenever a key like "a" is pressed in an input field, it will suggest these accents(but not mandatory) "á à ā" . Any clue on how to solve this?
Canvas mousemove event on Item
I have 3 arc starting points on canvas area , so when user drags any one of the arc, I want to draw a circle until he drags in clockwise direction and remove on anti clockwise direction. My issue is how can I get the exact arc out of 3 he is dragging and till what position and direction he dragged. I have tried from google as below but not luck , please see jsfiddle and suggest. http://jsfiddle.net/ineffablep/azh8ma89/38/
Caching a json response from an API
I am getting data from an API cross browser that gets live hotel rates. Is it worth making another call each time you need to filter the results for example filtering hotels from $100-$200? So everytime a use needs to make a filtered request a new call needs to be made to the server (increasing call frequesncy to the server). My traffic is very low volume so I don't really think this is going to be an issue but I want to just ask what the best practice is regarding getting live dynamic rates from
Responsive Circle and Inner Circle
I ham trying to create responsive circle with inner circle in it as in fiddle, If I resize I want outer circle and inner circle adjust automatically how could I achieve that behaviour http://jsfiddle.net/ineffablep/x03f61db/
Toogle jQuery button Up/down
I'm trying to build a button that when pressed will show a down arrow that will to to an ajax script and show hotel prices from low to high, then when you press it again it will change the button up and show hotels from high to low and go to an ajax script and show high to low hotel prices. Not working for me..Any help? function priceBtnSet() { var price = $('#price').find('span'); price.addClass('fui-triangle-down-small'); $(price).toggle( function () { price.addClass('fui-triangle-up-small');
problem with text field in $.ajax POST
Goodmorning everyone In the form I have also, "input text" and "textarea " . The problem is that the text is always changed with the elimination of the spaces between the characters ! Example if i insert in the text and in the textarea the text: " a b c ... " the text that is received in the page URL will be defined as " abc ... " (without spaces !) . If I try to enter " a& nbsp ; b & nbsp ; c ... " is sent ( and received ) is only "a" (all characters after the first char "a " is deleted !!!!) This
:Target and action on a fragment element when targetted from URI #fragment
Hi, Problem : I try to do so that, when a fragment is reached from an URI inside a document, an event with a defined function should be activated on the "targetted fragment". The reason for context : The function will adjust the position of the targeted fragment : note : the top of window is occupied by a sticky menu and the auto scroll (by navigator) into the document sets the "targeted fragment at the top of window then it is hidden by the menu With CSS : when from a link a URI list <a href="#fragment_id"> which
Checkbox to add/subtract the total amount
I have a form which has basic computation like adding and subtracting the amount of money to be inputted by user. Now, everything works fine, except the "Penalty" field, I want the user to click the checkbox (checked) if they want to add the amount in Penalty field in "Total Payment" field and uncheck to remove the amount of penalty field in total payment. and also is it possible, if the penalty field doesnt have amount, and the user clicked the checkbox it will return a notification saying please
Use placeholders or output to html
What is the best way to work with jQuery and HTML? Is is best to setup as many container areas with all the (empty) tags in HTML or write one container div and output or append it in jquery. I am finding the later easier but want to know for best practice. Thanks
find anchor tag id within li
<ul class="tabs"> <li class=""><a data-toggle="tab" href="#dashboard "><i class="soap-icon-anchor circle"></i>Dashboard</a></li> <li class="active"><a data-toggle="tab" href="#profile"><i class="soap-icon-user circle"></i>Profile</a></li> </ul> How to get href attribute of anchor tag within <li> tag having class tabs but when i click on any li
problem with expand textarea and submit
Hello Guys :) can i ask you something :( i have a trouble with auto expand textarea . i want the best jQuery code to expand the textarea when i press the Shift+Enter . and the enter key be to submit the text area :) so when i press enter i want to submit the form and when i press shift+enter the textarea be expanded and how can i check if this textarea is submit because i have many textarea in the page :(
PieChart linking to table (High = Red, Medium = Yellow & Low = Green
Here is my HTML code. I am trying to get the PieChar to link to the "Findings Table" so when the Severity column gets a High , Medium or low the chart builds from that.. <!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"><head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>details</title> <link href="details.css" rel="stylesheet" type="text/css" /> <script
How to give colour tr with max id in Table
Hey guys i'm trying to give colour in tr table which has max id (Higher id) , if you guys asked what i have done already try using this http://stackoverflow.com/questions/12556647/get-highest-number-from-table-cell-content but i cant get the value when change in tr , Thanks here is my jsfiddle http://jsfiddle.net/dauruk0512/s7kms16t/
Next Page