Return false after prompt but continue with script
Hi all, I have a click function which firstly opens a prompt dialog, calls an ajax script and then proceeds to the second part of the function. By adding a return false; after the prompt the script it unable to proceed to step 2. Does anybody have a better way of doing what Im trying to do? $("#btn_next").click( function(event){ var form_values = $('#content_form [name^="data"]').serialize(); var url = $(this).attr('href'); var action = $('#content_form').attr('action'); // Step 1 if( $('body').hasClass('template-informationform')
":contains" working in IE but not in Firefox or Chrome
I've got the following line of code, and when I follow it up with an alert, IE gives me the correct value but Firefox and Chrome don't give me anything.... var rFound = $('#WebPartWPQ3 div div:contains('+ rBuff +')'); Anyone see anything wrong with that? I thought the rBuff value might not be getting passed through but even when I hardcode the value, it still doesn't work in anything other than IE. Thanks. Dan
Unable to stop sound when there are multiple instances of it on the same page
This is an update to my last question which I've made some progress with the help of some members. I've got multiple instances of the html5 audio player on my page, and I use the jQuery fadeIn() fadeOut() to determine which song to play. When clicking a link to a different page, I have the current playing sound fade out volume, then stop, then reset progress to 0 seconds, then the page (along with the audio player) fades out and the new page (along with that page's audio player) fades in. I'm able
Fade in/out music on clicking a link
Hello everyone, My webpage uses javascript to fade in/out pages, so everything is in one html file (yes I know it's not as SEO-effective but I just like this style and it has no loading time, and it's not a commercial website anyways). On some pages I have background music, I'm trying to have any music playing currently to fade out when I click a link to another page then have the music assigned to that page fade in. Since it's all in one html file the music won't stop automatically as all the page
Getting instance of dynamically loaded content
Hi, Can't find an answer to this anywhere on the web... Say I have a container: <div id="xxx" class="parent_container"> ... </div> And a script like: <script type="text/javascript"> $(document).ready(function(){ $('#xxx').load('http://dynamic.content'); }); </script> This loads the required content into the container and exectutes the javascript found inside dynamic content - great! My problem is: how do I get a jquery reference to loaded element from within dynamic content itself? What I want
BBC.co.uk/news like JQuery top horizontal menu
Hi all - first question (probably of many!) Basically, I'm trying to create a menu and would like to include a MORE button similar to how it is on the BBC website: http://www.bbc.co.uk/ If you click more, the page moves down and a DIV is shown. I wanted to ask: a) is there a plugin to do this? b) are there any similar examples out there? Any help appreciated!
Access element in the next adjacent table using index
I am new to jQuery and I am trying to accomplish something that I have not found an answer. I have two adjacent tables with the exact same # of rows and columns. When I click on an element in one table, I want to access the same element in the other table. So far, I can figure out what row index I am in the current table but I can't seem to go to the next table. Here is the layout of my table: table1 row col1 col2 1 a b 2 c d 3 e f table2 row col1 col2 1
[jQuery] ui tabs how to link to a new page
Hi all, Is it possible to if you click a tab i get to a new page ? i've tried the option to load a page into the tab content but that's not what i'm looking for. basically if i click on tab 1 it goes to page1.php, tab 2 to page2.php If someone could help me out ... thanks
My jquery is not working
Hi There I use this code in this web site <script> jQuery(function() { jQuery( "#tabs<?php the_ID(); ?>" ).tabs(); }); </script> <div id="tabs<?php the_ID(); ?>"> <ul> <li><a href="#tabs-1_<?php the_ID(); ?>">Hebrew</a></li> <li><a href="#tabs-2_<?php the_ID(); ?>">English</a></li> </ul> <div id="tabs-2_<?php the_ID(); ?>"> English Content </div> <div id="tabs-1_<?php the_ID(); ?>"> Hebrew Content </div> </div> And I have this on the header.php - <script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
Menu hover not work in many page
I have a menu like this: <div id="menu"> <ul> <li><a href="" class="active tab">Home</a></li> <li><a href="about" class="tab">About</a></li> <li><a href="specials" class="tab">Specials</a></li> <li><a href="account" class="tab">Account</a></li> <li><a href="register" class="tab">Register</a></li> <li><a href="price" class="tab">Price</a></li>
Submitting a form via submit event having hidden fields named submit
Hi all, submitting a form via the submit() event - containing a form element which is hidden and having the name "submit" will fail in an javascript error. <form method="post" action="url.php"> <input type="text" name="sometext" /> <input type="hidden" name="submit" value="go" /> </form> Maybe because of not having an input type="submit" ? Following javascript error occurs on firebug console: TypeError: s[y] is not a function http://localhost/javascript/jquery.js Line 2 I am using jquery.1.9.1 -
Submitig form with jquery
I have simple code here, on click on submit am preventing default , and validating some data with ajax etc . After i done validation i just want to continue form submitting . I have tried with ('form').submit() but it is not working !? ( I have only one form on page and am selecting it ) $(document).ready(function(){ $('input[name=submit]').on('click',function(event){ event.preventDefault(); .... if (something){ // submit my form } }) }) })Plz help
[jQuery] Still working out "drop-down div menu"...
Hi, all. I'm still trying to work out a drop-down div for my horizontal menu. I've tried various approaches and the closest I've been able to come to the proper animation so far (which still isn't correct) is with this code (written in long-form for now and just for the first two menu items): $(document).ready(function() { $('.menu-details').hide(); $('#a-index').mouseover(function() { var answer = $('#menu-details-index');
Last li in ul
Hello all. I am beginner in jquery. my code: <ul class="chooseList"> <li>111</li> <li>222</li> <li>333</li> </ul> $(document).ready(function(){ //$('.').hide(); $('.chooseList').children().first().slideDown(200); $('li').on('click',showNextImage); }); function showNextImage() { $(this).slideUp(10); if ($(this) === $('.chooseList li:last')) { alert('last'); } else { $(this).next().slideDown(200); } } I need : when I click on last li to show alert message . What I did wrong? Thank in advance)
Data are removed when making a POST AJAX request
I'm running into an issue where data are removed from the request when I use POST. Same call to the back-end server from a different client (iPad app) works fine. If I change to GET, then the data are preserved. Here are what I have in my script: var request = $.ajax({ url: "http://localhost/demo/requirements", type: "POST", contentType: 'application/json', data: {token: 'XXXXXXXXX', varid: 'XXXXX}, dataType: 'json', cache: false, });
Strip +4 digits in zip code
Hi, I dealing with some US addresses returned by server, some addresses come with +4 zip code. e.g. "El Monte, CA 91734-2135". How do I use jQuery to strip the "-2135" part? The users want to see "El Monte, CA 91734" Thanks
instrad of appendTo
I am using this function (function($){ $.extend({ playSound: function(){ return $("<embed src='"+arguments[0]+"' hidden='true' autostart='true' loop='false' class='playSound'>").appendTo('body'); } }); })(jQuery); I call this function inside a jquery dialog my_dialog = $(modal).dialog({ buttons: buttonsOpts, modal: true, title: opts.dialogButton, open: function(event, ui) { $.playSound('notify.wav'); } });as per the function it appends to
Making a div unscrollable relative to parent, but scrollable relative to viewport?
Is there some JQuery of javascript function that simply makes a div unscrollable to its parent div, but scrollable relative to viewport? #pagecontainer>div { margin-left:50px; margin-top:50px; } <div id="pagecontainer">
<div id="page1">
<div class="unscrollable"> <!--UNSCROLLABLE-->
<a href="#page1" class="link">Link 1</a>
<p>
<a href="#page2" class="link">Link 2</a>
<p>
<a href="#page3" class="link">Link 3</a>
add pause on hover
this is in a wordpress plugin that fades tweets in/out. how do i modify it so it pauses on hover? jQuery(document).ready(function($){ $.fn.jTweetsFader = function(timeOut) { var $elem = this; this.children(':gt(0)').hide(); setInterval(function() { $elem.children().eq(0) .fadeOut().next().fadeIn().end().appendTo($elem); }, timeOut || 10000); }; var rotatetime = $('#jtweets-feed').data('rotatetime'); $('#jtweets-feed').jTweetsFader(rotatetime); });
Ajax Tracking + Resend exactily same Ajax Request
Hello! I develope a CMS called Goma, in which I use jQuery very much. Sometimes I have an Ajax-Request, which is responded by an Confirm-Dialog and after the user clicks okay, the same Ajax-Request with just some other Attributes should be sent. Since jQuery 1.8 and the deferred object I don't get the events for the Ajax-Request, so I can resend the request, but nothing happens cause of missing callback. So I tried to override $.ajax: w.$.orgajax = w.$.ajax; w.$.ajax = function(url, options) {
1.4.2 to 1.9.1 breaks functionality - how to resolve
This code below closes a dialog, loads the EnterBarn page (showing the new record) and does an effect highlight of that first row. Well, this works with 1.4.2 but not with 1.9.1. Can someone please suggest how to resolve this? TIA Robert success: function(response) { $('#dialog-form').dialog('close'); $('#grid').load('/EnterBarn/ #grid', function(){ $('tbody > tr:first') .effect("highlight", {}, 2000); });
Get JSON data Error
I have an AJAX call that is parsing JSON data but it's currently not working. I added an error even, but I'm not sure what to put there to figure out what my issue is. I have added this but the result is just unidentified. error: function(response) { console.log(response.ErrorHtml); }
Bookmarklet retrive webpage URL and compare to URL array
Hi Guys, I was hoping someone could assist me. I am trying to create a bookmarklet that will retrieve the URL of the current page (whenever the user clicks the bookmarklet) and compares it to a list of URLs. If the URL matches one that exists in the array, it redirects the user to a different website. Please let me know if someone can point me in the right direction. Thanks!
Separating results that begin with the first letter from rest matching results
Hello, I am using autocomplete to help users find categories based on their input and I have used the following expression, to filter out results that do not begin with the first letter typed by the user. var matcher = new RegExp("^" + $.ui.autocomplete.escapeRegex( request.term ), "i" ); my question is: can I have a second matcher without the "^" + option and display the results beneath like so user types: sc end gets: Scala Scheme ----- Related Results --- ActionScript AppleScriptJavaScript
Progress bar polling stops updating
OK, bit of an odd one here: using the jQuery progress bar and some $.ajax({}); requests to poll our server when processing / calculating items. Normally this works fine, however, I have noticed recently that the progress (polling) always "stops" when running long processes (say 13000 items or so (in this current example it stops updating the progress bar at around 40-50%, roughly (but not always) 10 mins in)), but server still processes each item (the tomcat logs prove that the request is still running).
Jquery plugin? Check if code exists on a website
Hi Guys, I was hoping someone could suggest a solution for the following: From a specific website, the user is able to "download" a script which will attach itself as an addon or something similiar to the browser. From that point on, if the user browses to certain websites which we have added some code on the "addon" will detect that code on the website and redirect the user to a certain website. I'd want to use this for some sort of competition, so the user signs up by installing the "addon" from
Getting value of Drop Down List - .val() not working
I'm currently using jQuery to supplement an application I'm building using web2py. One of the issues I'm trying to use jQuery to help with concerns some drop down lists that I manually made with HTML. The values for these drop down lists are set in the web2py backend. The resulting HTML looks like this: <select name="ddlschool" value="2"> <option value="1">Lincoln Elementary</option> <option value="2">Screaming Eagle Middle School</option> <option value="3">Johns Hopkins High School</option> </select>
jQuery not showing event namespace when using proxy
In my script I want to have two types of click functionality, depend on what is clicked and I want to do it in a single function. I decided to make it with namespaces, but the console gives me undefined; Here is the code: $target1.on("click.Bst", $.proxy(self.selectNav, self)); $target2.on("click.Bst.Type2", $.proxy(self.selectNav, self)); My function selectNav() executes on click, but when I try to get the event.namespace (event is passed as s function parameter) I get undefined. selectNav: function(event){
play beep sound when jquery dialog opens
I want to play a beep or notification sound when jquery dialog opens, to capture user attention. I want to call play my audio in open event of jquery dialog. $(modal).dialog({ buttons: buttonsOpts, modal: true, title: opts.dialogButton, stack: false, zIndex: 20000, open: function( event, ui ) {} }); is there a simple way to play an notification sound using jquery.Please advice. I want this to work in IE 7+
Why to I need to append [0] to my jQuery selector to get to an object?
I am having an issue with finding an object in jQuery. I have the following code: < div style =" text-align : center ; " class ="dvAddReferenceButton"> < img src ="../../../../Images/Eteach/buttons/referencesRecord.gif" onclick ="AddReference()" /> </ div > < div id ="dvPopupEditor" class ="dvPopupEditor" style =" display : none"> Hello World </ div > On clicking the referencesRecord, I want to display the “dvPopupEditor” using jQuery Block Ui. The problem I
Position Method - collision: “fit” is moving table elements to top of page instead of shifting them away from bottom of iframe
I'm trying to use the Position Method on table elements within an iframe in order to shift the elements away from the edge of the iframe if they're too close. I'm using this for faux Select elements that are near the bottom of the page, but instead of shifting the elements with collision: "fit", they're moving to the top of the page. I tested collision: "flip" just to be sure, and was surprised to discover that it didn't position anything and allowed the element to be cut off. I've also tried adding
Pls. help. I am breaking my head
Hi, I have a form that uses a jquery tab. I am posting data to php using the following, var jqxhr = $.post( "cgi-bin/docallrecord.php", { id: "1", tablename: tablename, startdate: stdate, enddate: enddate, phonetype: phonetype, phonenumber: phonenumber, uploadedfile: upfname,
Binding/Unbinding click events
Can someone please help with the following. Click events are bound to 1st and 2rd anchors on dom load. It all works but not quite as desired. 1st anchor drops down a menu. 2nd drops a search field. Clicking first on a.menu opens the menu. Cliking on a.searched while menu has opened, prevents a.searched from opening its search field dropdown. Clicking on a.menu collapses the menu dropdown. Now clicking on a.searched opens it. This is correct so far. But if a.menu is clicked again wile asearched is
(Q) How to insert image into div?
Hi, I'm newbie in Javascript. This is my html <div class="slider"> <a href="" class="thumbs"><img src="images/1.jpg" /></a> <a href="" class="thumbs"><img src="images/2.jpg" /></a> <a href="" class="thumbs"><img src="images/3.jpg" /></a> <a href="" class="thumbs"><img src="images/4.jpg" /></a> </div> <div id="show"> <img src="images/1.jpg" /></a> </div>How can I insert image from <a><img> to replace <img src="images/1.jpg" /></a> inside div id-show Thanks and
{Solved} send huge pararmeters information from jQuery using $.getJSON(url, function(e)); and $.fileDownload();
Hi All, Could anyone provide me inputs how to send huge information in request using $.getJSON() i resolved this kind issue in another scenario with $.ajax{ by adding data: parameters}; i tried to using, $.get(, $.post(, $.postJSON(, $.getJSON(url, parameters, function(e){ }, "JSON"); While taking the values to next level, it's been struck in Jquery for maintaining this large data. Help me to, How can i resolve this..
Trouble understanding $()
$(document).ready(function() { $('#bluebeans').click(function(){ $('.redbeanpic').fadeOut(200,function(){ // only then fade has finised, set index to 3 $('.bluebeanpic').css('z-index', '3'); $('.redbeanpic').css('z-index', '2').show(); }); }); $('#redbeans').click(function(){ $('.bluebeanpic').fadeOut(200,function(){ // only then fade has finised, set index to 3 $('.redbeanpic').css('z-index', '3');
Database driven select list
Ok so im trying to get a dynamic select list. Which i have done with php. My problem that i have been trying to figure out is this. The values listed in a select list are very basic in html as we know. I have a application i am trying to mimic which looks like this. Notice the select box when selected shows the "code" from the dropdown. BUT the dropdown shows the code with a description of what the code is for. My database has the same information code and description. Im fairly good with php but
CRUD
Hello I'm trying to figure out why I can't get my app to edit or delete. It will save to local storage with a key but no value. I would really appreciate any help with this asap. Here is a link to my Git hub https://github.com/awacs68/ASD/tree/master/week3 Thanks, Mark
Remove "display: none" inline style
So I created a super simple jQuery script, my first. Just learning jQuery. It's a simple toggle menu that kicks in for small screens: jQuery(document).ready(function($){ // Show/hide the navigation $('.menu-toggle').click(function() { $('#menu-secondary').slideToggle(150); $(".menu-toggle a").toggleClass("show-x"); }); }); #menu-secondary slides down when you touch the .menu-toggle, which is a little square image. I change the class on .menu-toggle, so that I can reposition a sprite image to make
Problem with .remove()
Hei jquery community, I cannot handle the following problem: I created a div of class "bubble" using jquery. In this bubble, I appended the response of an ajax request, which consists basicly of links. By clicking on one of these links, an event is fired. This event is suposed to do two things: 1) remove the bubble: $( 'div.bubble' ).remove(); and 2) load anothed bit of data that is meant for further processing in the page. The second one works fine, but the first one doesn't. Here some code snippets:
Next Page