When using .ajax(), how to make jqXHR pick up Exception message from PHP?
I tried doing a: throw new Exception("My custom error message."); in PHP, I need to get my string message to .ajax()'s .fail() handler, specifically to the jqXHR object that it receives so I can display it to the user. How do I do this? I checked the Network data coming in, and it keeps containing some generic error message.
Programmatically clicking an button in html not working.
I have a button in an webpage, i want to click it programatically. This code works for chrome/Firefox but does not work for IE11 for some reason. $('#buttonID').click(); any clue??
scroll event not triggered in Chrome Version 41.0.2272.118 m
Hi, http://jsfiddle.net/GearWorld/z0qzs54q/ The code on jsfiddle isn't working as well as in Chrome 41 but works fine in IE. Could someone shed some light on this problem ? Thank you
How to check if any child element of the parent element has a given attribute, say "xyz" in JQUERY?
How to check if any child element of the parent element has a given attribute, say "xyz" in JQUERY?
Works correctly in local environment, but not on server...
Ok, here's the issue. I have code that resembles this: $("a").click(function (event) { if (self.isLocked() == true) { event.stopImmediatePropagation(); alert("This record has been locked by another user."); } }); The code basically checks to see if a lock has been placed on the current page, and if it has, it basically makes the page read only, by disabling hyperlink clicks. Well, it works beautifully in Visual Studio when executed locally in Chrome. The problem comes when I pull up the page from
Jquery JSONP POST
I am a beginner in jquery and JSON below is the script I have which sends the JSONP request. It works fine but I am looking how to post the request so that the parameters are not shown in the browser's firebug. In firebug it shows POST as protocol and also the parameters $.post(postService,function(data){ // type: "POST"; var resText = trim(data.returnstr); if(resText.indexOf(':') > 0){
Pausing a function and then starting it again
Hi all I am running a function which is triggered by an audio track being played.(a rotating disc) I want to be able to pause it when the music is paused. The code is below $(document).foundation(); $('audio').on('playing', function() { rotateAnimation("img1", 10); });
Dynamically build Accordion list with 1000's of values
Hi , I am exploring the option to build the list for accordian panel. From server side program, I intend to bring the data in the json and single key can have many values associated to it. {(A1:V1,A1:V2....A1:VN),(A2:V1,A2:V2...A2:VN).. For each unique Key, I need to find its value and take Key as Header and display it and then use values as list options and set a href to them. I will have pretty much around 60 unique keys and these 60 keys will have around 5000 values associated to them. Since this
Hide Div on main domain only
Hello, How do you hide a div using jquery on main domain (ex. www.domain.com) but show the div if it's on subpage (ex. www.domain.com/this-is-a-test.html)? Thanks
Adding value to integer changes other variable
Hope I posted this to the right forum, as this is my first post here. I'm experiencing something weird with a piece of code I've written to enlarge a link as soon as the user scrolls past a div box. I'm using this code: http://pastebin.com/1rFCszi6 (Couldn't get the formatting to work here so it's posted to pastebin) This all worked until I added a feature on my website where the content can dynamically change depending on an option the user makes. It works like this: https://jsfiddle.net/1Lret7vk/4/.
Get external href attribute
When triggered, I wish to change the href attribute of a link in the current html file to be the same as the href of a link in another html file. So for example: Before trigger Some.html (current page) <a ID="something" href="somewhere.html"></a> SomeOther.html <a ID="somethingelse" href="somewhereelse.html></a> After trigger Some.html <a ID="something" href="somewhereelse.html"></a> SomeOther.html <a ID="somethingelse" href="somewhereelse.html></a> I've tried $('#something').attr('href', somewhereelse.html
How to round up decimal value
How to round up the given value. rate: 1.3599999999999999 should be the result: = 1.36 code var sales_interestrate = parseInt($('#sales_interestrate').val()); var sales_terms = $('#sales_terms').val(); $('#sales_interestrate').val((sales_terms * 0.02 )+1);
dropdown wont change the value
Hi, I have basic form which has computation, the problem my promissory note field wont change the value when I select a terms in my dropdown. please see fiddle http://jsfiddle.net/php988/h4Lezseb/ Help would be appreciated.
Duplication Issues
Hi, I have very little JavaScript knowledge, I'm picking up a project where someone left off at...they used the draggable function to rearrange the table in a database. The issue is, the data is being duplicated in the database table on submit. JS: function submit(){ var orderID = []; var partID = []; var amtID = []; var carTypID = []; var cmpndID = []; var prodAmt = []; var prodDte = []; var seq = []; var perd = []; var strDate = document.getElementById('strDate').value;
Drop-down Menu and Slideshow don't like each other....
I've been teaching a web programming class and as an assignment had a drop-down menu coded and a slideshow below it. The drop-down menu seems to drop down behind the slideshow. I'm not sure about what it is I'm missing. Here is the code: http://liveweave.com/RxDrL1#&togetherjs=5HicrmHnJL
Ajax response display
I am trying to style the response of my ajax call (xml) which is displayed in table. on applying switch statement to the table to change the style of some <td> which has the values; 'pass' ; 'fail'. I found out the last <td> of each result table is always not responsive to the the styling. switch (Valid) { case 'yes': $(".highlight").html('<img src="img/validgreen.png"/>'); break; case 'no':
animate() doesn't work for appended img src
http://jsfiddle.net/jsfiddle135/p10dcrfw/ By loop, images are appended and displayed all right. But animate opacity works, not left property. I think a special work shall apply to appened images. Best regards,
file path - relative or absolute
Nothing is displayed in the body. Why????? <body> <button id="start">go</button><br> <img src="../../../../../../img/ jQuery.jpg" alt="Hello, jQuery1"><br> <img id="move" src="../../../img/ jQuery.jpg" alt="Hello, jQuery2"><br> <img src="../../../../img/ jQuery.jpg" alt="Hello, jQuery3"><br> </body>
Accordion and WordPress
Please don't get mad at me, although I'm sure I deserve it if you do... I have tried to take some content (within div tags) that was on a subpage and "convert" it to an accordion that opens upon hovering over an individual item, all in wordpress. jQuery has the code for this already available, so although I'm very new to WP I thought I'd try it. I took the .js files that jQuery's code was referencing and I put them on my server, and then added the following pieces of code to my header.php: <link
$.ajax - Issue with special characters (accents and ñ)
Hi, I execute the below function but when I get the string in TEST_JSON procedure (procedure un PL/SQL) the special characters arrive corrupted. My backend is IAS + mod_plsql with Oracle 10G R2 database (NLS_LANG = SPANISH_SPAIN.WE8ISO8859P1). Where is the problem in the database or in $.ajax configuration? Any help will be much appreciated !! Thanks in advance. $.ajax({ url: "TEST_JSON", type: "post", contentType: "text/html; charset=UTF-8", data: {
Con't get the Rest Post response in Jquery Ajax post call.
Hi jquery team, I am calling the Rest call using the Ajax post method but i get the below error or response. {"readyState":0,"status":0,"statusText":"error"} Even i enable the cors($.support.cors = true; ) and crossDomain (crossDomain: true (add in headers)). Here is the sample request function() { $.support.cors = true; var everData = { "UpdateContactRequestMessage":{ "channelPartnerID":"123456", "email":"greg@gmail.com", "firstName":"greg",
Deep jQuery inspection on page load with YellowLabTools
Hi everyone, I wrote Yellow Lab Tools. It's an online tool hosted here: http://yellowlab.tools It's designed to help developers speeding up page loading time and one of my main concern is the number of DOM reading/writing. Some heavy websites do more than 5000 DOM access on page load and developers/maintainers of these sites don't realize there is a problem. To help people audit and analyze this problem, my tool has a "JS Timeline" tab, that logs DOM access during page load. The reason I write on
Adobe Muse using jQuery
Hi everyone, is there any way to put a text resize jquery in adobe muse?
save css rule sets of an entire element including its internal elements
I need to get the css rule sets of an entire element including its internal elements. It should be saved into a variable and then saved in the pc as a cookie or some html cache. Later on I need to restore it and use it for displaying. Is it possible and how? Regards I. lesher
force download a MP3 file
I've seen a few posts that relate to this, but I'm still stumped. I've set up a php file to force download a mp3 file my query script: <a href="music/direct_download.php?file=Go Slow - featuring Eric Siblin.mp3"></a> and in the 'music' folder a php file called 'direct_download.php' - which has this code in it: <?php $file = $_GET['file']; header ("Content-type: octet/stream"); header ("Content-disposition: attachment; filename=".$file.";"); header("Content-Length: ".filesize($file)); readfile($file);
jQuery - add a class when element is visible
What I have done is used jQuery to add a class when an element is visible and certain pixels from the top and when the element is no longer visible on the page by after scrolling back up it removes the classes. It works in Chrome and Safari but I can't get it to work in firefox or IE. Im using Firefox 36.0.4 and have tried on down to 32. IE 8,9,10 wont work either. It works on mobile and I know that the $(window).scroll() is functioning because my sticky nav slides down when you scroll down 50px.
Disable Today and future dates in calendar (URGENT)
Hi I kind of have gotten pushed into JQuery due to a reorg work and of course I already have a little disaster on my hands. I have this existing calendar control that I need to add code to disable todays date and all future dates. Can anyone please help? Also please recommend a jQuery GUI and tutorial to learn from please? My background is C# and .NET. Unfortunately it won't let me paste the code here so could someone indicate if they would be willing to help me?
JAWS 16 not reading JQuery Dialog in IE
I have JAWS version 16 which reads Jquery dialog fully when it appears in Firefox. It first says dialog title, then the content of the dialog and then the buttons that are present. In Internet Explorer (IE 10), when dialog appears, it just reads the dialog title and the button name where the focus is set. Is there any work around to make JAWS read the dialog content in IE without using the short cut keys ?
detect sreen width mobile
how to detect screen width browser mobile using jquery anyone can help?
Parse XML for iframe
Hi, since I'm new here, not sure if this is the right place to post a question, so excuse me if it's not) So the goal is to parse links from XML into array to cycle them in an iframe with next/prev buttons, if an array is hardcoded everything works fine, but if I parse it trouble starts. Array.length reads and even loads s[0], but stays there simly reloading the page with next/prev buttons. function array() is loaded from a different .js and works fine, array exists. What could be the problem? [code]
Get ID of randomly generated element
I have a very basic understanding of coding. I'm using a program called SpreadsheetWEB to make web form calculators. It has a function that allows you to use Javascript to modify things you've created using their software. Long story short, they've changed their software rendering my custom function useless. I inserted my custom code into the "Page Onload" portion of their program as follows: <script language="javaScript"> { document.getElementById('btn_Next').style.opacity=0; document.getElementById('btn_Next').style.filter='alpha(opacity=0)';
jQuery not working for me
Hi, Ive applied a jQuery to my page but its not working. Please could you check for me. Im a newbie & learning as i go but this has stumped me somewhat. Here is the page in question http://www.theremotedoctor.co.uk/accaudi.html You make the make the item selection on the page,in this case Flip remote key pad. The photo is then loaded. This works fine on the pc. However on the phone after the photo is loaded i then need to manually scroll to the place where the photo has been loaded "content" By
[Resolved] Accordion Menu Not Working After jQuery 1.9
Hello! I'm in the process of updating a website and I am unable to resolve a problem relating to the menu. jQuery was updated to v 1.11.0 and now the menu no longer opens and closes when clicked. This is how it works on the existing site Cornworthy.com And this is the menu not working on the new preview site Cornworthy.com Preview The website was largely put together by someone else and my knowledge of jQuery is very limited. Despite reading the jQuery 1.9 upgrade guide I am still lost - apart from
Cannot get path correct on .load()
I'm trying to use the .load() method of jQuery. On my index page, I have the following: $(function () { $("#mainContent").load("views/pageone.html"); }); It loads fine and my url looks like this (http://localhost:50715/website1/index.html). Index.html is at my root and all other pages are under a folder structure. Now, after it is loaded, looking at the contents of my pageone.html, I also have a load method: $(function () { $("#mainContent").load("views/pagetwo.html");
[RESOLVED] problem using class selector
Hi, First a description of what I am trying to do. I hope I am clear enough to be understood, but I'm not sure it is necessary to understand my intent. It is provided as background mostly. I am writing a program that progressively goes through a tree of application states using radio buttons in forms. So, there is a root form with radio buttons and depending on the selection, the next form will be a form with radio buttons with the choices based on the context of the parent form. The idea is to move
Problem with ajax and button event
Hi guys, sorry for this stupid question, but I can't solve this. When I click on the button , the ajax request sent as often as I have "each " elements . Plus once the regular . How can that be? The ajax request is started but only once at the end . And it should also be started only once. I just do not come on , and prophesied no longer what I could google . That is my jQuery code: $('#iptableschange-save').click(function() { id = $(this).attr('value'); chainid = $('#changeiptablerule #add-iptable-rule-chain
Attr checked after open jquery dialog does not work
I am using jquery 1.11.2, I am trying to check a checkbox after opening the dialog if the value in a textbox is '1', but it works only the first time. I tried with jquery v1.8.3 then it works, I don´t know if I making a mistake or maybe is a bug. I leave the source code here using the two versions.
adding 2nd Drag and drop file to the variable\FileList
How can we add later dragged and dropped items to the previous FileList? obj.on('drop', function (e) { $(this).css('border', '2px dotted #0B85A1'); e.preventDefault(); var files = e.originalEvent.dataTransfer.files; files1 = files; var output = []; for (var i = 0; f = files[i]; i++) { output.push('<li style="list-style-type:square"><strong>', escape(f.name).replace("%20", " "), '</strong>');
Im getting a uncaught typeerror . i dono know what i am doing wrong. will you please explain this to me?
This is my jquery code: $(document).ready(function(){ $("#btn-1").click(function(){ $(".location").slideToggle("slow"); }); $("#sub").on("click",function(){ $(this).remove(); $("h5").text("Thanks for your comment. Your comment is submitted"); }); $(".lists li").hover(function(){ $("span").show(); }); $("#ri li #app").click(function(){ $("#ri li #app").show(); $("#list1 li").slideToggle("slow"); }); $("#ri li #ent").click(function(){ $("#ent").show(); $("#list2 li").slideToggle("slow"); }); $("#ri
Date of Birth From Multiple Inputs
I have a form that, at some point, asks the user "so, you are born on (day) of (month) in (year)". The question is displayed on this way for a better approach on user experience, so, (day), (month) and (year) are different inputs that user selects. The problem is on organising the information for SQL purposes (for a DATA row, that stores information like that: (YYYY-MM-DD)). I was hopping there is an easy way to transfer the information collected on those three input to a fourth hidden input, from
Next Page