mysterious problem with JS variable / variable is displayed only after alert
Hello, I have a big problem with the "output2"-variable! output2 is declared in the first ajax query(line 15) and is described in the second ajax query(line 30 and 32). Now I want to use output2(line 45), but the variable is empty! Now the mystery: I write a alert() befor line 45 and the variable is filled. WHY? $("#AJPizza").bind("click", function() { $.ajax({ type: "POST", url: "r_article.php", dataType: "xml", success: function(xml) {
Javascripts not initiating correctly
A wordpress site that I've been working seems to have something weird about the initiation of some of its scripts. The one that I am currently most concerned with is the drop-down header. It is obviously un-styled as I am just experimenting, but, if you look, it shouldn't be dropping down until a certain length down the page, and while it does that, on page load, it shows itself unti user interaction. Does anyone know what this might be happening? Any help would be much appreciated. The site link
Need menu to stop moving up on page load
Hi I am working on this site: http://cdrg.com When I click any of the menu items on the top menubar, the left menu slides up. I don't want it do this and am not sure how to stop this action. Thanks.
Jquery latest = fail
Hi, When I use Jquery in a website, I usualy call the jquery latest.js. Since the change of 1.8 to 1.9, there is some functions missing. Like the "Live" function have been remove, this cause all my website to stop working. I learn from my error, NEVER use any latest.js. But here is my point, JQuery is a library used by so many people that you should take care of any changes. Those changes should have fallback for deprecated functions. Like Zend Framework, if you guys would like to redesign the
How to use the click(function) with 'OR'?
Hello. My action woks like this: $("#my_link_1").click(function(){ if(!$('#hint').attr('checked')){ $("#whatever").removeAttr("disabled"); } }); $("#my_link_2").click(function(){ if(!$('#hint').attr('checked')){ $("#whatever").removeAttr("disabled"); } }); $("#my_link_3").click(function(){ if(!$('#hint').attr('checked')){ $("#whatever").removeAttr("disabled"); } }); But this seems to me not fine because in another case i am able to use 'OR'
Animation feature
Hello all, As we all know...human eye can see only 24 frames per second. But when i create some animation with jquery, i see that in one second are executed around 64 steps...could this number be editable? or to add a new config parameter to change it? in most of cases i think it is useless to execute more than 24 callbacks/animations per second. Here is an example http://jsfiddle.net/KfwMa/ This configuration will get a big role if website will execute a lot of animations on the same time...This
"back to top" refuses to work
Hi, I'm trying to make a mobile version of my site, via PhoneGap. The code I'm using for a "go back to the top" button, is simply: <!-- so we can jump back to top =)) --> <div id="topFixer" style="width: auto; height: auto; top: 10px; right: 10px; position:fixed; z-index: 1000; color: #fb8335; display:none;"> <b class="icon icon-arrow-up icon-3x" id="backToTop"></b> </div> The JS code is: $(document).on("click","#topFixer", function() { $('html, body').animate({scrollTop:0},
database connection
I am making an app that is using a MSSQL db, but I also would like to used indexedDB when they go offline. Is there something in jQuery that is a reliable check to see if the MSSQL Db is abailable and then if it is not to fall back to the indexdb?
Using clone to replace text instead of appending
I'm trying to replace the text inside each <h1> in the Articles with the matching link from the Aside. I am able to get the link there, but cannot get rid of the original text. <html> <head> <title>Link Copy</title> <script type="text/javascript" src="../jquery-1.9.1.js"></script> <script type="text/javascript"> $("document").ready(function() { // Copy link from aside to articles $("aside section hgroup a").each(function() { // Find matching Article heading
Ajax results in parse error
I get a parse error on one form call but not others. I'm using the same $.ajax() call on all three forms. I have googled this issue, and found some suggestions, but don't think they apply. I believe my data is formatted correctly. The response from PHP script uses json_encode. The form with the problem has calls to third party api's through cURL. The other two forms use the same calls, just different data, and no parse errors. Any suggestions? Any other reasons that cause the parse errors? Do I
Trying to use text from a link in a selector
I'm (obviously) new to jQuery and can't figure out why this isn't working. I want to select the matching Article based on the links in the Aside: <html> <head> <title>Link Copy</title> <script type="text/javascript" src="../jquery-1.9.1.js"></script> <script type="text/javascript"> $("document").ready(function() { // Trying to get copy link from aside to articles $("aside section hgroup a").each(function() { // Find matching Article heading // This works:
Change body background
Hi. I'm trying to build an effect, that works on the body background. What I want is to have a number of backgrounds, eg. 5 backgrounds. I want them to cycle in the body background with given interval. Like a slideshow, just on the body background. I have been trying all kind of things - but I havn't found a solution. Does anyone have any idea how I can make this?
Understanding the reason for error in this jQuery setup...
I see a lot of developers use the following technique because it guarantees that $ is being used for jQuery, when the window is ready... (function($){ $(window).load(function(){ myFunction(); }) })(jQuery); But why does the code below, generate an error in my console window?... (function($){ $(window).load(function(){ $.myFunction(); }) })(jQuery); Line 4 is just a jQuery function, as upose to a function declaration I used above. Why is that reason enough to generate an error in my
Is jQuery 1.6.4 compatible with IE8 Browser?
please let me know whether jQuery 1.6.4 is compatible with IE8 Browser?
How to add a background image in css when it already has a background image
Hello Friends, This is my HTML <li id="myemail" class="myemail"> <a href="a.php">TEXT</a></li> CSS .myemail{ background-image:url(/hcj/images/email1.png); background-repeat:no-repeat; } .myemail:hover{ background-image:url(/hcj/images/email2.png); background-repeat:no-repeat; } .myemail3{ background-image:url(/hcj/images/email3.png); background-repeat:no-repeat; } Jquery Code $('#myemail').removeClass('myemail').addClass('myemail3'); $('.myemail').css('background-image','url('+ /image/email3.png
Fade in / Fade Out
Newbie and first post of mine. Would like to add fade in / fade out for the banner images. Right now the banner rotates one by one // The Code am using // var images = ['images/banner-1.jpg', 'images/banner-2.jpg', 'images/banner-3.jpg', 'images/banner-4.jpg']; var i = 0; setInterval(function(){ $('body').css('background-image', function() { if (i >= images.length) { i=0; } return 'url(' + images[i++] + ')'; }); }, 5000); //-----------------// The working version is here. Thanks in advance. Amarnath
Multiple ajax calls from same 'hook'
I am relatively new to jQuery and also a Javascript novice so apologies if this is a basic error which I am not seeing. I want to make multiple $.ajax calls from the same 'hook' (don't know if this is the correct term, but let's say a 'start' button) to get separate pieces of data from the server using page methods within an .aspx page and insert them into separate divs within the page. The relevant code is: $(document).ready(function () { $("#btnGo").click(function
js form not submitting, How to activate it.
Hi, I have searched and some people also stuck in this, i am not able to submit the form, I have changed php file, now using simple php mail function which i have mentioned in the code. Any help please, How to activate it. //forms ;(function($){ $.fn.forms=function(o){ return this.each(function(){ var th=$(this) ,_=th.data('forms')||{ errorCl:'error', emptyCl:'empty', invalidCl:'invalid', notRequiredCl:'notRequired', successCl:'success', successShow:'4000', mailHandlerURL:'js/test.php', ownerEmail:'owltemplates.com@gmail.com',
Media queries with jQuery
Hi, I'm trying to write something so that it only runs when the window width is larger then 768px. In other words, for mobile devices I don't want the jquery to load. This needs to work when resizing the browser window. var delay = (function(){ var timer = 0; return function(callback, ms){ clearTimeout (timer); timer = setTimeout(callback, ms); }; })(); $(function() { var pause = 100; // will only process code within delay(function()
full calendar week view in horizontally
how can i covert the full calendar week view vertical mode to horizontal .Currently fullcalendar 1.5.4 provides days in column wise in week view . But i need a week calendar with days in row wise. Can you help me? Thanks in advance http://arshaw.com/fullcalendar/
Compare 2 images
I have 2 images, one is offline and another is online from skype button. I want to compare these images.
How to pass condition variable for auto complete textbox
Hi I am using jquery autocomplete. It is working fine with single text box. but When I try to add a condition(drop down) on the basis which back end search will work. Below is code for jquery ============================================================================ <script type="text/javascript"> $().ready(function() { var userTypeId = $("#userTypeId").attr("value"); //alert(userTypeId); //alert(userTypeId); $("#nameMobileEmail").autocomplete("autoComplete.php?userTypeId="+userTypeId, { var userTypeId
tableshorter is not working in ie browser
Hi I created one table and short it using jquery.tablesorter.js shorting is working fine in Firefox browser but not working in IE8 browser is anything extra we have to do for IE browser
Getting Error: ReferenceError: googletag is not defined
Hi All, This is my first post to this Forum. I am getting following error when trying to use google tags in Ad script. Error: ReferenceError: googletag is not defined My Ad script is as follows: <script type='text/javascript'> (function() { var useSSL = 'https:' == document.location.protocol; var src = (useSSL ? 'https:' : 'http:') + '//www.googletagservices.com/tag/js/gpt_mobile.js'; document.write('<scr' + 'ipt src="' + src + '"></scr' + 'ipt>'); })(); </script> <script type='text/javascript'>
form with attribute data-remote=true being submitted without ajax on second attempt
I have a form form with attribute data-remote=true and is submitted without ajax on second attempt. I am using ruby on rails on server side. First attempt is going in javascript format and javascript is being returned. here is the java script being returned $('form[id*="restaurant"]').html('<%= escape_javascript render("form") %>') Form is not getting submitted as ajax in second attempt. It appears the form is losing it's binding to be submitted through ajax. Any ideas to fix the issue?
I want to replicate this effect. Someone help?
http://dwelldesignbuild.ca/ Someone please tell me how I can replicate that effect with the images? I know it's JQUERY, but what script is that? Where can I get it?
Would like some clarification on using $(this) (code example provided)
Hello, Here's a funky demo page. Here's my funky code: $(document).ready(function() { var $this = $(this), $dog = $('#dog'), billy = function(num) { console.log('(billy ' + num + ')', 'this:', this, '$this:', $this, '$dog:', $dog); }; billy(1); $('#clickme').click(function() { console.log('(1)', 'this:', this, '$this:', $this, '$dog:', $dog); var $this = $(this); console.log('(2)',
How to Select a Class's Children
How can i select all elements within a class using jquery? for example: <li id="itemSlide_'.$item['id'].'"> <a> a tag</a> <div>div tag</div> <img src="imgtag" /> </li> i want to display an img when one hovers over the <li> tag $('[id^=itemSlide_]').hover(function(){ //display something }); and i want to remove it when the users mouses out $('[id^=itemSlide_]').mouseout(function(){ //remove display }); however every child element of itemSlide_ triggers the mouseout event. Is there
slideDown not responding
Hi, I'm building a script dynamically to make a list of faqs with answers that slide out when the question is clicked. Nothing happens on click. I modeled this after the notes here: http://api.jquery.com/slideDown/ Here's an example of one of the results. Script and html below. Any insight would be helpful. Thanks. $("#faq_4").click(function() { $("answer_4").slideDown('slow', function() { // answer revealed }); }); <!-- corresponding html --> <div id='faq_4'> this is the question
Problem with IE ajax call ...
Hello, The good people at microsoft have again led me to this forum. I have an ajax request that is working fine in FF and Chrome. But the ubiquitous IE "workaround" is again needed. Isnt that nice ...My hats off to them. I have the following code: jlocations = '{"locations" : [{"street":"EAST 7TH ST, LONG BEACH, CA"},{"street":"9830 NORWALK BLVD. SUITE 1, SANTA FE SPRINGS, CA"},{"street":"7223 E. ALONDRA BLVD., PARAMOUNT, CA"}]}'; $.ajax({
Test if checkbox is checked is not working
I am trying to see if a checkbox has been checked and nothing I've tried has worked. $('#gpgu0').attr('checked') and .prop('checked') both return undefined $('#gpgu0').is(':checked') always returns false I am seeing the same results in IE9 and Firefox 18. Am I missing something?
outerHeight setting to an element
Hi, I am able to set the outerHeight of an element using outerHeight() function, but i did not see any documentation of it in the jquery.com. Please let me know if I can set the outer height of an element using this outerHeight(int) function. Regards, Poonam
jQuery Tabs Not Working in ASP
I'm having a problem getting jQuery tabs to work. I'm using a master file along with an aspx that includes a placeholder. Relevant Parts of Master File: <html> <head id="Head1" runat="server"> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <!-- Use for local server --> <link href="css/Default.css" rel="stylesheet" type="text/css"/> <link href="css/jquery.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="js/jquery.js"></script> <script type="text/javascript"
Tooltip not working
Hi - I'm unable to get the tooltip to work on this page. JQuery is already loading on the page so if I include it, the tooltip works but it breaks other elements on the page - could there be some sort of conflict? How do I resolve this? <a class="cta-s grey tooltip" title="Registration Coming Soon" href="#">Register → </a> Thanks
submit button notwork
Hi, I am a beginner of JQuery and JQTouch reading the book "Building Android App with HTML5, CSS and Javascript". I try to run the example in the book but run into a problem of the submit function is not being captured. I have checked this forum and it seems that there seems to be no obvious answer (or obvious common syntax errors). It seems that my function createEntry() is not being captured by statement $('createEntry form').submit(createEntry); In my coding become I can see the alert message
Set scroll position of hidden div
I have two divs - each one can be hidden by clicking on a div above it. I have an overflow on both and each scroll bar controls both scroll positions. The issue i am having, is when one div is hidden and you change scroll position of the visible one, the hidden one does not update accordingly. I need both content divs to have the same position whether they are hidden or not. Any ideas? Here is my fiddle. Thanks.
Cycling Images
I have an image, that is fluid. It scales with the browser. I would like to fade between multiple images, like a slideshow. I looked at .cycle but I couldnt get it to do what I wanted. I've been quite a bit of time on google, but it seams everything I've seen is fixed width & height or I can't get it to work on the site. Can anyone point me in the right direction? I have this for the background: <img class="background" src="/img/bg.jpg" alt="" /> What I'm looking for is something like this: <img
c.ui.dialog.overlay is undefined [solved]
answer was jquery lint plugin! not sure of reason yet. Anyone recognise this firebug error? It's driving me insane - I've found it in the .js obviously, but no idea what could be causing it - it is a very persistant error. Wondered if anyone else has seen it, and if so in what circumstances? This is the offending part of the minified js. b?c(window).width()+"px":a+"px"}else return c(document).width()+"px"} ,resize:function(){var a=c([]);c.each(c.ui.dialog.overlay.instances, function(){a=a.add(this)});a.css({width:0,height:0}).css
How to find XML node by attribute, compare to known variable, if it matches get sibling attribute
Hello, I need help finding an XML node by its attribute. Once I find the correct node I want to retrieve the second attribute in that same node. Can anyone point me in a direction? [code] var glossaryObj = {}; $.get(pURL, function(xmlFile) { $.ajax({ type: "GET", url: pURL, dataType: "text", success: parseGlossXML }); }); function parseGlossXML(xml) { glossaryObj = xml $(glossaryObj).find('term').each(function(){ alert($(glossaryObj).filter(":first").attr('def')); }); } [/code]
remove string also removes surrounding tag
Hi I am struggling to remove a specific tag from a string. But it is also deleting the outer tag. Why is that? Hope someone can give me a hint. Thanks in advance. var data = '<div><h1>heading</h1><p>hallo</p></div>'; var new_data = $(data).find('h1').remove().end(); alert(new_data.html()); The alert is: <p>hallo</p> instead of: <div><p>hallo</p></div> It just also deletes the div.
Next Page