JSON parse unexpected character
I am getting a valid JSON object from the form handler. The problem is I get this error on the AJAX result: I get the 200 status then I get Syntax ERror: JSON parse: unexpected charACTER. This is part of the JSON object: Success... Localhost via UNIX socket [{"todo":"","date":"0000-00-00","name":"","id":"609"},{"todo":"","date":"0000-00-00","name":"","id":"608"},{"todo":"","date":"0000-00-00","name":"","id":"607"},{"todo":"ff","date":"0000-00-00","name":"ff","id":"611"},{"todo":"wash car","date":"0000-00-00","name":"Janis
Passing dynamic data into a function
Hi all, is there someone how can help me? I am definitely stuck within this problem I am quite used now (as beginner yet) to use e.data with my functions but now I want to go a step further as I have dynamic data to pass to a function. I am working with Jquerys cookbook and there is the chapter „Passing Dynamic Data to Event Handlers“. Yet, it seems I am too stupid to understand this :-( I have in my case the following code (part of a simple (not for me;-) slider): $("#arrowForward") .click(function(e)
need to iterate thru json
hi.. in the below json i need to get the value of the id==8, but some better way. not thru data[1].children [ { "id" : 1, "name" : "a", "children" : [ { "id" : 2, "name" : "b", "children" : [ { "id" : 3, "name" : "c", "children" : [ { "id" : 4, "name" : "d", "children" : [ { "id" : 5, "name" : "e", "children" : [ {} ] } ] } ] } ] } ] }, { "id" : 6, "name" : "f", "children" : [
jquery dialog - multiple use on one page?
Hello, I'm not looking for the code (the only way I'll learn is if I search and experiment first) but I do have a question just to make sure I'm not over complicating the issue. I have a page that lists multiple (15) projects. Can I have a link in every project to a jquery dialog pop up? So there would be 15 jquery dialog pop up links on one page. I tried yesterday and was not successful, so I am assuming the answer is no. If anyone could could confirm, I would greatly appreciate it. If this is
Access a SOAP Web service using XMLhttprequest
Hello, I am new to JS and jquery. I want to access a SOAP web service to access GPS information of our commuter buses. I am able to do so using a .Net program on the sever side but I want to do the same on the client side. I want to access the Web service using XMLhttprequest and plot the data on a map. I followed an article(http://openlandscape.net/2009/09/25/call-soap-xm-web-services-with-jquery-ajax/#comment-478) and wrote my code but it is giving an 'undefined error' I am not sure where I am
Making a Dynamic Form
Hello, I am very new to jquery, I'm more familiar with html and php; I've only used jquery before for menu animations, and now I need to make form with dynamic inputs, the second option on the form will depend on the input from the first option; the best example is probably eBay or second hand car websites; an example of what I am trying to achieve can be found on the Autotrader website: http://www4.autotrader.co.uk/ As seen in my attached picture the "Buy a car" form features a 'make' field that
Radio Buttons - Working Only After Page Refresh (F5)
Hello, i am am jquery newbie. i try to showing module methods with radio buttons and hidden div´s. ( for Prestashop ) I have this little Script: <script type="text/javascript"> {literal} $(document).ready(function() { $("#payment").change(function() { if ($("#bankwire").attr("checked")) { $("#payment_bankwire").show(); } else { $("#payment_bankwire").hide(); } if ($("#paypal").attr("checked")) { $("#payment_paypal").show(); } else { $("#payment_paypal").hide(); } if ($("#nachnahme").attr("checked"))
Adding radio buttons
I want to be able to have a yes or a no selection option for each question and then I will use c# to get that selected value. Not sure how to do modify jquery code to work with more radio buttons...Anyone guide me please? Thanks! <label class="label_radio r_on" for="radio-01"><input name="sample-radio" id="radio-01" value="1" type="radio"checked="" />Yes.</label> <label class="label_radio" for="radio-02"><input name="sample-radio" id="radio-02" value="2" type="radio" /> No.</label> <script>
drop styling
The droppable box in the code below accepts two different draggables. As you can see when one of them is dropped only the #draggable changes colour. What could i do so that when one draggable is dropped it changes colour and not the other one. Something like $(this) would work but that would change the drop styling not the drags. Im guessing an if statement would work but I'm not sure how to set it up. Thanks Craig $( "#droppable" ).droppable({ accept: '#draggable, #draggable3', drop: function(
How to move Jquery code from a cshtml file to it's own .js file
I'm new to jQuery and have been working with a plug-in called jTable. The plug-in works fine as long as the scripting code is in my .cshtml file loaded by the view that retrieves its table data form a database. When I move the code to its own somename.js file I'm receiving an error stating "An error occurred while communicating to the server" when the page tries to fill the table. The script is loading into the browser fine but I'm missing something that's causing the browser to throw an exception
Jquery Drag,drop,clone with resizable and rotatable
Hello I am doing a project in that I need drag images from drop down list to container after dropping on to div the image should be selected at the same time it have to show anchors for re sizable and rotatable. I have done till drag,drop and clone of images (in that the image is going out of container don't known why still working on it) it is working if we use without drop down's but i don't know how to show anchors for re sizable,rotatable and selectable.I have searched for sample code couldn't
General Javascript/JQuery Question
If I have an anchor element on a page is it possible to pass that anchor element as "this" as a parameter to a custom javascript function, so that I can get its attribute information out of it from within the function? I'm trying to come up with a way to code a simple generic function call, that will allow me to then access the element's attribute information from within the function, for further processing. I'm currently trying to code the call in the anchor like this: <a href="javascript:findLinkPosn(this);"
Ignore http errors on $.ajax()
Hi, Even if my title is a little outrageous, more silly is the reason because I ask. I'm parsing a site for an chrome extension, but for some reason or other the server returns error 500 rendering "success" unusable. In the browser it shows alright, without problems (seems like it use the page I'm trying to parse as error page, or idk). Here is my code: getListChaps : function (urlManga, mangaName, obj, callback) { $.ajax({ url : urlManga, beforeSend : function (xhr) { xhr.setRequestHeader("Cache-Control",
Why this code does not work on Chrome?
just installed mobiscroll. I use date scroller. I use this below code to manage the textbox. <script type="text/javascript"> $(function() { // create a datepicker with default settings $("#beginDate") .mobiscroll() .date({ invalid: { daysOfWeek: [0, 6], daysOfMonth: ['5/1', '12/24', '12/25'], theme: 'android-ics light', display: 'bottom', mode: 'scroller' } }); }); </script> It works well on firefox but not work on Chrome. Why? How can i fix it?
Response is sometimes not shown
Hi all I do an AJAX request and I have a problem with my response. When I just choose some values out of some option boxes and the press "Search". I get back the following answer: {"ForeName":["B\len4","Keriw"], "SurName":["Regor","Blsiger"], "UserName":["rosdferbehlen","karidbaldfiger"], "AdressId":[1,2],"AdressUserId":[1,2], "AdressStreet":["Rodfgerstrasse 17","Roegtestrawsse"], "AdressPlace":["Lostrf2","Onsdfgngen"], "SuchResultatEndeId":[1,2],"Rueckmeldung":""} and this answer is published on
Multiple Chained selects
I am quite new to anything on javascript, jquery, ajax, actually i am still not sure what ajax is tho i know i am using some of it, i did this from a tutorial, edited it to fulfill my needs and i understand completly how it works. but now i need to be able to add another row of chained selects on a button click(i can do this) what i am unable to think about is how to maintain the functioning of loading the selects with what i understand to be an ajax call. without changing the rest of the selects.
Extra arguments passed to .trigger() doesn't reach blur event handler when element has focus
Hi, everyone! I want to pass an extra argument to the blur event handler of an element but it only works when the element is not focused. Why would I trigger blur then? Seems like a bug to me. HTML <input type="text" id="field" name="field" /> JS $(document).ready(function () { $("#field").on("blur", function (e, extra) { console.log("extra: " + extra); if (extra) alert("extra argument passing worked!"); }); $(document.body).on("keydown", function (e) { console.log("triggering
problems with jq removeAttr using several radio buttons
Hello! have problem... I use datapicker. I need to change checked attribute when I choose date. when I change date I need to remove all my cheched attribuses and set checked attribute just for one radio button but now when I choose date I cant remove attributes if(dayOfWeek == 5) { $('#tsenik').text('$10.00'); $('#price1').attr('checked', 'checked'); $('#price2').removeAttr('checked'); $('#price3').removeAttr('checked'); $('#price4').removeAttr('checked'); } else if(
Setting Div position up on another content
I have a page content which have text in it. underneath the content, there is a navigator bar, and I would like that whenever I Hover one of the element in the navigator, a div will open up just above the element I have just hovered on, and show some content. I don't want the DIV that will pop-up to push any object on the page, I would like it to be, like up on all of the objects on the page. here's a fiddle to demonstrate: Click here for fiddle In the fiddle, I want that whenever I hover First,
How do I loop through my arrays using .each() without duplicating data?
I'm using the $.get method to return some JSON that is an object in a bunch of arrays. I want to walk through the arrays and spit out the keys and values. My JSON object has a bunch of city names as keys of arrays, then has quotes within those arrays belonging to each city. Here's the result I'm getting back from my $.get method (after parsing to JSON object); Object {Wolverhampton: Array[10], Manchester: Array[10], Leicester: Array[10], Bradford: Array[10], Durham: Array[5]…} Aberdeen: Array[10]
Conflict jquery.min.js with joomla mootools
Hi Dear I use joomla with ja3T3 plugin after add this code <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8/jquery.min.js "></script>my megamenu not working I solved this problem with <script type="text/javascript"> $.noConflict(); // Code that uses other library's $ can follow here. </script> after that i used this code for mouse click effect div <script> var tuvan_opened = false; function toggle_tuvan() { if(!tuvan_opened) { $('#tuvan').animate( { bottom: "35px"
Update table in real time
using ASP.NET I am displaying a table on screen. I want the user to be able to check or uncheck a tick box(field in the table). Which updates the corresponding field in the DB in Management Studio on real time..... Looking through google. JQuery seems the way....but im a beginner at Jquery and wouldnt know where to start does anyone know of any good tutorials.....or even give me a hand/advice/tip to get it started? Thanks for any replies
datepicker in multilanguage
Hi there, I know that the datepicker has a localization option. But how about multilanguage? I use qtranslate for my site for several languages. The datepicker is used in the theme I have bought (from themefuse). Now, is there a possibily to use the datepicker in several languages or with qtranslate? If yes, how? thanks, max
How can I do an outerHTML but for the outer relement only?
I would like to get the HTML of the outer element only. Does jQuery have a method or do I have to roll my own? E.g. if in the example below, I use $("#cont1")[0].outerHTML I get everything. But what I want to return only the character string "<div class='outer' id='cont1'>" with or without the </div> is ok. <div class='outer' id='cont1'> stuff here <div class='inner' id='cont2'> something here </div> </div>
trigger() not passing arguments properly
I have a problem with passing arguments from a trigger to a click-handler; With jQuery 1.9.1 arguments are not passed to the click handler, as where with jquery 1.7.2 they are nicely passed. A example to demonstrate: <!doctype html> <head> <script src="js/jquery-1.9.1.js" type="text/javascript"></script> <script src="js/jquery-ui-1.10.1.min.js" type="text/javascript"></script> </head> <body> <input id="test" type="checkbox" checked="checked"> <button id='trigger'>trigger</button>
Syntax to get Math.ads to work
Hey there, Basically what I am doing is I have a form that has two text fields that can't sum above 100. So when the first text field number is entered, the script below deducts 100 to it and adds that number to the second text field. That works just fine ACCEPT for it is now negative number. So all I need to do is add 100 to it or use math.ads. Just no clue on the proper syntax to get $txtInterest to be a positive number. $('#txtAmt').change(function() { $('#txtInterest').val($('#txtAmt').val()
Setting value for $(this).closest('option')
Hello: I didn't think this would be so difficult, but then again... I've got a table with a checkbox in the first <td> and a <select><option>. When The checks the checkbox and it is true, then I want to populate the <option>. How do I do that? I just want to populate it with a value from the option list and give it the appropriate val(). Thanks in advance: Pavilion
How to make album cover bigger?
Hi folks, As you can see the album cover here is too small. The above image is the album cover here Can anyone tell me how to make this album cover bigger with jquery? Best Bomzon
jQuery1.9.1 is not working ie10
jQuery1.9.1 is not working ie10 while it is working fine in all other browsers
jQuery in one browser tab affects javascript in other tab
Hi! I have very strange problem with jQuery. I'm using joomla for my site and smf for board. On site i have image sliders based on jquery and on board i have shoutbox. When i have board opened in one tab and then i open tab with site shoutbox on forum fails: can't post messages, wont refresh anymore, randomly plays sound of new message. I would be greatfull for any help :) This is site link: http://beta.lineage2.com.pl And board with SB: http://forum.lineage2.com.pl
Jquery: Click Setup and Remove Specific CSS
I've got a: <td id="D19" style="font-family:Arial;font-size:11px;background-color:#FFFF00;color:#000000;" onfinishinput="checkif()" contenteditable="true">Sample Content</td> What I want is when I click a button it will add (e.g. bold, font-weight) a style attribute, then by clicking it again it will be remove (the desired style attribute), but the style only the specific attribute of a style. Is there a process for this, cause i've been searching all I can see is toggleClass. . but I don't want
Using jquery libraries from google or Microsoft causes problems in ssl websites
If I have an encrypted website (that uses SSL) and my webpage refers to: script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js" type="text/javascript"> Then it will not work in Google Chrome. The library will not be included, because it is not encrypted. It does not have a https prefix. One solution is to download all the query and jqueryui libraries, and put them on my server. But I'm curious - if I don't do that, would I be able to use an https prefix on these external
How to set values of dropdown and radio in jquery by text?
For example: I have two variables var radioText="XYZ"; var ddText="New York"; I want to set radio and drop down box values using these variables and I don't know how to do that. html demo code Friend Name <input type="radio" name="Friends" value="1" checked="checked">ABC</input> <input type="radio" name="Friends" value="2">XYZ</input> <br> <select id="ddCity"> <option value="1" selected>India</option> <option value="2">New York</option> <option value="3">Japan</option> </select>
JQuery answer is empty
Hi all I have a serious problem which I do not know how to solve. I do an SQL query and check the output with var_dump($personenAddress[0]) which gives me the following answer back: array(1) { [0]=> object(JPP\ProfileBundle\Entity\ProfileAddress)#389 (8) { ["id":"JPP\ProfileBundle\Entity\ProfileAddress":private]=> int(1) ["userId":"JPP\ProfileBundle\Entity\ProfileAddress":private]=> int(1) ["street":"JPP\ProfileBundle\Entity\ProfileAddress":private]=> string(16) "Röswerrstrasse 17" ["plz":"JPP\ProfileBundle\Entity\ProfileAddress":private]=>
jQuery localscroll/scrollto problem - causes scrollbars to disappear
I encountered a problem with jQuery's scrollto/localscroll plugin. These plugins work by default, but if I fade in/out some containers then it somehow causes all scrollbars on the webpage to disappear. This is the structure of my code: CSS: .pagecontainer { overflow-y:auto; overflow-x:hidden; width:80%; height:450px; margin: 0 auto; } .pagecontainer>div{ display: none; position:relative; } JS: <!--fade and show windows--> <script type="text/javascript"> $(document).ready(function() { $('.link').on('click',
Sort Pages By Distance?
I am looking at an App called Happy Hour Hawaii and when you open the app it asks for permission to use location and then it organizes the places according to distance. How do you do this using jQuery?
Javescript to JQuery
Where can I find a detailed guide to figure out how to replace the javascript code to jquery? I have an example: if(document.all) { document.getElementById("id").innerText = myVariable; } else { document.getElementById("id").textContent = myVariable; } To start the replacement of document.all and then all other keywords Thanks!
Show instruction on field base on dropdown field
Hi looking for an ideas how to accomplish this one. I have search form with. dropdown (list) and textfield I want to show some instructions like what to type on textfield based in my dropdown field. I have an idea like placeholder in textfield. but it doesn't change everytime. is it possible that the placeholder will change everytime i choose in selection? or if not a container maybe. thanks
As of jquery 1.9 the value selector in square brackets no longer works input[value="blah"], is this by design?
Hi, As of jquery 1.9 the value selector in square brackets no longer works [value="0"], is this by design? The code below I use to find out the number of textboxes that have values not equal to zero (or blank) no longer works. $(':text', '#someid').not('[value=""], [value="0"]').length; I'm just trying to find out if this is a bug with my code or a bug in 1.9. Any help would be great. Thanks Daniel
[jQuery] Please wait while executing PHP code
Hello, I have a small web app written in PHP and using Smarty templates, that has to do some initial work on the server side using PHP after the very first login of a user. So I was thinking to display a "Please wait" message/picture but I am not very sure what's the best practice for this... Actually if I understand correctly I should simply use something like this: jQuery(function($) { $("#contentArea").load("runservercode.php"); }); $().ajaxSend(function(r,s){ $("#pleaseWait").show(); }); $().ajaxStop(function(r,s){
Next Page