Looping through Ajax JSON and only show entries where x=foo
Hi everyone, Usually I'm using jquery like this, please let's discuss if I could do something better: I'm loading the jsonfile as a global variable (called jsondata) and loop through it with $.each In this example I want to get all the Ages for the people with the first name Martin $.each(jsondata,function(index,value){ if(value["First Name"] == "Martin"){ console.log(value["Age"]); } }) Thank you so much in advance
Strange behavior with deferred objects
Hi hi ! Someone can explain me this behavior ? http://jsfiddle.net/mWnDN/ If you click on button 2, It works has expected the correct callback is applied. If you click on button 1, both callbacks are launch (done and fail). I don't understand why. I think i missed something about callbacks behaviors but I don't know what. Can someone lead me to an explanation ? Thanks in advance and sorry for my english
Why won't this var change value?
So I have this jquery code and it works except for one specific part. I am doing a quantity check for a shopping cart system and I need to prevent the default form submission of the submit button and check all the quantities with a $.post() and checking the database. I have confirmed that all aspects work for the checking and outputting to the screen when and where they need to. If I alert(bad) inside the else{} it shows me the value I expect but it does not seem to hold that value or something after
Dropdown option only setting selected after alert
$(document).ready(function() { $("#city").one("click", function() { var selectedCtgry=document.getElementById("state").value; var selectedCtgry1=document.getElementById("city").value; if(selectedCtgry!=null && selectedCtgry!='Select') { var d1 = null; // alert("in ready");
How do I move a tr to the visible part of the table
I have many tr in the visible area where it generates a scrollbar, tr each has its own id, how do I know if it is in the visible area of the scrollbar, and if not how do I place it in the visible area using Jquery ? <tr align="center" id="100"><td><a> info </a></td></tr> <tr align="center" id="101"><td><a> info </a></td></tr> <tr align="center" id="102"><td><a> info </a></td></tr> <tr align="center" id="103"><td><a> info </a></td></tr> <tr align="center" id="104"><td><a> info </a></td></tr> <tr align="center"
cordova 2.6 open url in safari using html tag on my iphone
I know this questions has been asked, but i tried a lot of solutions and it doesn't work. i'm using cordova 2.6 on ios. Here is my code: <a target="_Blank" href="https://maps.google.com> my issue is in on my iPhone google map open inside the App and not seperately in safari. How can i do to open in seperate browser? not that i don't want to use javascript, i'm seeking a solution within HTML
The input stream contains too many delimiter characters which may be a sign that the incoming data may be malicious
We automatically generate a JSON object from jQuery, and this JSON object can become pretty big. Now we get the following error on the Web API back: {"ExceptionType":"System.InvalidOperationException","Message":"The input stream contains too many delimiter characters which may be a sign that the incoming data may be malicious.","StackTrace":" at System.Net.Http.Internal.ThresholdStream.CheckByte(Byte b) at System.Net.Http.Internal.ThresholdStream.CheckBytes(Byte[] buffer, Int32 offset, Int32
How to identify device with hardware version using JQuery
How to identify the device with hardware version( eg: iPad, iPad 2 WiFi , iPad 2 GSM,iPad 2 CDMA) in JQuery. I already have solution for identifying device(eg: iPad, Iphone, etc). from UserAgent string.But I need both device name and hardware version. Do you hav any ideaaa!!!, please help meeee.....
Block body scroll over iframe
Hi. I've placed iframe on my site. Iframy includes swf object which interact with mousewheel (zoom in / zoom out). I would like to block page scrolling when mouse is over iframe. code $j('#myiframe').load(function() { $j(this).contents().bind('mousewheel DOMMouseScroll', function(e) { var delta = e.wheelDelta || -e.detail; this.scrollTop += ( delta < 0 ? 1 : -1 ) * 30; e.preventDefault(); }); } ) ; It works ok in firefox. In rest of browsers it block also swf events (zoom in / zoom
Edit text and addClass at Dialog Button
Hi guys, I've another question for you ... I've create a function for open a dialog like this function dialogOpen(div, width, height, text){ $(div).dialog({ autoOpen: false, width: width, height: height, modal: false, buttons: {text:function(){ }}, close: function() {$(div).remove();} }); $(div).dialog( "open" ); } $(document).on('click', '.openDialog', function()dialogOpen('divClient', 'auto', 'auto', 'New');}); I would like to Know : Why the text
$.each not finding inserted rows
Hello, Im trying to $.each through a set of <tr class="row">. I have inserted rows that I do through: var $plus = $(this).closest("tr").clone(); $html = '<tr class="row"><td>' + $andor + '</td>'; $html = $html.trim() + $plus[0].cells[0].outerHTML ; $html = $html.trim() + $plus[0].cells[1].outerHTML ; $html = $html.trim() + $plus[0].cells[2].outerHTML ; $html = $html.trim() + $plus[0].cells[3].outerHTML ; $html = $html.trim() + '<td> </td></tr>'; $(this).closest("tr").after($html);
Disable li tag for being click again??? Help please
I have a navigation made on li tag, i want my li tag to prevent being click when the class is active this is the code, i use this for my slider. $(document).ready(function(){ $('#slideshow_nav li').click(function(e){ e.preventDefault(); $('.slide').css('transform','translateX('+$(this).index() * -1000+'px)'); $(this).toggleClass('active inactive'); $('#slideshow_nav li').not(this).removeClass('active').addClass('inactive'); }); });
Set behavior with setTimeout and clearTimeout?
Hello, I created a JQuery tooltip plugin but I have a problem. I need to be able to move the mouse over the tooltip ... I tried to make this work with setTimeout and clearTimeout but no luck. I have a working version here: http://www.codepen.io/mdmoura/pen/KdyJH The important code is at the end of Mouse Enter event and in Mouse Leave event. Here is the plugin code (I added comments in uppercase to explain what I am trying to do): // JQuery (function ($) { // Tooltip $.fn.Tooltip = function (options)
Not able to execute .load() using jQuery/Ajax from local file.
I am trying to access a servlet using jQuery Ajax via .load('http://host:port...) from a local HTML file in my c: directory. I can't get it to work. I am using jquery-1.9.1.js. Since it was not able to access the specific servlet ("http://host:port/servletName"), I tried to access www.google.com and no luck. Here is my code: <!doctype html> <html> <head> <meta charset="utf-8"> <title>Demo</title> </head> <script src="jquery.js"></script> <script> $(document).ready(function(){ $("button").click(function(){
Textbox autofocus
Hi, I was able to swap the divs when clicked one containing a textbox. I have used focus() but it doesn't fully focus on the textbox. When the textbox appears, the text indicator does not flash but can be double clicked to fully focus on this textbox. Is it possible to fully focus on just one click without having to double click? If so, how would I implement this. Thank you and God Bless.
Check if mouse is over a div
how do i check that mouse is over a div. For Example $(document).ready(function (){ $(".setting").click(function(){$("#dropDown").slideDown("normal");}); $(".setting").mouseleave(function(){ if($("#dropDown").mouseover()==false) { $("#dropDown).slideUp("slow"); }}); }); how do i check ($("#dropDown").mouseover()==false)
test for style display: none on div, then change another div??
I have a div, #EmptyCartMessage, which gets an auto-generated "style=display:none" on it... I need something like this air code: if( $(div #EmptyCartMessage).css("display") != 'none' ){ OR if not ($(div #EmptyCartMessage).css("display") = 'none' ){ $(div #KeepShopping).css("display") == 'none' } Test that #EmptyCartMessage does NOT have a style=display:none on it If true do not display the #KeepShopping div I read about testing visibility but doing so did not point the way toward testing for a specific
jQuery scripts not working in ie8
I'm developing an html site full of jquery effects but my problem is that it doesn't work properly in ie8. It works well with chrome, firefox and safari. Hope you can help me asap. Here's the link http://seemynewwebsite.com/spatorrey
Barcodes and IE
Hi guys I am developing a small program that is used to insert a defined number of barcodes. In practice, each time you read the javascript should enter the data in the field and move on to the next, until you terminate it. I say should because it works on Chrome / Firefox / Opera but not in IE (works in part) with or without compatibility. In practice, after two readings IE, send submit. Someone can help me? thanks My Script: $("input#seriale").keydown(function (e) { var keyCode = (window.event)
How to automatically wrap the LI when it reaches the browser's right most end?
I have a dynamic multi-level dropdown menu. When the rightmost level reaches, I would prefer having it expand on the left hand side instead of extending the browser's scrollbar. Is this achievable through CSS or Jquery? This is the Javascript which I am using: function mainmenu(){ $(" #nav ul ").css({display: "none"}); // Opera Fix $(" #nav li").hover(function(){ $(this).find('ul:first').css({visibility: "visible",display: "none"}).show(400); },function(){ $(this).find('ul:first').css({visibility:
Two jquery file conflict
I ought to use jquery.min.js & jquery-1.7.1.min.js file. But its conflict the scroll effect or scrolloromo effcet. pls help me work both effects. Thanks in advance. -Manoj
data single line coming from ajax
why data loaded into combobox from php file is single line ? $(document).ready(function() { $("#send").bind("click", function(){ $.get("cbox6.php",function(data){ $("#cb").append('<option value="'+data+'">'+data+'</option>'); }) }) }); <select ID="cb"> <option Value="0"> Please Select</option > </select> <input type="text" id="txt"/> <button id="b1">OK</button> <button id="send">send</button> <div id="tablo"></div>
my json is not getting parsed through query.
Hi My json is not getting available. both are in same folder. Please tell where i am wrong. I am pasting both html and json here: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Table</title> <script type="text/javascript" src="./jquery-1.8.2.js"></script> <script type="text/javascript" src="./table.json"></script> <script type="text/javascript"> $.getJSON('table.json',
Click event not firing/timing issue?
Hello, I have a click event Im trying to get to fire. I have the click function in the document ready. The click should activate on a button class assignment click. But, the class is not created until a drop down change event is fired. I think it's(class button assignment) not firing because the class is not ready/created at document ready. How can I tie my click event to the dropdown change event? Thank You
Problem refresh fullCalendar
Hello, I am using jjquery fullCalendar in my asp.net website. My events come in from .ashx fille and get returned as json. I am trying to add events from the client side without refreshing the whole server, In facte the event is ssuccefuly added to My SQL server Data Base. and it must to refresh all the page to dispal the added event. I use page.aspx to add my event like that: function selectDate(start, end, allDay, jsEvent) { var top = (screen.height - 600) / 2; var left = (screen.width
Why is this code not working anymore in jQuery 1.9.1?
Before updating to the latest jQuery release, I was using version 1.8.3 and the below code was working fine. With the newest version however, the function isn't working anymore. Why is this the case? (By the way, if I include the migrate js, it is working with v. 1.9.1) <script type="text/javascript"> jQuery(document).ready(function($){ $(".imageShowcase img").hide(); $(".productImgDefault").show(); $("#attribute525").change(function() { $(".imageShowcase img").hide();
Allow users to check the checkboxes from a few dropdown list and display them
Hello! I am new here. I simply love how jQuery make our lives easier :D i get to know it just a few weeks ago. I would like to try to add something to my website. It is just an idea that i do not know how to carry out yet, so it would be good to hear your suggestions :) So here is how i want it to be: 1. to have a dropdown list on a page and nothing else. 2. user select one category from the dropdown list and there are checkboxes associated to that category. 3. user can check on the checkboxes. and
onblur calculate the sum.
i have a problem with total calculation on change input box it only show the change box value, it don' t sum in total input box. can you please help me here are the code <script> function calculat(id){ var total= $("#bank_"+id).val(); // this will take the value of bank_1 total+ // This do not work $("#total").val(total); // display in the total input box } </script> <input type="text" id="bank_1" onblur="calculat(1);"
Calling focus() on an Anchor Triggers Click Event in a Scenario
Hi, I have a div and an anchor on my page. Both can take focus. When a key is pressed on the div, I would like to set the focus back to the anchor. The sample code is shown below. I found that on FF/IE, if I hit enter on the div when the div has focus, the anchor is then focused as expected, but a click event is also triggered on the anchor, so the console output becomes this: on div1 keydown on div1 click on anchor1 click The same problem does not happen with Chrome: on div1 keydown on div1 click
Jsonp always returns syntax error
When doing a jsonp ajax call, i always receive the following error: Syntax Error ?jsonpcallback=jQuery164020868876727150054_1366217925230&_=1366217925270, line 1 character 1 Here is my call: $.ajax({ url: "http://www.yahoo.com?jsonpcallback=?" , dataType: "jsonp", type: 'get', processData: false, crossDomain: true, ContentType: "application/json" , success: result }); function result(data) { $( '#jCFSIContent' ).text(data.message); }
Handling response from an ASP.NET web service using Jquery's Ajax function
I have this response coming from a ASP.NET web service <string xmlns="http://Walkthrough/XmlWebServices/"> {"approverName":"","emailAddress":"","companyName":"ABC","address":{"streetAddress1":"12 BlahBlah","streetAddress2":"","state":"ON","zipCode":"","country":"SO","phoneNumber":""},"tabledata:"[{"vendorPart":"AAAAA","partDescription":"N/A","price":"0.00","quantity":"28"},{"vendorPart":"BBBBBBB","partDescription":"N/A","price":"0.00","quantity":"3"},{"vendorPart":"CCCCCC","partDescription":"N/A","price":"0.00","quantity":"25"}]}
Dropdown list with a search bar in
've created a Wordpress site and it's responsive. The mobile version uses a drop-down list with the categories list in and at the bottom a search bar. As well as desktop, for mobile i have a function where it uses a click function to toggle the list up and down. When using slideDown the list stays down and i am allowed to click in the search bar and type in it. When it is slideToggle the list can go up and down (which i want) but when i click on the search bar the list just goes back up. Is there
How to say 'If my mouse leaves one element OR this element fade out'
Hi! The title kind of says it all but i'm in a situation where I want a drop-down list to fade in when the user hovers his/her mouse over an element, and fade out when he/she moves it out of it. Currently, the code makes the list fade in, and fade out when you leave the newly faded in list but NOT the element you have to hover over to make the list to show up in the first place, if you understand what I mean. This means the user has to haver over the list and make their mouse exit that way to make
Toggle Tab Content on Click Issues
Having some issues with my click/toggle function for my tabs. We are doing a "tabbed" navigation which also does "next/previous" to go back and fourth between the tabs. The tabs should open when clicked, and close when clicked - however they should remain open when you click on different tabs if you have one tab open already. It seems really shotty and I think its because the function 1) I'm not great at jquery and 2) I think its getting confused when you click on a tab while a tab is already open.
I need to replicate a certain function which is present in PowerBuilder.
In Powerbuilder there is a functionality, that upon validation of a control say a textbox, if it returns an error, it refocuses on the control, and keep's the focus there (ie in case user clicks outside again, due to the wrong value in textbox, it raises the alert again and refocuses back on itself, till the value in textbox is corrected). I initially tried to do this with onchange, I got the alert to fire based on the condition, and refocus back on the control, but it works only once (i supposes
Issue concerning hidden fields
I have asked this same basic question before several times on other forums but not here. I hope someone here can help me solve this issue: I have a strongly-typed view with a hidden field on it. When the view renders server-side, I am setting the value of the hidden field to a property of the model. When the view renders client-side, I want to get the value of the hidden field (that was set during the server-side render) and display it in a java script alert box. This should be a simple thing to
Problem with dynamic select mysql
Hi, I have a problem, and I don't know if I'm writting in the correct place. First of all, I want to thank you so much for your time and for any help you can give me. Sorry if I've gone wrong about the place where it was suposed I should write in, and forgive my poor english too! I'm in a project, and I want to create a dynamic selects, working with PHP and Mysql. I have no problem showing the first selects' options. I can obtain the value of the selected option. But I can't show the options in the
delete a row when the checkbox is checked and clicked on delete link
Hi I want to delete the checked row when i am clicking on delete. For now it just removes the checkbox instead of whole text as well. Please let me know where i am wrong here. <script type="text/javascript"> $(document).ready(function(){ $("#checkAll").click(function(){ $("input").attr("checked", true); }); $("#uncheck").click(function(){ $("input").attr("checked", false); }); $("#delete").click(function(){ $("input:checkbox:checked").remove(); }); }); </script> <body> <a href="#" id="checkAll">Check
Custom date picker with time
hi all, how to write custom date picker in jquery like below with today,close,clear hyperlinks and time should be in select box how to do this . Please help if any one have idea Thanks & regards, Nazeer
How to get return value of $(this).attr('onclick')
$(this) onclick event: return confirm('Are you sure?'); On document ready, I put click bind code: $('a').bind('click', function (e) {
//If return value is true
if ( 1 == 1 ) {
//Show progress div
}
}
Next Page